Execute JavaScript and verify the result

With the XBrowser Engine 3.0, you can execute JavaScript calls on web pages and verify the result.

Execute JavaScript

To execute JavaScript call, use the Module Execute JavaScript.

This Module is part of the Standard subset. You can find it under Standard modules->TBox XEngines->Html.

In this example, the XBrowser Engine 3.0 redirects the first open browser window that it finds to the page http://support.tricentis.com.

Example - Execute JavaScript

If the string in JavaScript contains double quotation marks ", you must escape the string with two additional sets of quotation marks.

Example: window.location.href="""http://support.tricentis.com"""

Verify JavaScript Result

To verify the result of a JavaScript call, use the Module Verify JavaScript Result.

This Module is part of the Standard subset. You can find it under Standard modules->TBox XEngines->Html.

In this example, the XBrowser Engine 3.0 retrieves the cookies of the first open browser window that it finds and verifies that the value returned is username=Jane Doe; language=en-US.

Example - Verify JavaScript result

If the string in JavaScript contains double quotation marks ", you must escape the string with two additional sets of quotation marks.

Example: window.location.href="""http://support.tricentis.com"""