Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Selenium Robotframework:如何使用Tabindex作为定位器?_Selenium_Robotframework - Fatal编程技术网

Selenium Robotframework:如何使用Tabindex作为定位器?

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"> <

我希望这里的社区能帮助我。为了一个相当简单的输入,我不得不使用一个测试用例。 问题是,在网页上,我有两个需要填充的输入字段。两者的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="120">
我在这里失败了:

消息:找不到定位器为“tabindex:100”的元素

还有别的选择吗


谢谢。

您不能以这种方式查询tabindex
tabindex
是一个属性,因此简单的xpath如下:

//input[@tabindex='100']

您不能以这种方式查询tabindex
tabindex
是一个属性,因此简单的xpath如下:

//input[@tabindex='100']

由于
tabindex
是一个属性,您是否尝试过
//输入[@tabindex='100']
?谢谢。这似乎很管用!再次感谢。既然
tabindex
是一个属性,您是否尝试过
//输入[@tabindex='100']
?谢谢。这似乎很管用!再次非常感谢。