2

是否可以使用 FluentAutomation 框架检查文本是否包含在元素的文本中?

文档中提供的示例用于匹配精确文本 http://fluent.stirno.com/docs/#asserts-text

I.Assert.Text("FluentAutomation").In("header"); 

如何检查元素是否包含文本?

例如:标题文本是“我不需要 Mytext 等的随机文本”。

我想使用 FluentAutomation 断言标题包含“MyText”

4

1 回答 1

2

我使用 Assert.True http://fluent.stirno.com/docs/#asserts-true 并评估是否找到包含所需字符串的元素:

I.Assert.True(() => I.Find(MyElement).Text().Contains("teststring"));
于 2016-08-04T13:42:17.687 回答