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 | ||
Command | Target | Value |
setSpeed | 2000 | |
open | http://only-testing-blog.blogspot.com/2013/09/test.html | |
addSelection | name=FromLB | label=Mexico |
addSelection | name=FromLB | label=India |
addSelection | name=FromLB | label=Italy |
assertSelectedLabels | name=FromLB | Mexico,India,Italy |
assertSelectedValues | name=FromLB | MEX,IND,ITA |
You can VIEW EXAMPLES OF WEBDRIVER COMMANDS.
No comments:
Post a Comment