How to use "assertSomethingSelected" and "assertNotSomethingSelected" commands in selenium IDE

"assertSelectOptions" and "assertNotSelectOptions" commands are useful to assert that required values in list box are selected or not. Few days back, I had posted article with good working example of "assertSelectOptions" and "assertNotSelectOptions". "assertSomethingSelected"
and "assertNotSomethingSelected" commands  has little different function compared to them. Both these commands are also used for assertion of selection in list box or drop down of software application page but not with targeted values. If you list box values changing frequently then you can use both these commands.

"assertSomethingSelected" command in selenium IDE
"assertSomethingSelected" command will verify list box or dropdown and return '[error] false' in log and stop remaining command's execution if any single value is not selected from list box. If any one value is selected from list box then command will be pass.

New Test
CommandTargetValue
openhttp://only-testing-blog.blogspot.com/2013/09/testing.html
addSelectionname=FromLBlabel=Italy
assertSomethingSelectedname=FromLB
assertNotSomethingSelectedname=FromLB

In above example, "assertSomethingSelected" command will be pass because initially one value is selected from list box. So "assertNotSomethingSelected" command will fail in this case and return error '[error] true' in log.

Selenium IDE "assertNotSomethingSelected" command
Opposite to "assertSomethingSelected" command, it will return '[error] true' if any single value is selected from list box.

New Test
CommandTargetValue
openhttp://only-testing-blog.blogspot.com/2013/09/testing.html
assertNotSomethingSelectedname=FromLB
assertSomethingSelectedname=FromLB

In this example, "assertNotSomethingSelected" command will pass but "assertSomethingSelected" command will fail and return '[error] false' because there is not any selected value from list box.

So this is the only demo example. I posted many more examples of Selenium IDE commands to make your software regression testing process easy if you learn and use them in real scenarios.

No comments:

Post a Comment