2

Is it possible to check that a text is contained in the text of an element using the FluentAutomation framework ?

The example provided in the documentation is for matching exact text http://fluent.stirno.com/docs/#asserts-text

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

How do I check the element contains the text ?

Ex: header text is "Random text I don't need Mytext and etc."

I want to assert that header contains "MyText" using FluentAutomation

Adrian M
  • 103
  • 7

1 Answers1

2

I used Assert.True http://fluent.stirno.com/docs/#asserts-true and evaluated if I find the element that contains the wanted string :

I.Assert.True(() => I.Find(MyElement).Text().Contains("teststring"));
Adrian M
  • 103
  • 7