sendKeys sometimes doesn't work (ios native app)

In my iOS app I have three text fields, each with accessibility set:

//UIATextField[@name=‘clientIdText’]
//UIATextField[@name=‘mobileKeyText’]
//UIATextField[@name=‘serverKeyText’]

These are table view cells in the same table. The hierarchy in Xcode is:
UITableViewCell
UIView (represents the Xcode Content View object)
UITextField

Other than the accessibility attributes all Xcode attributes are the same for each of the objects

The problem I am having is that neither Appium server nor inspector is able to use sendKeys to set the text for the “@name=‘mobileKeyText’]” one. The object is seen, and the program doesn’t crash, but the field doesn’t get populated. Any ideas?

Appium app log output:

info: --> POST /wd/hub/session/eb4e8612-71b3-48c1-a3be-f0e762420b91/element {“using”:“xpath”,“value”:"//UIAApplication[1]/UIAWindow[1]/UIATableView[1]/UIATableCell[3]/UIATextField[1]"}

debug: Appium request initiated at /wd/hub/session/eb4e8612-71b3-48c1-a3be-f0e762420b91/element

info: <-- POST /wd/hub/session/eb4e8612-71b3-48c1-a3be-f0e762420b91/element 200 1846.384 ms - 87 {“status”:0,“value”:{“ELEMENT”:“0”},“sessionId”:“eb4e8612-71b3-48c1-a3be-f0e762420b91”}
info: --> POST /wd/hub/session/eb4e8612-71b3-48c1-a3be-f0e762420b91/element/0/value {“value”:[“s”,“a”,“m”,“p”,“l”,“e”," ",“t”,“e”,“x”,“t”]}
info: <-- POST /wd/hub/session/eb4e8612-71b3-48c1-a3be-f0e762420b91/element/0/value 500 1061.869 ms - 316

debug: Request received with params: {“using”:“xpath”,“value”:"//UIAApplication[1]/UIAWindow[1]/UIATableView[1]/UIATableCell[3]/UIATextField[1]"}
debug: Pushing command to appium work queue: “au.mainApp().getTreeForXML()”
debug: Sending command to instruments: au.mainApp().getTreeForXML()
debug: Sending command to instruments: au.mainApp().getTreeForXML()
debug: [INST] 2014-09-16 23:07:47 +0000 Debug: Got new command 15 from instruments: au.mainApp().getTreeForXML()

debug: [INST] 2014-09-16 23:07:47 +0000 Debug: evaluating au.mainApp().getTreeForXML()

debug: [INST] 2014-09-16 23:07:47 +0000 Debug: evaluation finished

debug: [INST] 2014-09-16 23:07:47 +0000 Debug: Result is not protocol compliant, wrapping

debug: [INST] 2014-09-16 23:07:47 +0000 Debug: Running system command #16: /usr/local/Cellar/node/0.10.18/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{“status”:0,“value”:{“UIAApplication”:{"@":{“name”:“SodaDev”,“label”:“SodaDev”,“value”:null,“dom”:null,“enabled”:true…

debug: Socket data received (8192 bytes)
debug: Socket data received (8188 bytes)
debug: Socket data received (1920 bytes)
debug: Socket data being routed.
debug: Got result from instruments: {“status”:0,“value”:{“UIAApplication”:{"@":{“name”:“SodaDev”,“label”:“SodaDev”,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:"/0",“x”:0,“y”:20,“width”:320,“height”:548},">":[{“UIAWindow”:{"@":{“name”:null,“label”:null,“value”:null,“dom”:null,“enabled”:true,"va
debug: Pushing command to appium work queue: “au.getElementByIndexPath(’/0/0/1/4/0’)”
debug: Sending command to instruments: au.getElementByIndexPath(’/0/0/1/4/0’)
debug: Sending command to instruments: au.getElementByIndexPath(’/0/0/1/4/0’)
debug: [INST] 2014-09-16 23:07:48 +0000 Debug: Got new command 16 from instruments: au.getElementByIndexPath(’/0/0/1/4/0’)

debug: [INST] 2014-09-16 23:07:48 +0000 Debug: evaluating au.getElementByIndexPath(’/0/0/1/4/0’)

debug: [INST] 2014-09-16 23:07:48 +0000 Debug: Lookup returned [object UIATextField] with the name “mobileKeyText” (id: 0).

debug: [INST] 2014-09-16 23:07:48 +0000 Debug: evaluation finished

debug: [INST] 2014-09-16 23:07:48 +0000 Debug: Running system command #17: /usr/local/Cellar/node/0.10.18/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{“status”:0,“value”:{“ELEMENT”:“0”}}…

debug: Socket data received (38 bytes)
debug: Socket data being routed.
debug: Got result from instruments: {“status”:0,“value”:{“ELEMENT”:“0”}}
debug: Responding to client with success: {“status”:0,“value”:{“ELEMENT”:“0”},“sessionId”:“eb4e8612-71b3-48c1-a3be-f0e762420b91”}
debug: Appium request initiated at /wd/hub/session/eb4e8612-71b3-48c1-a3be-f0e762420b91/element/0/value
debug: Request received with params: {“value”:[“s”,“a”,“m”,“p”,“l”,“e”," ",“t”,“e”,“x”,“t”]}
debug: Pushing command to appium work queue: “au.getElement(‘0’).setValueByType(‘sample text’)”
debug: Sending command to instruments: au.getElement(‘0’).setValueByType(‘sample text’)
debug: Sending command to instruments: au.getElement(‘0’).setValueByType(‘sample text’)
debug: [INST] 2014-09-16 23:07:49 +0000 Debug: Got new command 17 from instruments: au.getElement(‘0’).setValueByType(‘sample text’)

debug: [INST] 2014-09-16 23:07:49 +0000 Debug: evaluating au.getElement(‘0’).setValueByType(‘sample text’)

debug: [INST]
info: --> GET /wd/hub/session/eb4e8612-71b3-48c1-a3be-f0e762420b91/source {}

2014-09-16 23:07:49 +0000 Debug: target.frontMostApp().elements()[0].elements()[1].elements()[4].elements()[0].tap()

debug: [INST] 2014-09-16 23:07:49 +0000 Debug: target.frontMostApp().elements()[0].elements()[1].elements()[4].elements()[0].scrollToVisible()

debug: [INST] 2014-09-16 23:07:49 +0000 Debug: target.frontMostApp().elements()[0].elements()[1].elements()[4].elements()[0] - scrollToVisible cannot be used because this element has no scrollable ancestor.

debug: [INST] 2014-09-16 23:07:49 +0000 Debug: target.frontMostApp().elements()[0].elements()[1].elements()[4].elements()[0] - scrollToVisible cannot be used because this element has no scrollable ancestor.

debug: [INST] 2014-09-16 23:07:49 +0000 Debug: target.frontMostApp().elements()[0].elements()[1].elements()[4].elements()[0] could not be tapped because the element is not visible

debug: [INST] 2014-09-16 23:07:49 +0000 Debug: target.frontMostApp().elements()[0].elements()[1].elements()[4].elements()[0] could not be tapped because the element is not visible

debug: [INST] 2014-09-16 23:07:49 +0000 Debug: Unexpected error in -[UIATextField_0xaa58700 setValue:], /SourceCache/UIAutomation_Sim/UIAutomation-365.3/Framework/UIAElement.m line 1061, kAXErrorFailure

debug: Socket data received (181 bytes)
debug: Socket data being routed.
debug: Got result from instruments: {“status”:17,“value”:“Unexpected error in -[UIATextField_0xaa58700 setValue:], /SourceCache/UIAutomation_Sim/UIAutomation-365.3/Framework/UIAElement.m line 1061, kAXErrorFailure”}
debug: Responding to client with error: {“status”:17,“value”:{“message”:“An error occurred while executing user supplied JavaScript.”,“origValue”:“Unexpected error in -[UIATextField_0xaa58700 setValue:], /SourceCache/UIAutomation_Sim/UIAutomation-365.3/Framework/UIAElement.m line 1061, kAXErrorFailure”},“sessionId”:“eb4e8612-71b3-48c1-a3be-f0e762420b91”}
debug: Appium request initiated at /wd/hub/session/eb4e8612-71b3-48c1-a3be-f0e762420b91/source
debug: Request received with params: {}
debug: Pushing command to appium work queue: “au.mainApp().getTreeForXML()”
debug: Sending command to instruments: au.mainApp().getTreeForXML()
debug: Sending command to instruments: au.mainApp().getTreeForXML()

debug: [INST] 2014-09-16 23:07:49 +0000 Error: Error during eval: setValue@[native code]
setValueByType@file://localhost/Applications/Appium.app/Contents/Resources/node_modules/appium/144430C5-6489-47D8-B648-4D10AB11FA08/helper-patch.js:10:20
eval code
eval@[native code]
startProcessing@file://localhost/Applications/Appium.app/Contents/Resources/node_modules/appium/695F6400-7145-446E-BF40-7A91132FD1E6/commands.js:120:30
bootstrap@file://localhost/Applications/Appium.app/Contents/Resources/node_modules/appium/B03BAB36-6B09-4E62-B83D-9BD15A94913C/bootstrap.js:18:29
global code@file://localhost/Applications/Appium.app/Contents/Resources/node_modules/appium/F33E65A3-305C-4029-9DE6-8725E651CCD1/bootstrap-26eeb9a4e6823c3b.js:9:10

debug: [INST] 2014-09-16 23:07:49 +0000 Debug: Running system command #18: /usr/local/Cellar/node/0.10.18/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{“status”:17,“value”:"Unexpected error in -[UIATextField_0xaa58700 setValue:], /SourceCache/UIAutomation_Sim/UIAutoma…

debug: [INST] 2014-09-16 23:07:50 +0000 Debug: Got new command 18 from instruments: au.mainApp().getTreeForXML()

debug: [INST] 2014-09-16 23:07:50 +0000 Debug: evaluating au.mainApp().getTreeForXML()

debug: [INST] 2014-09-16 23:07:50 +0000 Debug: evaluation finished

debug: [INST] 2014-09-16 23:07:50 +0000 Debug: Result is not protocol compliant, wrapping

debug: [INST] 2014-09-16 23:07:50 +0000 Debug: Running system command #19: /usr/local/Cellar/node/0.10.18/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{“status”:0,“value”:{“UIAApplication”:{"@":{“name”:“SodaDev”,“label”:“SodaDev”,“value”:null,“dom”:null,“enabled”:true…

debug: Socket data received (8192 bytes)

debug: Socket data received (8188 bytes)
debug: Socket data received (1920 bytes)
debug: Socket data being routed.
debug: Got result from instruments: {“status”:0,“value”:{“UIAApplication”:{"@":{“name”:“SodaDev”,“label”:“SodaDev”,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:"/0",“x”:0,“y”:20,“width”:320,“height”:548},">":[{“UIAWindow”:{"@":{“name”:null,“label”:null,“value”:null,“dom”:null,“enabled”:true,"va

debug: Responding to client with success: {“status”:0,“value”:"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n <UIAApplication name=“SodaDev” label=“SodaDev” value="" dom="" enabled=“true” valid=“true” visible=“true” hint="" path="/0" x=“0” y=“20” width=“320” height=“548”>\n <UIAWindow name="" label="" value="" dom="" enabled=“true” valid=“true” visible=“true” hint="" path="/0/0" x=“0” y=“0” width=“320” height=“568”>\n <UIANavigationBar name=“soda-ios 0.0.0” label="" value="" dom="" enabled=“true” valid=“true” visible=“true” hint="" path="/0/0/0" x=“0” y=“20” width=“320” height=“44”>\n <UIAImage name="" label="" value="" dom="" enabled=“true” valid=“true” visible=“false” hint="" path="/0/0/0/0" x=“0” y=“0” width=“320” height=“64”>\n <UIAImage name="" label="" value="" dom="" enabled=“true” valid=“true” visible=“false” hint="" path="/0/0/0/0/0" x=“0” y=“64” width=“320” height=“0.5”>\n \n \n <UIAButton name=“UINavigationBarBackI…”,“sessionId”:“eb4e8612-71b3-48c1-a3be-f0e762420b91”}

info: <-- GET /wd/hub/session/eb4e8612-71b3-48c1-a3be-f0e762420b91/source 200 1175.084 ms - 21654 {“status”:0,“value”:"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n <UIAApplication name=“SodaDev” label=“SodaDev” value="" dom="" enabled=“true” valid=“true” visible=“true” hint="" path="/0" x=“0” y=“20” width=“320” height=“548”>\n <UIAWindow name="" label="" value="" dom="" enabled=“true” valid=“true” visible=“true” hint="" path="/0/0" x=“0” y=“0” width=“320” height=“568”>\n <UIANavigationBar name=“soda-ios 0.0.0” label="" value="" dom="" enabled=“true” valid=“true” visible=“true” hint="" path="/0/0/0" x=“0” y=“20” width=“320” height=“44”>\n <UIAImage name="" label="" value="" dom="" enabled=“true” valid=“true” visible=“false” hint="" path="/0/0/0/0" x=“0” y=“0” width=“320” height=“64”>\n <UIAImage name="" label="" value="" dom="" enabled=“true” valid=“true” visible=“false” hint="" path="/0/0/0/0/0" x=“0” y=“64” width=“320” height=“0.5”>\n \n \n <UIAButton name=“UINavigationBarBackI…”,“sessionId”:“eb4e8612-71b3-48c1-a3be-f0e762420b91”}

debug: Appium request initiated at /wd/hub/session/eb4e8612-71b3-48c1-a3be-f0e762420b91/screenshot
debug: Request received with params: {}
debug: Pushing command to appium work queue: “au.getScreenOrientation()”
debug: Sending command to instruments: au.getScreenOrientation()
debug: Sending command to instruments: au.getScreenOrientation()

info: --> GET /wd/hub/session/eb4e8612-71b3-48c1-a3be-f0e762420b91/screenshot {}

debug: [INST] 2014-09-16 23:07:51 +0000 Debug: Got new command 19 from instruments: au.getScreenOrientation()

debug: [INST] 2014-09-16 23:07:51 +0000 Debug: evaluating au.getScreenOrientation()

debug: [INST] 2014-09-16 23:07:51 +0000 Debug: evaluation finished

debug: [INST] 2014-09-16 23:07:51 +0000 Debug: Running system command #20: /usr/local/Cellar/node/0.10.18/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{“status”:0,“value”:“PORTRAIT”}…

debug: Socket data received (33 bytes)

debug: Socket data being routed.
debug: Got result from instruments: {“status”:0,“value”:“PORTRAIT”}
debug: Setting internal orientation to PORTRAIT
debug: Pushing command to appium work queue: “au.capture(‘screenshot8af5c409-8060-4032-b537-d01407437a94’)”
debug: Sending command to instruments: au.capture(‘screenshot8af5c409-8060-4032-b537-d01407437a94’)
debug: Sending command to instruments: au.capture(‘screenshot8af5c409-8060-4032-b537-d01407437a94’)

debug: [INST] 2014-09-16 23:07:52 +0000 Debug: Got new command 20 from instruments: au.capture(‘screenshot8af5c409-8060-4032-b537-d01407437a94’)

debug: [INST] 2014-09-16 23:07:52 +0000 Debug: evaluating au.capture(‘screenshot8af5c409-8060-4032-b537-d01407437a94’)

debug: [INST] 2014-09-16 23:07:52 +0000 Debug: target.captureRectWithName("{origin:{x:0.00,y:0.00}, size:{height:568.00,width:320.00}}", “screenshot8af5c409-8060-4032-b537-d01407437a94”)

debug: Socket data received (25 bytes)

debug: Socket data being routed.
debug: Got result from instruments: {“status”:0,“value”:""}

debug: [INST] 2014-09-16 23:07:52 +0000 Screenshot captured.

debug: [INST] 2014-09-16 23:07:52 +0000 Debug: target.captureRectWithName("{origin:{x:0.00,y:0.00}, size:{height:0.00,width:0.00}}", “screenshot8af5c409-8060-4032-b537-d01407437a94”)

debug: [INST] 2014-09-16 23:07:52 +0000 Screenshot captured.

debug: [INST] 2014-09-16 23:07:52 +0000 Debug: evaluation finished

debug: [INST] 2014-09-16 23:07:52 +0000 Debug: Command executed without response

debug: [INST] 2014-09-16 23:07:52 +0000 Debug: Result is not protocol compliant, wrapping

debug: [INST] 2014-09-16 23:07:52 +0000 Debug: Running system command #21: /usr/local/Cellar/node/0.10.18/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{“status”:0,“value”:""}…

debug: Responding to client with success: {“status”:0,“value”:“iVBORw0KGgoAAAANSUhEUgAAAoAAAARwCAYAAAB6j+UAAABAAElEQVR4Aew9B2AVRdOTXgghgVBCr9JVei8KgkoRxQKCgOin2BVFxf5ZkO9XsaFiAQVEQBQElV5Cb6H3nkpCEtJ7/Wf2bu7d27zjvdCCuAuXuZmdmd2dvXc3N1vOLScntwRUUha4Ti1QUqJd3oWFhaKFDHNzcwWenZ1tB9PT0wWelpYm4KynnhLw4cfHCRg+6xcBC/MLBATw0KG7E1zmk/k9LfRY0VmfDJnfTaqPzMe4XA9ZjvNlyHwavQQ0nG8mMizWa8OQ8xlnyPQiiZ/zZeiMT85nnCHrY1wun+kyn4zLcpzPUNbDdJZjnCHTGVrRdbODAeVu0u0IMt2q+5lPzpfpcj5fdszHkPlchbKcqzjzOYP2l63Nbm5saYZWFme6DGU5OZ9xqyuB6ayHcYZW8pcrXy5Xxrl8Z5DlGDI/4/bQqju4G129fJlfhnzZcTmMy5DlZPrFysn6rHCmM+TyuVymW0HmY8h8pS5nNjt3hw6Zn+2soLKAsoCygLKAsoCygLKAssB1bgF+b7vOm6ma92+1AEcAGRYXa68+RUXam3NxsQbz8/OFifLz8wTMyckRsChXw738K2h0nc8WOhBk0x9+1WIS4ww1em6RFkFML9QikJlFWoQyR69Xvh659HbTfqJ+Hr5CMMDDX8BAT60+vh5+XJAE+afNEQIpG7g+/M4p48zPr4z8rshQfufU+FkLSzHO0Bmd851BbhXzsX6Z7ipuJc90uRymy5CtxpDzGWfI1nM13xm/EQHkAhiyIEOmy1CuiBXOdIashw3EOJfHdMYZMp8VZP1Wl6dVPtO5XL5cGXL5Mm7UQ1Zghct0LtCKLl+JzG8FZX7GGVrJMZ3r4QwaDZdOWI7JMs50Z5ANznyaHpnKuTJkPoacz7VhyHQZcj7LM+4MshX5MmFc1s8462dchnJ58mUt53O5TOfymc7lWeFG+bICCWd5…”,“sessionId”:“eb4e8612-71b3-48c1-a3be-f0e762420b91”}

info: <-- GET /wd/hub/session/eb4e8612-71b3-48c1-a3be-f0e762420b91/screenshot 200 2336.287 ms - 148794 {“status”:0,“value”:“iVBORw0KGgoAAAANSUhEUgAAAoAAAARwCAYAAAB6j+UAAABAAElEQVR4Aew9B2AVRdOTXgghgVBCr9JVei8KgkoRxQKCgOin2BVFxf5ZkO9XsaFiAQVEQBQElV5Cb6H3nkpCEtJ7/Wf2bu7d27zjvdCCuAuXuZmdmd2dvXc3N1vOLScntwRUUha4Ti1QUqJd3oWFhaKFDHNzcwWenZ1tB9PT0wWelpYm4KynnhLw4cfHCRg+6xcBC/MLBATw0KG7E1zmk/k9LfRY0VmfDJnfTaqPzMe4XA9ZjvNlyHwavQQ0nG8mMizWa8OQ8xlnyPQiiZ/zZeiMT85nnCHrY1wun+kyn4zLcpzPUNbDdJZjnCHTGVrRdbODAeVu0u0IMt2q+5lPzpfpcj5fdszHkPlchbKcqzjzOYP2l63Nbm5saYZWFme6DGU5OZ9xqyuB6ayHcYZW8pcrXy5Xxrl8Z5DlGDI/4/bQqju4G129fJlfhnzZcTmMy5DlZPrFysn6rHCmM+TyuVymW0HmY8h8pS5nNjt3hw6Zn+2soLKAsoCygLKAsoCygLKAssB1bgF+b7vOm6ma92+1AEcAGRYXa68+RUXam3NxsQbz8/OFifLz8wTMyckRsChXw738K2h0nc8WOhBk0x9+1WIS4ww1em6RFkFML9QikJlFWoQyR69Xvh659HbTfqJ+Hr5CMMDDX8BAT60+vh5+XJAE+afNEQIpG7g+/M4p48zPr4z8rshQfufU+FkLSzHO0Bmd851BbhXzsX6Z7ipuJc90uRymy5CtxpDzGWfI1nM13xm/EQHkAhiyIEOmy1CuiBXOdIashw3EOJfHdMYZMp8VZP1Wl6dVPtO5XL5cGXL5Mm7UQ1Zghct0LtCKLl+JzG8FZX7GGVrJMZ3r4QwaDZdOWI7JMs50Z5ANznyaHpnKuTJkPoacz7VhyHQZcj7LM+4MshX5MmFc1s8462dchnJ58mUt53O5TOfymc7lWeFG+bICCWd5…”,“sessionId”:“eb4e8612-71b3-48c1-a3be-f0e762420b91”}

debug: Appium request initiated at /wd/hub/session/eb4e8612-71b3-48c1-a3be-f0e762420b91/contexts

info: --> GET /wd/hub/session/eb4e8612-71b3-48c1-a3be-f0e762420b91/contexts {}

debug: Request received with params: {}
debug: [REMOTE] Debugger socket connected to ::1:27753
debug: [REMOTE] Sending connection key
debug: [REMOTE] Sending _rpc_reportIdentifier: message to remote debugger
debug: [REMOTE] {"__argument":{“WIRConnectionIdentifierKey”:“dc19a3b3-80ed-4c51-a01a-9b38f36b80bd”},"__selector":"_rpc_reportIdentifier:"}

debug: [REMOTE] Receiving data from remote debugger

debug: [REMOTE] Receiving data from remote debugger
debug: [REMOTE] {"__selector":"_rpc_reportSetup:","__argument":{“WIRSimulatorNameKey”:“iPhone Simulator”,“WIRSimulatorProductVersionKey”:“7.1”,“WIRSimulatorBuildKey”:“11D167”}}
debug: [REMOTE] Sim name: iPhone Simulator
debug: [REMOTE] Sim build: 11D167
debug: [REMOTE] {"__selector":"_rpc_reportConnectedApplicationList:","__argument":{“WIRApplicationDictionaryKey”:{}}}
error: Remote debugger did not list com.kabam.SodaDev among its available apps
debug: [REMOTE] Disconnecting from remote debugger

info: <-- GET /wd/hub/session/eb4e8612-71b3-48c1-a3be-f0e762420b91/contexts 200 397.679 ms - 86 {“status”:0,“value”:[“NATIVE_APP”],“sessionId”:“eb4e8612-71b3-48c1-a3be-f0e762420b91”}

debug: Responding to client with success: {“status”:0,“value”:[“NATIVE_APP”],“sessionId”:“eb4e8612-71b3-48c1-a3be-f0e762420b91”}
debug: [REMOTE] Debugger socket disconnected

Hi,

Is it resolved? I am facing the similar issue