Silk Test Classic provides support for executing JavaScript code within a Web application. You can test applications that include JavaScript by performing one of the following tasks:
- Configuring an xBrowser application that uses the Open Agent.
- Enabling extensions for a generic application that uses the Classic Agent.
The type of agent that you use determines the classes that are available for you to create tests with.
As a best practice, we recommend using xBrowser rather than the Web application because xBrowser uses the Open Agent and dynamic object recognition.
We recommend recording test cases using dynamic object recognition. Then, replay the tests at your convenience.
JavaScript Support for the Open Agent
With the Open Agent, you can use
ExecuteJavaScript to test anything that uses JavaScript. You can:
- Call any function already contained in a document.
- Inject new functions into a document and call them.
- Trigger Document Object Model (DOM) events, such as calling
onmouseover directly for an element.
- Modify the DOM tree.
JavaScript Support for the Classic Agent
If you use the Classic Agent, you can test JavaScript using the following methods:
- ExecLine
- ExecMethod
- ExecScript