In this article you can find the code snippets to use while editing web app monitoring scripts. These inline methods are not available via tool menu, but can be added manually in the code editing mode.

Create your own reusable code snippets to simplify script creation and ensure consistency across your monitoring and load testing setups. For more details, please see Code Snippets in EveryStep Recorder

Setting timeout for an element

bool WaitForElement(TimeSpan timeout, params string[ ], xpathes) – waits for the element for the duration specified in TimeSpan timeout (default 50 sec). Returns true as soon as the element is found or false after timeout.

Example:

tab0.WaitForElement(“xpath1”, “xpath2”, “xpath3”, …) – will search for the element up to 50 sec.

Checking for an element

bool Contains(params string[ ], xpathes) – checks for the element and returns true or false immediately.

Example:

tab0.Contains(“xpath1”, “xpath2”, “xpath3”, …)