Selenium2Library关键字Wait Until Element Contains
Selenium2Library关键字Wait Until Element Contains
作用:等待指定的节点对象的文本内容中,包含某个指定的文本内容
参数Arguments:
[ locator | text | timeout=timeout | error=error ]
Locator:为节点、元素的xpath,非某个属性,即xpath最后不能为@属性或者 text()结尾
Text:希望包括的内容,模糊匹配,从xpath指定的元素的文本内容中匹配,切记文本内容
Timeout:超时时间,超过了指定时间,还没有出现就认为失败,单位s
Error:文本信息,没有找到指定的内容,显示的错误提示信息
例如:如下百度,新闻就是元素a的文本内容
关键字 | locator | Text | Timeout | Error |
---|---|---|---|---|
Wait Until element contains | xpath=//*[@id=“u1”]/a[@name=”tj_trnews”] | 新闻 | 5 | 没有找到指定的内容:压测 |