问题
I can't be able to select values from the dropdown in selenium webdriver. I tried all the ways using name and xpath selectors. Please help.
The code is:
<span id="cboEmploymentTypeId" class="select" tabindex="0" name="cboEmploymentTypeId" unselectable="on" style="-moz-user-select: none; box-shadow: none;">
回答1:
Try this:
@browser.select_list(name:"cboEmploymentTypeId").option[1...n].select
来源:https://stackoverflow.com/questions/28935813/select-dropdown-in-selenium-webdriver