verifying that only specific values are present in a drop down list

rabbithell at 16h57
23
May
2011
verifying that only specific values are present in a drop down list

Hi there, I hope someone is able to help me. I am trying to determine whether or not Selenium IDE can verify that only specific values are present in a drop down list, and should anything else appear within the drop down list other than that which I am expecting is an error.

For example, using a basic html Single Select drop down list
---------------------------------------------

---------------------------------------------
I know I can verify the 'Label' of each selectable value using (for example) :
verifySelectedLabel : //select[@id='drop_down_list'] : Please select...

I know I can verify the 'Value' of each selectable value using (for example):
verifySelectedValue : //select[@id='drop_down_list'] : Test

And I know I can do this for each other selectable value displayed.

But what if for whatever crazy scenario, a Dev decided to add 'Ford' to the drop down list, and he/she did not make anyone aware of this ? My tests would pass as those selectable values which I am expecting are still present.

Is there is a way of verifying that no other values other than those I am expecting are also contained within the drop down list ?

I know there are 'verifyNotSelectedLabel' and 'verifyNotSelectedValue', and these work perfectly when I can specify the 'Labels' and 'Values' accordingly, but they dont help in this particular scenario.

Fingers crossed someone can help, many thanks in advance to all,
Rabbithell
About
This topic belongs to the forum
  • Numbers of topics : 2338
  • Numbers of messages : 6053
  • Numbers of users : 5040
  • Numbers of points : 139
Similar topics
Hi all I want to throw an exception if ,a string given in excel sheet is not present in the drop down list of an application. how to check whether a string is present in the drop down list or not. Can anyone help me...!!
Hi, I have to slect values in dropdown using datadriven. for e.g $var1="Abc" Select name=$var1 I have used this code and while running encounetring error label with $var1 is not found. Can anyone help.
Hi, how can i select and click on any one item present in combo box(Timesheet CR,zzz,Other Activities) below is my html code Code: <div class="x-combo-list-item x-combo-selected" style="white-space:
Capturing Drop down Values Using Selenium RC + TestNg Hello All, Please Tell me How to capture a Drop Down List Values Using Selenium RC.Is there any command to Do that For Example if there is a Drop down list of Stat
I am using selenium in Firefox. My application is having a ajax drop down list with autosuggestion option from where i need to select data. When I start typing in the text area, autosuggest control provides similar options available in the
Forums from same category