Martin Vondráček
Martin Vondráček

Reputation: 179

Brackets in XPath expressions in SeleniumIDE

I have a problem with SeleniumIDE's evaulation of XPath. SeleniumIDE seems to not know the round brackets in this xpath:

(//span[@class='section-name entry-box'])[last()]/input

It cannot find even this xpath:

(//span[@class='section-name entry-box'])[last()]

or

(//span[@class='section-name entry-box'])/input

But in FireFox FireBug console or in FireFox plugin XPather, all the xpaths works and finds one (or in the last example two) elements on the page.

Do you know any solution? I need to choose last element, which has specific class.

Upvotes: 2

Views: 972

Answers (1)

Ross Patterson
Ross Patterson

Reputation: 9569

Put "xpath=" at the beginning. Selenium locators can be a variety of different types, and Selenium assumes the type is XPath if the locator starts with "//". Your's doesn't, so you need to specify it explicitly.

Upvotes: 2

Related Questions