I have got the following html element in my Application.
<td height="25">
<i>text1</i>
text2
</td>
My Objective is to get the td element for my test script.For this i got the text inside the td tag using the getText method for the below element.
xpath = "//td/i[contains(text(),'text1')]/parent::td"
The method returned the following text(with beginning spaces)
text1 text2
So i copied that text into the below xpath to get the td element.
xpath = "//td[contains(text(),'text1 text2')]"
However i get a NosuchElement Exception for the above element. How is this possible?
Note : I cannot use the first xpath in my script because there are several td elements like this with a common i tag text(text 1) but a different td tag text(text2, text3...)