In this article you can find the code snippets to use while editing scripts in EveryStep Scripting Tool Desktop. These inline methods are not available via tool menu, but can be added manually in the code editing mode in EveryStep Scripting Tool Desktop version only.

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”, …)