Reputation: 217
I'm using Selenium IDE in Firefox to build test cases.
When I right-click on a select box and choose "Show All Available Commands," assertValue
is always grayed out. With text boxes and option boxes, I can use assertValue
to make sure that a specific value is set. Why is this functionality not available for select boxes? Or is there a trick needed to make Selenium IDE let me user assertValue
on an HTML select box?
If you want a concrete example, try the following:
assertValue
will be grayed out. Why can't I use assertValue
on this select box?Upvotes: 3
Views: 2405
Reputation: 10015
Here is how I sorted that out, add manually new command in the IDE:
Command: assertSelectedValue
Target: id=countrySelect
Value: Switzerland
Upvotes: 2
Reputation: 1906
You cannot use assertValue
on a dropdown select because select tag has only options, not the value attribute.
You can click on the languages dropdown and select from the options.
Below is the code for selecting a value from the dropdown list in IDE for the mentioned site.
open /advanced_search
click //option[@value='lang_el']
select lr label=French
Upvotes: 0
Reputation: 17376
Just because it's not available from "Show All Available Commands" does not necessarily mean you'll not be able to use it. Add a command to the IDE and select it in the sequence of operations in your test (i.e. from the "Table" view not the "Source" view). Now you'll see the "Command", "Target" and "Value" for your selected operation; just change the command to the one you require.
Upvotes: 2