robotframework - 机器人框架:验证值大于 10 的最简单方法是什么
问题描述
所以有一个网站:https ://www.guruwatch.nl/Aandelen/Default.aspx
我单击元素“koop”,然后我想验证顶部的值是否大于 10
id="ctl00_ctl00_ContentPlaceHolder1_RightContent_ListAandelen_repAandelen_ctl01_lblCountBuy"
最快的方法是什么?
我用了
Element Text Should Be ctl00_ctl00_ContentPlaceHolder1_RightContent_ListAandelen_repAandelen_ctl01_lblCountBuy 24
但那是为了完全匹配,我只想验证整数是否大于 10。
还有一个应该等于整数 first second
builtin
但不是 a 应该比整数大 应该比整数小
ps 为什么那些不是内置的?用这个有那么奇怪吗?
解决方案
* If
有很多方法可以使用可以在内置库中找到的关键字来检查一个值是否大于另一个值。以下是如何制作大于关键字的示例:
*** Test Cases ***
Test Positive
${value} Set Variable 24
Should Be Larger Than ${value} 1
Test Negative
${value} Set Variable 24
Run Keyword And Expect Error * Should Be Larger Than ${value} 100
*** Keywords ***
Should Be Larger Than
[Arguments] ${value_1} ${value_2}
Run Keyword If ${value_1} <= ${value_2}
... Fail The value ${value_1} is not larger than ${value_2}
推荐阅读
- mysql - 在mysql中执行大量操作时的精度损失
- python - Python处理列表/队列中的项目并保存进度
- windows - How to create libjson.lib using makefile on windows?
- svg - 如何在模型中插入图像?
- port - 端口 443 确切用途和描述
- apache-zookeeper - 如何将 Zookeeper 从 3.4.8 升级到 3.4.13?
- kivy - Kivy:动态添加屏幕小部件时出现属性错误
- c# - 在我获得将创建到新数据库的结果后,sqlite 有没有办法?
- c# - ASP.NET Core 中的 WCF 跟踪
- python-3.x - 为什么每次打开终端时都会收到此警告/错误消息?我应该如何解决这个问题?