Select dropdown in selenium webdriver

旧城冷巷雨未停 提交于 2021-02-08 11:13:01

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!