Support for Single Page Application Testing

Prev Next

Enhanced Wait Actions for Transaction scripts / Single Page Application tests

For Transaction tests, the Catchpoint agent relies on the Document Complete event to continue each action listed under a step. This ensures the referenced elements are present on a page. In certain cases, the agent is not loading a new page for the step, which can cause a problem. In this case, the agent will end up waiting for a Document Complete event that will never occur.

This situation can be addressed by adding a custom Catchpoint command "ignoreDocComplete" (not present in Selenium).

Catchpoint has two custom actions in addition to what Selenium provides. These actions do not rely on () brackets, and they can be used to replace the pause verb.

waitForNoRequest

This action tells the agent to wait for no HTTP requests on the wire/network for the specified time value amount before continuing to the next action. The time value can be between 1ms and 5,000ms. (1000 ms = 1 second)

Example:
waitForNoRequest(3000)

waitForURL

This action tells the agent to wait for the response to a request matching the specified URL. It allows for Regular Expressions to match the URL.

Example:
waitForURL(www.example.com/*)

waitForElementPresent

This action tells the agent to wait for the element to be present. Optional 2nd parameter to set the wait time in milliseconds. The timeValue can be between 50ms and 30,000ms. The default, if not specified, is 20,000ms.

Example:
waitForElementPresent(//*[@id='sample'], 2000)

AndWait

This action when used along with other commands such as Click or Run, ensures it creates a new step immediately after execution of the command. In other words, it ensures the test does not proceed to the next step immediately after performing a click or running another Selenium command. It also ensures the test waits for the page to load after a particular action is triggered where applicable.

Example:
clickAndWait("//*[@id='foo']")
runScriptAndWait("document.getElementById('foo').click();")