WaitForElementPresent and WaitForElementToLoad - Selenium IDE command

WaitForElementPresent and WaitForElementToLoad are no longer needed with Kantu for Chrome and its implementation of the Selenium IDE commands. Just like webDriver, the new Kantu IDE uses implicit waiting.

Sometimes elements take their time to appear on a page when you are navigating through pages or clicking on buttons or doing something else. The typical example here would be a button click that triggers an ajax call to the backend, and some time later the web page is updated. In the classic Firefox Selenium IDE "waitForElementPresent" command was used to pause selenium playback while targeted element is not present on the page. Once element appears on the page, selenium would continue executing next command.

Now: An implicit wait tells WebDriver/Selenium IDE to poll the DOM for a certain amount of time when trying to find an element or elements if they are not immediately available. In webDriver code this looks like driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);. In Kantu for Chrome you can set the default timeout in the settings page and also change it on a per macro basis with the Store | new value | !TIMEOUT_WAIT variable:

Implicit waiting with timeout_wait in action

Implicit Waiting Example

Command Target Pattern/Text
open https://some url to generate a link.com/
store 120 !TIMEOUT_WAIT
Assume website needs some time to display the link (e. g. ajax call)
Kantu Status Display: Waiting for element to load (up to 120 seconds)
click link=Download link ready!

Works in

Kantu for Chrome Selenium IDE, Firefox IDE Classic

Related Demo Macros

Demo-Autofill, Demo-Frame

The ready-to-import-and-run source code of all demo macros can be found in the Github repository testmacros folder.

See also

storeEval, Web Automation Extension User Manual, Selenium IDE commands, Classic Firefox Selenium IDE.

Anything wrong or missing on this page? Suggestions?

...then please contact us.

Kantu Selenium IDE for Chrome and Firefox - Web Test Automation
Subscribe to the a9t9 automation software newsletter . We'll send you updates on new releases that we're working on.