Extending Web UI tests
See how you can extend the Web UI tests to include advance capabilities such as adding
JavaScript or Java code to tests.
- Adding custom JavaScript code as a test step in a Web UI test
You can add manually JavaScript files (*.js) to test scripts with defined functions. You might want to run your own JavaScript snippet such as retrieving some data from the application, doing some actions within the application, or validating some complex logic actions within the application for example. To be able to execute specific code in a test, write your own JavaScript code and insert the custom JavaScript statement as a new test step in your test script. - Replacing a JavaScript file in a test script
You can rename a JavaScript file in a project, delete it, or move it in the project, in all cases, the updates will apply in all test scripts in the project. When you rename a JavaScript file that is used in a Web UI test script from the Test Navigator, the system can automatically search for all references to the JavaScript file in the project and overwrite the custom JavaScript file with the updated one in all the test scripts where the JavaScript file is called. It is useful when you have multiple calls of the same JavaScript file in a single script.