I am trying to search an element in my application using the following xpath xpressions but for some reason the third one fails and I can't tell the reason.
...
driver.findElement(By.xpath("//cell[@name="+Title+"]/UIAElement[@value="+message+"]"));
...
The application as it appear in the Appium inspector has a list of [cell] elements (GroupConv, GroupConv, ...) and its [cell] element has a list of 5 sub-elements.
My goal is to find an element that the name of the [cell] is "UFirstName.." and has a sub-element [element] with value "Ccv".
With the first xpath xpression, I can successfully find a [cell] element with name "UFirstName..".
Similarily, with the second xpath xpression I can successfully find an element with value "Ccv".
The problem comes when I want to combine the first two xpath xpressions in one, as shown in the third command.
It seems for some reason that appium does not like this xpath. Is there something specific that appium does not like in this xpath or something that I am doing wrong?
info: Pushing command to appium work queue: "au.getElementByXpath('\\/\\/cell[@name=TFirstName250 TLastName250]')"
info: [INSTSERVER] Sending command to instruments: au.getElementByXpath('\/\/cell[@name=TFirstName250 TLastName250]')
debug: Request received with params: {"using":"xpath","value":"//cell[@name=TFirstName250 TLastName250]"}
debug: Sending command to instruments: au.getElementByXpath('\/\/cell[@name=TFirstName250 TLastName250]')
info: [INSTSERVER] Socket data received (61 bytes)
info: [INSTSERVER] Socket data being routed for 'cmd' event
info: [INSTSERVER] Got result from instruments: {"status":0,"value":{"ELEMENT":"8"}}
info: Responding to client with success: {"status":0,"value":{"ELEMENT":"8"},"sessionId":"c534070d-5300-410c-9917-c11b3e5fce1d"}
POST /wd/hub/session/c534070d-5300-410c-9917-c11b3e5fce1d/element 200 1192ms - 109b
debug: Appium request initiated at /wd/hub/session/c534070d-5300-410c-9917-c11b3e5fce1d/element
info: Pushing command to appium work queue: "au.getElementByXpath('\\/\\/UIAElement[@value=Ccv]')"
info: [INSTSERVER] Sending command to instruments: au.getElementByXpath('\/\/UIAElement[@value=Ccv]')
debug: Request received with params: {"using":"xpath","value":"//UIAElement[@value=Ccv]"}
debug: Sending command to instruments: au.getElementByXpath('\/\/UIAElement[@value=Ccv]')
debug: Appium request initiated at /wd/hub/status
info: Responding to client with success: {"status":0,"value":{"build":{"version":"0.13.0","revision":"20c368f2963c73eb20cc3bca1585346c31fec387"}},"sessionId":"c534070d-5300-410c-9917-c11b3e5fce1d"}
debug: Request received with params: {}
GET /wd/hub/status 200 2ms - 199b
info: [INSTSERVER] Socket data received (61 bytes)
info: [INSTSERVER] Socket data being routed for 'cmd' event
info: [INSTSERVER] Got result from instruments: {"status":0,"value":{"ELEMENT":"9"}}
info: Responding to client with success: {"status":0,"value":{"ELEMENT":"9"},"sessionId":"c534070d-5300-410c-9917-c11b3e5fce1d"}
POST /wd/hub/session/c534070d-5300-410c-9917-c11b3e5fce1d/element 200 1187ms - 109b
debug: Appium request initiated at /wd/hub/session/c534070d-5300-410c-9917-c11b3e5fce1d/element
info: Pushing command to appium work queue: "au.getElementByXpath('\\/\\/cell[@name=TFirstName250 TLastName250]\\/UIAElement[@value=Ccv]')"
info: [INSTSERVER] Sending command to instruments: au.getElementByXpath('\/\/cell[@name=TFirstName250 TLastName250]\/UIAElement[@value=Ccv]')
debug: Request received with params: {"using":"xpath","value":"//cell[@name=TFirstName250 TLastName250]/UIAElement[@value=Ccv]"}
debug: Sending command to instruments: au.getElementByXpath('\/\/cell[@name=TFirstName250 TLastName250]\/UIAElement[@value=Ccv]')
info: [INSTSERVER] Socket data received (219 bytes)
info: [INSTSERVER] Socket data being routed for 'cmd' event
info: [INSTSERVER] Got result from instruments: {"status":17,"value":"'undefined' is not a function (evaluating 'elems.each(function(e, el) {\n var elid = this.getId(el);\n results.push({ELEMENT: elid});\n }.bind(this))')"}
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 'elems.each(function(e, el) {\n var elid = this.getId(el);\n results.push({ELEMENT: elid});\n }.bind(this))')"},"sessionId":"c534070d-5300-410c-9917-c11b3e5fce1d"}
POST /wd/hub/session/c534070d-5300-410c-9917-c11b3e5fce1d/element 500 926ms - 359b
debug: Appium request initiated at /wd/hub/session/c534070d-5300-410c-9917-c11b3e5fce1d/screenshot
info: Pushing command to appium work queue: "au.capture('screenshot9b2bf8c8-7e30-4f9a-811e-bfd0ffe82bad')"
debug: Request received with params: {}
debug: Sending command to instruments: au.capture('screenshot9b2bf8c8-7e30-4f9a-811e-bfd0ffe82bad')
info: [INSTSERVER] Sending command to instruments: au.capture('screenshot9b2bf8c8-7e30-4f9a-811e-bfd0ffe82bad')
info: [INSTSERVER] Socket data received (48 bytes)
info: [INSTSERVER] Socket data being routed for 'cmd' event
info: [INSTSERVER] Got result from instruments: {"status":0,"value":""}
info: Responding to client with success: {"status":0,"value":"iVBORw0KGgoAAAANSUhEUgAAAoAAAARwCAYAAAB6j+UAAABAAElEQVR4AeydB5wTxRfHH7333nvvvYNU6U0QxYIVAQERBAUbKipVVESx8xcUBQRFkKoUxYKIdBCQ3nvv5T+/OWZvs5fkkrvLJXf5PT4hW2Zndr+bS347896bJA2bt7olt4RGAiRAAiRAAiRAAiQQDgSSiCQNh+vkNZIACZAACZAACZAACUQSoACMZMElEiABEiABEiABEggLAhSAYXGbeZEkQAIkQAIkQAIkEEmAAjCSBZdIgARIgARIgARIICwIUACGxW3mRZIACZAACZAACZBAJAEKwEgWXCIBEiABEiABEiCBsCBAARgWt5kXSQIkQAIkQAIkQAKRBCgAI1lwiQRIgARIgARIgATCggAFYFjcZl4kCZAACZAACZAACUQSoACMZMElEiABEiABEiABEkgQBAoVLCDp06eL8bkmj8mRSZMmlVy5coqaSUROnDgpV65e9VpNhvTpJX2G9HL+/AU5d+6c17JxulOdYMVy5aRggfySM2dOOXv2rBw+ckQ2bNosZ86c9dhUnty5JEmSJHL02HG5fv26VS5DhgwaNq77nB/XEtPjrIa9LOA8M2XMKJkyZZR06dJJmjSpJXmy5JIsWTK5ceOGXL9xXS5duiwXLlzQ13xGMbh1i3P/eUHKXbEgkFx97lKrzyD+1oNl+JvImiWLnFXfNdeuXQvWabBdEiCBIBBo1uQO6dals5QsUTwIrfvW5LbtO+SbmbNlyc9LfTvATSl8x1WrUln+/Gt1jL9vYyQAs2TJLF9/8Zk+pcU/LZURI8e4Ob3ITXd36SQP3nevfPXNDPnwk88jdwRwqckdDeWhB+4TKGSnXb58RebM+1E+/2KqXLx4yblbJn88SVKnTiU9n3xK/t223drf/e4u0v2ernp99Zp/ZNCzz1v7vC0Mf+E5qV61ii4SVwxSpkwpefPklpw5ckjy5O5vI0QgXqlSppLM...","sessionId":"c534070d-5300-410c-9917-c11b3e5fce1d"}
GET /wd/hub/session/c534070d-5300-410c-9917-c11b3e5fce1d/screenshot 200 1044ms - 105.53kb
Thank you in advance for your help.