开发者

Selenium Selenium.Core v1.1.4322 - XPath not working

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 mat开发者_StackOverflow社区ched elements is 0.

I have also tried:

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

Any Help will be greatly appreciated,

Cheers.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜