标签: html selenium protractor
如何在量角器selenium中获取选定的HTML下拉值? 它打印所有下拉值而不是选定值 我尝试了以下方法:
option:selected
option:clicked
option.getFirstSelectedvalue()
这些都不起作用。
有人可以帮我解决这个问题吗?
答案 0 :(得分:0)
如果您的下拉工具是HTML标记:<select>和<option>,则可以使用css选择器:element(by.css('option:checked')
<select>
<option>
element(by.css('option:checked')