1

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?

Steve Gray
  • 133
  • 8

1 Answers1

0

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

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

Yevgeniy Shunevych
  • 1,136
  • 6
  • 11