tags:

views:

1251

answers:

3

I have this scenario: simple html form that is being processed with Ajax with clear (reset that form) button. I want to test clear function, hence the question: What is the right way to check that no values are selected from dropdown list with Selenium IDE?

I've tried assertSelectedValue command, but didn't find a way to specify the unselected value. So i switched to assertValue command which works smooth with input fields and checkboxes. But is it right to use it for dropdown lists? Even though test passes with specified dropdown list id as target and blank field as a value, i still can't get rid of a feeling something is wrong.

Any clarification is much appreciated.

A: 

Seems like I'm a couple of months late, but in case you're still thinking on this:

I'm not sure which the code in your dropdown list is. But any html dropdown has always a value selected.

For example with this html:

<select>
  <option>Please select a value</option>
  <option>Volvo</option>
  <option>Saab</option>
  <option>Mercedes</option>
  <option>Audi</option>
</select>

your test will be:

assertSelectedValue | "locator" | Please select a value |

in case your select has an empty first option, you can just leave the last column empty:

<select>
  <option></option>
  <option>Volvo</option>
  <option>Saab</option>
  <option>Mercedes</option>
  <option>Audi</option>
</select>

your test will be:

assertSelectedValue | "locator" |  |
Santi
A: 

Several months late, but if anyone else needs this:

assertNotSomethingSelected | "locator" | |
Brent
A: 

Another potential answer for you.

You have the following code snippet:

<select>
  <option value="0"></option>
  <option value="1">Volvo</option>
  <option value="2">Saab</option>
  <option value="3">Mercedes</option>
  <option value="4">Audi</option>
</select>

And you want to check on the name of the auto and not the value for the option.

You'll want to use :

assertSelectedLabel | "locator" |  | 
Sir Geek