Selenium IDE:获取表中的行数 [英] Selenium IDE: Get row count in table

查看:401
本文介绍了Selenium IDE:获取表中的行数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用Selenium IDE获取给定表的行数?

How do I get the row count of a given table using the Selenium IDE?

当我右键单击表格时,我只能声明/验证以下内容:

When I right click on my table, I can only assert/verify the following:

  • 标题
  • 文字
  • 存在的元素

目标为

//div[@id='reports']/div[n]` where `n` is the number of rows.

推荐答案

您要使用storeXpathCount命令.这有两个参数,可以分别存储在IDE的TargetValue字段中,其中以下参数分别为:

You want to use the storeXpathCount command. This takes two parameters which can be stored within the IDE Target and Value fields where the following parameters are, respectively:

  • xpath :要评估的xpath表达式
  • variableName
  • xpath: the xpath expression to evaluate
  • variableName

这里是表id = reports的示例:

Command: storeXpathCount
Target: //div[@id='reports']/div[n]/table/tbody/tr
Value: myVarCount

其中,上方div[n]中的n是您的div编号.

where n in div[n] from above is your div number.

提示:右键单击打开Selenium IDE的表即可快速获取路径!

这篇关于Selenium IDE:获取表中的行数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆