I try to write XPath expressions so that my tests won't be broken by small design changes. So instead of the expressions that Selenium IDE generates, I write my own.
Here's an issue:
This expression doesn't work at all. Input nodes named 'question' are spread across the page. They're not siblings.
I've tried using the intermediate expression, but it also fails.
error = Error: Element (//input[@name='question']) not found
That's why I suppose Selenium has a wrong implementation of XPath.
According to XPath docs, the position predicate must filter by the position in the nodeset, so it must find the seventh input with the name 'question'. In Selenium this doesn't work. CSS selectors (:nth-of-kind) neither.
I had to write an expression that filters their common parents:
Is this a Selenium specific issue, or I'm reading the specs wrong way? What can I do to make a shorter-expression?