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.
Procedure
To replace a JavaScript file with a new one:
- In a project, right-click on a JavaScript file in the Test Navigator, and select Rename.
- Enter a new name in the text field of the dialog that opens.
- Select Update test Assets that reference the renamed resource. Click Preview.
- A wizard displays all references to the JavaScript files in the project. Unselect the references that should not be updated and unselect Custom JavaScript change participant if you don't want any changes in the associated files. Click OK. A message prompts you to accept or abort the changes.