I need an xpath that will find some text containing HTML line breaks <br/>
. For example:
<ul>
<li>ABC<br/>DEF</li>
<li>XYZ<br/>NOP</li>
</ul>
Let's say I'm trying to find the li
that contains ABC<br/><DEF>
. I've tried the following:
$x("//li[normalize-space(.)='ABC DEF']")
$x("//li[text() ='ABC<br/>DEF']")
$x("//li[contains(., 'ABC DEF']")
But they return nothing. I saw this answer XPath contains(text(),'some string') doesn't work when used with node with more than one Text subnode but I couldn't figure out how to use it in my case.
1`. I think the only way to do this will be for my step definition to be something like `And I click on the 'Button|1' button` and I will be forced to use that pipe as the special character that indicates it contains a line break. Let me give it a few tries and I will mark this as correct. – Ruan Mendes Jan 03 '14 at 22:18