Selenium IDE - 如何获取 verifyNotText 的结果并执行正确的操作

Selenium IDE - how to get result of verifyNotText and do the right action

我正在使用 Selenium IDE,而且我必须只使用该工具。 我有这种情况:我检查我的邮箱是否包含消息。 唯一的办法就是检查页面上是否有某个字符串。

我已经应用了这个

Command: verifyNotText
Target: //form[@id='messages']/table/tbody/tr/td[5]
Value: "on behalf of:.*"

如何查看此命令的结果? 我的意思是:如果结果为真,测试将继续执行命令列表, 相反,它应该执行其他命令。

我想使用类似的东西:

Command: gotoif 
Target:  previous command
Value:   goAhead

你有什么建议吗?

提前致谢! C

尝试使用storeTextPresent。如果你想使用gotoIf函数,你需要一个变量。

storeTextPresent on behalf of:.* text //text is a variable name
gotoIf ${text}==on behalf of:.* Yes //Yes and No are labels
gotoIf ${text}!=on behalf of:.* No
label Yes 
//instructions if text present equals "on behalf of:.*"
goto End
label No
//instructions if text present not equals "on behalf of:.*"

另一个有用的东西可能是使用 goto 函数。如果您想跳转到特定步骤,您可以 "drive" 使用此功能进行测试。 示例:

goto End //jump to label End
label End

希望对您有所帮助! 有什么不明白的,欢迎留言