Selenium IDE “waitForChecked” and “waitForNotChecked” Commands With Examples

Check box is very essential element of any software web application page and you will find it on many pages so obviously we need to include it in our automation process. Selenium IDE has few commands which are specially developed for checkbox. In my earlier posts, we had seen many check box related commands like

check“, “storeChecked“, “uncheck” and MANY MORE. Other 2 check box related commands are “waitForChecked” and “waitForNotChecked”. Let me describe you both with proper examples.
“waitForChecked” Command
“waitForChecked” command is useful to wait till targeted check box change its status from unchecked to checked. You will find this kind of scenario sometimes. Maximum wait time will be default timeout of your selenium IDE.

New Test
Command Target Value
open http://only-testing-blog.blogspot.com/2014/01/textbox.html
waitForChecked //input[@id=’check2′]
echo Checkbox is checked now.. Please perform your next action
pause 2000
check //input[@id=’check3′]
“waitForNotChecked” Command
Same as “waitForChecked” command, “waitForNotChecked” command will wait till targeted check box change its status from checked to unchecked. Run above and bellow given examples in your selenium IDE window and observer result

New Test
Command Target Value
open http://only-testing-blog.blogspot.com/2014/01/textbox.html
waitForNotChecked //input[@id=’check1′]
echo Checkbox is UnChecked now.. Please perform your next action
pause 2000
check //input[@id=’check3′]

Leave a Reply

Your email address will not be published. Required fields are marked *