Posts

Showing posts with the label webdriver

How to select element from a list and go to parent and then sibling (by Xpath)

How to select element from a list and go to parent and then sibling (by Xpath) I am trying to find a way to press button that is in the same tr as text with which I can localize specific file that I'd like to download. I'll describe it in details: there is a website that contains many tr. Each tr contains couple child td. These td contain description and download button. I need to localize desired tr by description of its td. Then I'd like to go to td that contains download button for this tr. Descriptions are different but I am interested only in those that contain 'DV' text. There is always couple of them on a website but I'd like to select first. What i've figured out so far is: $x("//*[contains(text(), 'DV')]")[0] And then I have no idea how to go to parent element and then to sibling td that contains download button. HTML looks something like that <tr> <td class='a'>DV some other characters1</td><td class=...