waitForVisible (locator) - Selenium IDE command

The waitForVisible tells the IDE to wait for an element to exist and be visible. This command will wait till element visible on the page. Once command will visible on page, the Kantu selenium IDE will go for executing next command.

Test page: Wait for element to become visible.

waitForVisible Example

(This page is work in progress. You find a full example in the DemoImplicitWaiting macro that gets installed with Kantu.)

Command Target Pattern/Text
open https://a9t9.com/kantu/demo/waitforvisible
waitForVisible css=#div1 > h1
echo The text is now visible

waitForNotVisible Example

The inverse version of waitForVisible would the waitForNotVisible of the classic Firefox Selenium IDE. It will wait for invisibility of the element on the page. This is very rarely used command and can be simulated easily with existing commands. So we decided to not support it with Kantu to keep things lean.

You can recreate waitForNotVisible with the while / endWhile loop. The loop checks the result of WaitForVisible via the !statusOK internal variable. When the element is (still) visible the !statusOK is TRUE and the while loop continues. But once the element is hidden (and after waiting for it until !timeout_wait) then !statusOK is FALSE and the while loop breaks and the macro continues. You need to set !errorIgnore = TRUE so the macro does not stop at the "element not visible" error. The screencast below shows the macro in action.

Command Target Pattern/Text
open https://www.w3schools.com/howto/howto_js_toggle_hide_show.asp
store true !errorignore
while ${!statusOK}
waitForVisible id=myDIV
endWhile
echo The text is now hidden!
store false !errorignore

Works in

Kantu for Chrome Selenium IDE, Kantu for Firefox Selenium IDE, Firefox IDE Classic

Related Demo Macros

ClickandWait is part of almost every demo macro-

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

See also

clickAndWait, 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.