The problem in topic, I am trying to acces an iOS application's element using xpath.
Appium log:
debug: Appium request initiated at /wd/hub/session/ff4f1220-d4ea-4c0a-ad2c-704c6bc03b86/element
debug: Request received with params: {"using":"xpath","value":"//button[@name='Add']"}
info: Pushing command to appium work queue: "au.getElementByXpath('\\/\\/button[@name=\\'Add\\']')"
debug: Sending command to instruments: au.getElementByXpath('\/\/button[@name=\'Add\']')
....
....
....
info: Responding to client with error: {"status":17,"value":{"message":"An error occurred while executing user supplied JavaScript.","origValue":"'undefined' is not a function (evaluating 'function(e, el) {\n var elid = this.getId(el);\n results.push({ELEMENT: elid});\n }.bind(this)')"},"sessionId":"ff4f1220-d4ea-4c0a-ad2c-704c6bc03b86"}
When I try to acces the same element by name, everything works fine.