The element that I’m talking about is the following:
<tbody>
<tr
id="tableUsers_0__TR"
class="active"
name="Tr_tableUsers[0]_Selected">
<td>
<input
id="tableUsers_0__POSName"
type="hidden"
value="Indian"
name="tableUsers[0].POSName"/>
Indian
</td>
The solution that I propose is:
The first step is locate the element by XPath:
string xpath = ".//*[@id='tableUsers_0__PDVCode']/..";
Then get the text with the method:
driver.FindElement(By.XPath(xpath)).Text
Is it the best way? Or not?
Is there another better way than this way? Better than the use of XPath?