Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.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
Testing Selenium IDE使用xpath和索引获取元素_Testing_Xpath_Indexing_Automated Tests_Selenium Ide - Fatal编程技术网

Testing Selenium IDE使用xpath和索引获取元素

Testing Selenium IDE使用xpath和索引获取元素,testing,xpath,indexing,automated-tests,selenium-ide,Testing,Xpath,Indexing,Automated Tests,Selenium Ide,我试图断言三个元素是可见的。我设置了以下命令来存储xpath计数: storeXpathCount | xpath=//input[contains(@class,"k-formatted-value") and contains(@class, "call-timer-editor")] | x 和x=“3”,这是正确的。现在,我想断言这三个输入都是可见的。因此,我: verifyVisible | xpath=//input[contains(@class,"k-formatted-val

我试图断言三个元素是可见的。我设置了以下命令来存储xpath计数:

storeXpathCount | xpath=//input[contains(@class,"k-formatted-value") and contains(@class, "call-timer-editor")] | x
和x=“3”,这是正确的。现在,我想断言这三个输入都是可见的。因此,我:

verifyVisible | xpath=//input[contains(@class,"k-formatted-value") and contains(@class, "call-timer-editor")][1] | 
verifyVisible | xpath=//input[contains(@class,"k-formatted-value") and contains(@class, "call-timer-editor")][2] | 
verifyVisible | xpath=//input[contains(@class,"k-formatted-value") and contains(@class, "call-timer-editor")][3] |

第一行计算结果为true,但另一行(肯定可见)计算结果为false。我应该如何正确地索引到这三个输入?

由于您没有发布代码或链接到正在自动运行的页面,我只能猜测。试试这个:

xpath=(//input[contains(@class,"k-formatted-value") and contains(@class, "call-timer-editor")])[2]

这个问题已经被问到了