1
如何使用Selenium IDE获取给定表格的行数?Selenium IDE:获取表格中的行数
当我右键单击我的表,我只能断言/验证以下内容:
- 标题
- 价值
- 文本
- 表
- 元现
与目标是
//div[@id='reports']/div[n]` where `n` is the number of rows.
如何使用Selenium IDE获取给定表格的行数?Selenium IDE:获取表格中的行数
当我右键单击我的表,我只能断言/验证以下内容:
与目标是
//div[@id='reports']/div[n]` where `n` is the number of rows.
要使用storeXpathCount
命令。这需要其可以在以下参数,分别被存储在IDE Target
和Value
字段内的两个参数:
这里是一个例子,其中表id = reports
:
Command: storeXpathCount
Target: //div[@id='reports']/div[n]/table/tbody/tr
Value: myVarCount
其中n
在div[n]
从上面是您的div编号。
提示:用Selenium IDE打开你的桌面,右键点击你的桌面,快速找到路径!
你有没有试过这个:http://stackoverflow.com/questions/19155430/selenium-how-to-count-the-number-of-rows-in-a-table –
@ThiagoCustodio我做了,两个答案有无关紧要的。一个是Selenium WebDriver,另一个或者过时或者不正确。虽然我只是想出了一个解决方案 – 8protons