waitForVisible - Selenium IDE
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 UI.Vision RPA selenium IDE will go for executing next command.
Test page: Wait for element to become visible.
waitForVisible combined with !statusOK can be used to recreate the assertVisible/verifyVisible and assertNOTVisible/verifyNOTVisible commands of the old Firefox Selenium IDE. Another option to check for visibility are the visual GUI testing commands like visualAssert, visualVerify and visualSearch.
The macro below is a basic example. You find a more detailed example in the DemoImplicitWaiting demo macro that gets installed with the RPA software!
|waitForVisible||css=#div1 > h1|
|echo||The text is now visible|
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. Just like with assertVisible mentioned above, we decided to not support it with UI.Vision RPA software to keep things lean.
You can recreate waitForNotVisible with the while / end 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.
|echo||The text is now hidden!|
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.
Anything wrong or missing on this page? Suggestions?
...then please contact us.