Selenium:测试元素是否包含一些文本 [英] Selenium: test if element contains some text
本文介绍了Selenium:测试元素是否包含一些文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
< p id =fred> abcde< / p>
'id = fred'containsbcd= true)
解决方案 div>
在这种情况下, Selenium-IDE文档很有用。
您正在查找的命令是 assertText
,定位器将是 id = fred
和文本例如 * bcd *
。
With Selenium IDE, how can I test if an element's inner text contains a specific string? For example:
<p id="fred">abcde</p>
'id=fred' contains "bcd" = true)
解决方案
The Selenium-IDE documentation is helpful in this situation.
The command you are looking for is assertText
, the locator would be id=fred
and the text for example *bcd*
.
这篇关于Selenium:测试元素是否包含一些文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文