This :
1/ verifySelectedValue, id=pid, 2
2/ verifySelectedLabels, id=pid, Linux
works for me with Selenium IDE 1.0.2
Régis.
What you want is:
for HTML scripts:
verifySelected, pid, label=Linux
for Perl scripts:
$sel->selected_label_is("pid", "label=Linux");
I doubt you are interested to know that Linux has value=2. If you are interested to check this anyway, add:
for HTML scripts:
verifySelected, pid, value=2
for Perl scripts:
$sel->selected_label_is("pid", "value=2");
I hope you are using Perl scripts, because they are much more powerful than HTML scripts IMO. :)
Why not use "verifySelectedLabel, pid, Linux"? Or do you actually care about the order of choices? In which case you could add a second verification for "verifySelectedIndex, pid, 2",
As to the original check, you don't want label there, because that searches for <label for="pid"> not for the selected value. Label for pid has text()='Platform' and no value attribute.
To check for automatically selected element you could use "verifyElementPresent, //select[@id='pid']/option[@selected and ./text()='Linux'] but that only considers <option selected> in source which isn't the same as currently selected element if user has changed selection.
Posted by Merike at July 15, 2009 1:40 AM