"assertVisible" and "assertNotVisible" Commands Example For Selenium IDE

"assertVisible" and "assertNotVisible" Commands frequently used commands in selenium IDE if you are using selenium IDE for your software web application regression testing. Both "assertVisible" and "assertNotVisible" commands are useful to check element visibility on application software page.You can use
"assertVisible" and "assertNotVisible" commands to stop execution on fail and you can use "verifyVisible" and "verifyNotVisible" commands for further execution on fail. Let me give you simple examples.

"assertNotVisible" Command
"assertNotVisible" command will check element visibility on page and will pass if targeted element is not visible on page. If targed element is present on page then it will return '[error] true' in execution log and selenium will stop execution. Look in to bellow example, "assertNotVisible" will return '[error] true' in execution log because element is already there on page.

New Test
CommandTargetValue
openhttp://www.w3schools.com/css/css_display_visibility.asp
assertVisiblecss=#imgbox2 > input.box
assertNotVisiblecss=#imgbox2 > input.box

"assertVisible" Command
"assertVisible" command will check visibility of element on page and return '[error] false' if element not visible on page. In bellow example, "assertVisible" will return error because now targeted element is hided from page using previous "click" command.

New Test
CommandTargetValue
openhttp://www.w3schools.com/css/css_display_visibility.asp
clickcss=#imgbox2 > input.box
assertVisiblecss=#imgbox2 > input.box
assertNotVisiblecss=#imgbox2 > input.box

Try both commands in your software web application for better excercise.

No comments:

Post a Comment