How to resolve Method threw org.openqa.selenium.InvalidSelectorException
exception when we have the xpath has //td/text()[following-sibling::br and contains(.,'text')]
Edited: My bad, misspelled. I need to select text1 only to identify the object but when I use the above XPath then selenium throws the exception. If I use //td[text='text1'] this identifies full td element. Once I find text1 then i need to find checkbox inside the label.
labelText is unique and text1 or text2 is unique.
Dom object looks like below.
<td><label>labelText<input></label>"text1"<br><label>labelText<input></label>"text2"<br></td>