【发布时间】:2020-08-02 08:52:06
【问题描述】:
我有以下代码:
<span class="dropDown">Choose</span>
<div class="dropdownQuestions active" style="display: block; max-height: 310px;">
<span data-index="0" data-value="1" onclick="gt.setQuestion(this, true);">Warrior</span>
<span data-index="1" data-value="2" onclick="gt.setQuestion(this, true);">Mage</span>
<span data-index="2" data-value="3" onclick="gt.setQuestion(this, true);">Sorcerer</span>
如果可能的话,我想要的是下拉列表的列表,所以在我可以使用其中一个单击之后,我进行了很多搜索,但找不到任何对我有帮助的答案。
其他选项是使用数据索引或数据值字符串单击。 我想要的最后一个选项是点击字符串“Warrior”、“Mage”或“Sorcerer”,但如果没有其他方法,我会很高兴的。
谢谢!
【问题讨论】:
标签: java selenium selenium-webdriver