How often and when do you like to use XPath?
I was always advised to give least importance to XPath (structure based locator)
Not very often, but I don’t hesitate to use it where it suits me. Years ago people talked about XPath performance problems, in the same time in my tests I found that CSS pseudo-classes do not work for me in some browsers. A few years ago one guy posting to automation community tested performance of the two types and his conclusion was that XPath performance is as good as CSS selectors (providing both are built reasonably). Support of CSS pseudo-classes also developed.
So — use whatever suits you, the most important thing IMO is that your locators look reasonable and are bound to some well-marking attribute, not just to the structure.
You must be logged in to reply to this topic.