0

I have a problem selecting the options in unidentified dropdown menu. Elements of the dropdown appears when i click on dropdown arrow, but I cant click on them, because I don't know their id's or other properties that I can use. Here is the code. I can't select from select_list with:

on_page(RegistrationPage).id_of_select_list_with_options = "8"

or

@browser.select_list(:name => "field_profile_bday[0][value][day]").select("8")

or

@browser.select_list(:id => "edit-field-profile-bday-0-value-day").select("8")

The error is: Element is not currently visible and so may not be interacted with (Selenium::WebDriver::Error::ElementNotVisibleError)

When I click on combo-button element dropdown list appears, but I can't select elements in it because they appear in combo-selected div after selecting. (Like "Jour" text in combo-selected div, it is there by default) Here is the html:

    <div class="form-item" id="edit-field-profile-bday-0-value-day-wrapper">
 <label for="edit-field-profile-bday-0-value-day">Jour : <span class="form-required" title="Ce champ est obligatoire.">*</span></label>
 <select name="field_profile_bday[0][value][day]" class="form-select required  date-day" id="edit-field-profile-bday-0-value-day" ><option value="" selected="selected">Jour</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option><option value="31">31</option></select>
</div>
<div class="combo-wrapper" style="display: inline-block; width: 61px; height: 24px; " tabindex="0"><div class="combo-button" style="width: 24px; height: 24px; display: inline-block; ">+</div><div class="combo-selected" style="width: 37px; height: 24px; display: inline-block; ">Jour</div></div>
<div class="combo-button" style="width: 24px; height: 24px; display: inline-block; ">+</div>
<div class="combo-selected" style="width: 37px; height: 24px; display: inline-block; ">Jour</div>
"Jour"
</div>
4

1 に答える 1

0

.select("8") の代わりに。次のようなものを試してください:

@browser.select_list(:name => "field_profile_bday[0][value][day]").option(:value, '8').select

また

@browser.select_list(:name => "field_profile_bday[0][value][day]").options[7].select

オプション要素を指定してから、固有の選択方法を使用する必要があると思います。これがうまくいくことを願っています。幸運を!

于 2012-07-20T18:06:23.180 に答える