Why does document.evaluate succeed in Firebug but fail in Selenium?

Posted by anil on Stack Overflow See other posts from Stack Overflow or by anil
Published on 2009-10-22T12:03:17Z Indexed on 2010/05/08 17:48 UTC
Read the original article Hit count: 226

Filed under:

browser.getEval function in selenium makes iterateNext return null ..Otherwise in firebug it returns a value(same script)

document.evaluate("//button[text()='Save']",
                  document, 
                  null,
                  XPathResult.ANY_TYPE,
                  null)
        .iterateNext()
        .disabled;

returns true

But

browser.getEval("document.evaluate(\"//button[text()='Save']\", 
                                     document,
                                     null,
                                     XPathResult.ANY_TYPE,
                                     null)
                         .iterateNext()
                         .disabled;");

returns that error as :

"com.thoughtworks.selenium.SeleniumException: ERROR: Threw an exception: res.iterateNext() is null "

© Stack Overflow or respective owner

Related posts about selenium