Closed omershatil closed 8 years ago
It's there. https://github.com/admc/wd/blob/master/doc/jsonwire-full-mapping.md
and search for elementByXPath.
POST /session/:sessionId/element
Search for an element on the page, starting from the document root.
you can use waitForElementByXPath also.
It's in the documentation, but it doesn't seem to be implemented in code. Please try what I did and you'll see that you get 'undefined' for the function...
could you send me your script with this url as an example: http://admc.io/wd/test-pages/guinea-pig.html ?
It is now working for me. Apologies. I must have done something wrong.
Not a bug
It seems like the elementByXPath method does not exist, while elementByXPathOrNull does. I am using the latest wd node module (0.3.12) with nodejs (0.12.6) to automate Appium tests.. Here's some code: driver = wd.promiseRemote(serverConfig); driver.init(desired).then(function () { return driver.get(myUrl).then(function () { ... At this point, when inspecting the driver variable (I am using WebStorm) and using a watch for driver.elementByXPath I get "undefined". If I look at the value of driver.elementByXPathOrNull I can see that it's set to a function. I proceed to use the elementByXPathOrNull() and it works fine. elementByXPath() of course does not work as it is undefined...