比较ranorex中的两个值 [英] compare two values in ranorex
问题描述
我们正在使用Ranorex 5.02,我们需要在网站UI和生成的pdf文件中比较值(数字),这些值始终相同.每次系统将为UI和pdf文件生成新值.我们需要检查新生成的值是否正确. 添加验证方法并没有真正的帮助,因为系统记录了实际数量,并且在运行测试脚本后再次验证失败.我们尝试在验证中创建变量,系统显示无限制的变量消息.
We are using Ranorex 5.02 We need to compare values (numbers) in website UI and generated pdf file these values always are the same. Each time the system will generate new values for UI and pdf file. We need to check that the new generated values are correct. Adding validation methods not really help because the system recorded actual number and after running test script again validation is failed. We tried to create variables in validations the system displays unbounded variable message.
非常感谢您的帮助.
推荐答案
You can use the "Get Value" action in order to store the values into a variable. After that you can compare the values using the "Equals" method from the String class in .NET.
public void CompareText(string webText, string pdfText)
{
if(webText.Equals(pdfText))
{
Report.Info("Text is equal!");
}
else
{
Report.Info("Text is NOT equal!");
}
}
这篇关于比较ranorex中的两个值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!