O'Reilly logo

Selenium 2 Testing Tools Beginner's Guide by David Burns

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using XPath Axis to find elements

As we have seen, XPath is normally only used if the element we need to interact with is not accessible by normal means. In this section of the chapter, we are going to have a look at leveraging XPath Axis in our queries to find the element that we wish to interact with.

An example that I have used in the real world was to find a table cell that had specific text, then traverse the tree backwards to find the edit button so that I could click on it. This may seem like an extreme example just to click on an edit button but is extremely common according to the Selenium Users forum on Google Groups.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required