Web Testing With Safari: One Possible Approach
Develop | Posted August 03, 2010

While TestComplete officially supports web testing in Microsoft Internet Explorer, Mozilla Firefox, Netscape Navigator and any browser based on the Microsoft WebBrowser control, you can also use it to simulate mouse clicks and keystrokes over web pages that are displayed in the Safari browser.

If you are web testing in Safari, TestComplete allows you to access web page elements through its Microsoft Active Accessibility (MSAA) Support plug-in. All you have to do is modify the MSAA settings of your project:

  1. Right-click your project in the Project Explorer panel and select Edit | Properties from the ensuing context menu. This will open the project properties for editing.

  2. In the editor, select Open Applications | MSAA from the tree on the left. This will open the MSAA properties dialog.

  3. Add two class names: SearchableWebView and WebViewWindowClass to the List of accepted windows table. For this purpose click Add and enter the class names to the edit boxes.

    Make sure that the appropriate check boxes are selected.

  4. Select File | Save from TestComplete’s main menu to save the changes.

  5. Now TestComplete can recognize the elements of the pages displayed in Safari. To check this, open a web page in Safari and switch to the TestComplete Object Browser:

    Safari Page in the TestComplete Object Browser

    As you can see, TestComplete has access to web page elements. It displays the hierarchy of elements on the page in the Object Browser.

    Note that the MSAA technology does not support HTML properties like innerText, style, id and some others. By using this approach, you can create simple web tests that simulate clicks or keystrokes.

    If you are interested in trying web testing with TestComplete, download and try TestComplete for free.


By submitting this form, you agree to our
Terms of Use and Privacy Policy

Thanks for Subscribing

Keep an eye on your inbox for more great content.

Continue Reading

Add a little SmartBear to your life

Stay on top of your Software game with the latest developer tips, best practices and news, delivered straight to your inbox