我有一套Selenium测试,我在Selenium IDE中创建并移植到Java.在几个测试中,我使用verifyTextPresent命令的Java等价物来确认页面上的一些文本(verifyTrue(selenium.isTextPresent())).
从IDE运行测试时,我在页面上的文本中发现了拼写错误,但是在通过Selenium RC/TestNG运行测试时未捕获到错误.这是我的代码示例和导致问题的文本(拼写错误以粗体显示):
文本:
请更正下面指出的错误.
您需要添加一个至少一个约束.
IDE:
verifyTextPresent | Please correct the errors indicated below.
verifyTextPresent | You need to add at least one restriction.
Run Code Online (Sandbox Code Playgroud)
Java的:
verifyTrue(selenium.isTextPresent("Please correct the errors indicated below."));
verifyTrue(selenium.isTextPresent("You need to add at least one restriction."));
Run Code Online (Sandbox Code Playgroud)
由于测试的两个版本都有正确的文本,为什么Selenium RC版本没有捕获错误?有没有其他人有这个问题?
| 归档时间: |
|
| 查看次数: |
3835 次 |
| 最近记录: |