Selenium IDE "assertSelectedLabels" and "assertSelectedValues" Commands With Examples

First of all please look at THIS POST where I have described difference between label and value in drop down or list box. Don't get confused from these two words. Selenium IDE has many assertion commands and all of them are designed for different purpose. Here i am going to describe you "assertSelectedLabels"
and "assertSelectedValues" commands but you can look at examples of related commands like "assertSelectedIds", "verifySelectedValues" etc.

"assertSelectedLabels" Command
"assertSelectedLabels" command is useful to assert multiple selected options using its label. You can also assert single selected label from list box using this command.

"assertSelectedValues" Command
"assertSelectedValues" command is designed to assert multiple selected options using its option's value. 

Selenium IDE will stop execution if any assert command will fail.

Bellow given example will show you clear difference between "assertSelectedValues" and "assertSelectedLabels" commands. Execute it in selenium IDE and observe result.

New Test
CommandTargetValue
setSpeed2000
openhttp://only-testing-blog.blogspot.com/2013/09/test.html
addSelectionname=FromLBlabel=Mexico
addSelectionname=FromLBlabel=India
addSelectionname=FromLBlabel=Italy
assertSelectedLabelsname=FromLBMexico,India,Italy
assertSelectedValuesname=FromLBMEX,IND,ITA

No comments:

Post a Comment