Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got the following XPath expression's working in firebug, that returns the correct element(s):

$x("(//input[@class='intervalInput timeInput'])")

returns two elements.

$x("(//input[@class='intervalInput timeInput'])[1]") 
$x("(//input[@class='intervalInput timeInput'])[2]")

Each of the above return the correct element.

However; when I run the following code:

var matchedElements = this._selenium.GetXpathCount("(//input[@class='intervalInput timeInput'])");

The matched elements is 0.

I have also tried:

var matchedElements = this._selenium.GetXpathCount("xpath=(//input[@class='intervalInput timeInput'])");

Any Help will be greatly appreciated.

share|improve this question
which language binding of Selenium are you using? – Tarun Jun 15 '11 at 13:39
up vote 2 down vote accepted

Have managed to resolve by using Selenium 2.0 as apposed to 1.0, apparently some issues with using XPATH 2.0 with Selenium 1.0 but seems to be working fine with 2.0.

share|improve this answer

Did you try removing the parenthesis surrounding the xpath?

xpath="//input[@class='intervalInput timeInput']"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.