This topic provides an overview of cross-browser test development with TestComplete. It includes the following sections:
Creation of cross-browser web tests with TestComplete is very similar to creating single-browser web tests: you use the same test commands to simulate user actions with web page elements, create checkpoints, run the browser, and so on. So, when we are speaking about cross-browser test creation, we are speaking more about methodology rather than test commands used.
Creation of cross-browser tests typically includes the following steps:
Prepare your test project and web browsers for testing.
Web browsers also require configuration. Please follow the instructions that are mentioned in Preparing Web Browsers. Although most of TestComplete web testing features are browser-independent, browsers demonstrate different behavior in some cases. Preparing browsers in the appropriate way decreases the number of differences and simplifies creation of automated web tests.
Record or create a test in one browser.
The easiest way to create web tests is to record them. For detailed information about this, see Creating and Recording Web Tests.
After you recorded the test, modify it if necessary (for instance, insert needed checkpoints), and then make sure that the test runs successfully on the browser that you used for recording.
Check if the test runs on another browser.
Select another browser for the run and check whether the test runs successfully in it. If necessary, change the test so that it takes into account the specifics of the new browser. See Handling Browser Differences.
Verify that the test is still playable for the previous browser.
In general, the changes you made to the test in the previous step can break the test for the previous browser. So, after you made all changes, run the test for the previous browser to ensure that it works successfully with it.
Repeat steps 3-4 for every browser you need.
Cross-Browser Testing Tips
These operations and methods are recommended ways to start browsers and open start pages for tests. Using other means may cause issues with creating cross-browser tests.
To access data of a web page element, use the
contentTextproperty. Do not use browser-specific properties like
innerTextin Internet Explorer and Edge, or
textContentin Firefox and Chrome.
To access the document object, use the
If your test uses data of element attributes, for instance, if it checks attribute values, pay attention to that data. Different browsers return attribute values in different formats. For example, Internet Explorer returns the value of a Color attribute as #ffaa00, while Firefox and Chrome return it as rgb(255,170,00). Even different versions of the same browser may return attribute values in different formats.
For more information on handling browser-specific behavior, see Handling Browser Differences.
More Information on Web Test Creation
|To learn more about ...||See these topics ...|
|Performing typical actions in TestComplete web tests like launching browsers, finding elements on pages, and so on||How To|
|Quick tips on performing typical web testing tasks, line checking for broken links, validating page structure and others||Web Testing - Examples|
|Creating checkpoints in tests||About Checkpoints|
|Parameterizing tests with external data||Data-Driven Testing|