Selenium Robotframework:如何使用Tabindex作为定位器?
我希望这里的社区能帮助我。为了一个相当简单的输入,我不得不使用一个测试用例。 问题是,在网页上,我有两个需要填充的输入字段。两者的CSS是相似的。唯一的例外是选项卡索引值Selenium Robotframework:如何使用Tabindex作为定位器?,selenium,robotframework,Selenium,Robotframework,我希望这里的社区能帮助我。为了一个相当简单的输入,我不得不使用一个测试用例。 问题是,在网页上,我有两个需要填充的输入字段。两者的CSS是相似的。唯一的例外是选项卡索引值 <input type="text" class=“text-dropdown-input-field " ag-class="getInputClass()" ag-keydown="inputKey($event, true, true, false, true)" tabindex="100"> <
<input type="text" class=“text-dropdown-input-field " ag-class="getInputClass()" ag-keydown="inputKey($event, true, true, false, true)" tabindex="100">
<input type="text" class=“text-dropdown-input-field" ag-class="getInputClass()" ag-keydown="inputKey($event, true, true, false, true)" tabindex="120">
我在这里失败了:
消息:找不到定位器为“tabindex:100”的元素
还有别的选择吗
谢谢。您不能以这种方式查询tabindex
tabindex
是一个属性,因此简单的xpath如下:
//input[@tabindex='100']
您不能以这种方式查询tabindex
tabindex
是一个属性,因此简单的xpath如下:
//input[@tabindex='100']
由于
tabindex
是一个属性,您是否尝试过//输入[@tabindex='100']
?谢谢。这似乎很管用!再次感谢。既然tabindex
是一个属性,您是否尝试过//输入[@tabindex='100']
?谢谢。这似乎很管用!再次非常感谢。