Reputation: 1
Can someone please help me. I'm trying to select an option from the drop down list using selenium IDE but not able to. Below is the HTML.I tried to use "Select"Command with xpath in target but not able to select from the options
<select id="age" class="default chzn-done"onfocus="javascript:setOmnitureFallout('birthdate');"name="ctl00$ContentPlaceHolder1$age" style="display: block; visibility: hidden;" tabindex="21">
<option value="0">0 - 11 months</option>
<option value="1">1 year</option>
<option value="2">2 years</option>
<option value="3">3 years</option>
</select>
<div id="age_chzn" class="chzn-container chzn-container-single chzn-container-active" style="width: 200px;" tabindex="21">
<a class="chzn-single" tabindex="-1">
<span style="background-color: transparent;">2 years</span>
<div>
<b/>
</div>
</a>
<div class="chzn-drop" style="left: -9000px; width: 198px; top: 41px;">
<div class="chzn-search" style="">
<ul class="chzn-results">
<li id="age_chzn_o_0" class="active-result" style="">Select one</li>
<li id="age_chzn_o_1" class="active-result" style="">0 - 11 months</li>
<li id="age_chzn_o_2" class="active-result" style="">1 year</li>
<li id="age_chzn_o_3" class="active-result result-selected" style="">2 years</li>
<li id="age_chzn_o_4" class="active-result" style="">3 years</li>
</ul>
Upvotes: 0
Views: 140
Reputation: 58
This is how I would use a 'select' command in general:
For the select element locator I would usually use it's xpath and for the option locator I would use label which can be specified as a regex. For example:
label=regexp:^This_Matches_the_Option_I_want_to_Select$
Hope this helps.
We can give you a more specific answer if you post the html code snipet of the page you are working on and the code you have already written.
Let me know in case you have any questions.
Upvotes: 0