Selenium IDE "verifyOrdered" and "assertOrdered" Commands Example

"verifyOrdered" and "assertOrdered" commands in selenium IDE are provided to verify the element's sort order of same parent node on software web application page. It will check sort order of element in ascending order. Look in to bellow given image.



Here 1st input node's sort order is 1 and 2nd input node's sort order = 2 and both of them are under same parent node.

"verifyOrdered" Command
"verifyOrdered" command will pass if specified both elements are in ascending order. Else it will return '[error] false' in log. But here selenium will not stop execution even if "verifyOrdered" command fails.

"assertOrdered" Command
Same way, "assertOrdered" command will be pass if both elements ordered else will return '[error] false' and selenium will stop execution.

Let we take example for above screenshot. Run bellow given test case in selenium IDE.

New Test
CommandTargetValue
openhttp://only-testing-blog.blogspot.com/2013/09/testing.html
verifyOrderedname=lnamename=fname
verifyOrderedname=fnamename=lname
assertOrderedname=lnamename=fname
assertOrderedname=fnamename=lname

First "verifyOrdered" will be fail because sort order of 'name=lname' and 'name=fname' is incorrect. 2nd "verifyOrdered" command will be pass. same way 3rd "assertOrdered" command will fail and selenium will stop execution.For more verification commands you can click here and for more assertion commands you can click here.

No comments:

Post a Comment