Search code examples
atata

Validating text after <br> in Atata


I have this table cell on my page:

<td>
<strong>Some Text</strong>
<br>random description
</td>

I'd like to come up with a way to validate the text after the br and have it return that as Text<T> so I can use the atata asserts (like Should.Equal("random description")) - separately from the text inside the <strong> but so far have been unable to do anything more than get that text as a string by getting the td via xpath and .Split("\r\n") it's Value - is there a way to get just this text?


Solution

  • You can do that by adding [ContentSource(ContentSource.LastChildTextNode)] attribute to your text control.

    Alternatively, you can invoke TextControl.GetContent(ContentSource.LastChildTextNode) method.