i am using selenium web driver for the test automation work for a web site. In that web site there is a page where it display details of a purchase order. It has multiple tables with no id/name associated with them. The design is using just “td” and “tr” elements. Each table can contain multiple rows,columns depending on the purchase order. I want to validate each and every field with given values. How can i get these dynamic details using Xpath?
Share
You can get the total number of
<tr>tags within a<td>tag by giving the xpath of the<td>element by using this function –Now you can use a for each loop to loop through each of the
<tr>tags in the above list and then read each value by using getText() method.Let me know if this helps you.