selenium - 如何使用 Selenium2Library 在 Robot Framework 中使用 RIDE 在动态表中添加数据
问题描述
您好,我是测试新手。我想通过在动态生成的表中添加值来测试应用程序。请帮助我如何在表格中添加价值,使用机器人框架和 RIDE。
*Settings*
Library Selenium2Library
** Variables **
${AddWhiteCityCode} Pune
** Test Cases **
Click AddWhiteCity
Click AddWhiteCity
** Keywords **
Click AddWhiteCity
Input Text xpath=(//td[contains(@class,"addWhiteCity"')])[1] ${AddWhiteCityCode}
我已经尝试了上述语法,但给出了 Invalid Xpath syntax Error Please help..
谢谢
抱歉,这是复制粘贴错误,我的代码中没有单引号。
这是我的实际代码。
Input Text xpath=(//td[contains(@class,"addWhiteCity")])[1] ${AddWhiteCityCode}
解决方案
你有单引号。因此,您将收到无效的 xpath 错误。
xpath=(//td[contains(@class,"addWhiteCity")])[1]
推荐阅读
- c# - 随机选择文档
- java - Android - 在 JUnit/Espresso 测试中更改语言环境以使用规则生成应用屏幕截图
- javascript - Javascript 问题:当鼠标悬停在 div 上时,如何从颜色数组中更改标题的随机颜色?
- python - Django中的嵌套关系
- javascript - 解析嵌套 JSON 并以特定格式显示
- angular - 在 Google Chrome 浏览器中使用 Angular 7 和 ASP.Net Core 2.2 的 ERR_INVALID_HTTP_RESPONSE
- angular - 在 Angular 中,是否可以根据用户是否经过身份验证来加载不同的模块?
- node.js - 使用 nodejs 编码的 jwt 令牌进行解码 使用颤振(飞镖)制作
- swift - Swift / ARKit:将对象节点放置在检测到的表面上而不触摸屏幕
- apache - Java 重定向 + 域