Basic iOS setup for Appium testing

Hello,

I am stuck with basic setup for three days already and I am getting a bit frustrated. I am trying to tap a button using accesibilityIdentifier.

I am running mac version of Appium 1.5.3 from .dmg file, installed locally on my development machine.

I am using XCode 7.3., application is developed by my Apple developer Team, with Code signing set to iOS Developer, automatic provisioning profile.

My code can be seen here: https://gitlab.com/zblebt/oneButton its single view application with one button and one label.

I have tried all different possibilities for accessibility settings:

button.isAccessibilityElement = true
button.accessibilityIdentifier = "my_button"
button.accessibilityLabel = "my_label_button"
button.accessibilityValue = "value_button"

I build the app using XCode Build (CMND + B), locate the .app file and copy the path to appium “Apple” settings as “App Path”. I am using real device with these settings:
image on gitlab

I can run the inspector without problems and I can see the button, with all informations. But no matter what I set for accessibilityID or Label or Value, I can not perform a “TAP” from the inspector.

Please, can you help me figure out, what part of my setup is incorrect?


This is a log:

[HTTP] --> POST /wd/hub/session/25c15718-367f-42ef-8eae-23365d444963/element {"using":"name","value":"Click me"}

[MJSONWP] Calling AppiumDriver.findElement() with args: ["name","Click me","25c1571...
[debug] [iOS] Executing iOS command 'findElement'
[HTTP] <-- POST /wd/hub/session/25c15718-367f-42ef-8eae-23365d444963/element 500 4 ms - 144 

[HTTP] --> GET /wd/hub/session/25c15718-367f-42ef-8eae-23365d444963/source {}
[MJSONWP] Calling AppiumDriver.getPageSource() with args: ["25c15718-367f-42ef-8eae-2...
[debug] [iOS] Executing iOS command 'getPageSource'
[debug] [UIAuto] Sending command to instruments: au.mainApp().getTreeForXML()

[debug] [Instruments] [INST] 2016-09-06 08:11:33 +0000 Debug: Got new command 11 from instruments: au.mainApp().getTreeForXML()

[debug] [Instruments] [INST] 2016-09-06 08:11:33 +0000 Debug: evaluating au.mainApp().getTreeForXML()

[debug] [Instruments] [INST] 2016-09-06 08:11:33 +0000 Debug: evaluation finished
[debug] [Instruments] [INST] 2016-09-06 08:11:33 +0000 Debug: responding with:,"valid":true,"visible":true,"hint":null,"path":"/0/0","x":0,"y":-0.5,"width":768,"height":1024},">":[{"UIAStaticText":{"@":{"name":"0","label":"0","value":"0","dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/0/0","x":379,"y":444,"width":10.5,"height":20.5},">":[]}},{"UIAButton":{"@":{"name":"Click me","label":"Click me","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/0/1","x":349,"y":494.5,"width":70,"height":34},">":[]}}]}},{"UIAWindow":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled":true,"valid":true,"visible":false,"hint":null,"path":"/0/1","x":0,"y":-0.5,"width":768,"height":1024},">":[]}},{"UIAWindow":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/2","x":0,"y":-0.5,"width":768,"height":1024},">":[{"UIAStatusBar":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0/2/0","x":0,"y":-0.5,"width":768,"height":20},">":[{"UIAElement":{"@":{"name":"iPad","label":"iPad","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":"Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top","path":"/0/2/0/0","x":6,"y":-0.5,"width":25,"height":20},">":[]}},{"UIAElement":{"@":{"name":"3 of 3 Wi-Fi bars","label":"3 of 3 Wi-Fi bars","value":"SSID","dom":null,"enabled":true,"valid":true,"visible":true,"hint":"Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top","path":"/0/2/0/1","x":36,"y":-0.5,"width":13,"height":20},">":[]}},{"UIAElement":{"@":{"name":"10:11","label":"10:11","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":"Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top","path":"/0/2/0/2","x":371,"y":-0.5,"width":30,"height":20},">":[]}},{"UIAElement":{"@":{"name":"Orientation Locked","label":"Orientation Locked","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":"Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top","path":"/0/2/0/3","x":675,"y":-0.5,"width":12,"height":20},">":[]}},{"UIAElement":{"@":{"name":"100 % battery power, Charging","label":"100 % battery power, Charging","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":"Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top","path":"/0/2/0/4","x":693,"y":-0.5,"width":70,"height":20},">":[]}}]}}]}}]}}}

[debug] [Instruments] [INST] 2016-09-06 08:11:33 +0000 Debug: Running system command #12: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js /var/folders/x6/21227y5d45gd3cl_21p5zhp40000gn/T/instruments_sock 2,{"status":0,"v...

[debug] [UIAuto] Socket data received (3201 bytes)

[debug] [UIAuto] Got result from instruments: {"status":0,"value":{"UIAApplication":{"@":{"name":"oneButton","label":"oneButton","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0","x":0,"y":0,"width":768,"height":1024},">":[{"UIAWindow":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled":true

[MJSONWP] Responding to client with driver.getPageSource() result: "<?xml version=\"1.0\" enco...

[HTTP] <-- GET /wd/hub/session/25c15718-367f-42ef-8eae-23365d444963/source 200 1297 ms - 3703 
[HTTP] --> GET /wd/hub/session/25c15718-367f-42ef-8eae-23365d444963/orientation {}
[MJSONWP] Calling AppiumDriver.getOrientation() with args: ["25c15718-367f-42ef-8eae-2...
[debug] [iOS] Executing iOS command 'getOrientation'
[debug] [UIAuto] Sending command to instruments: au.getScreenOrientation()

[debug] [Instruments] [INST] 2016-09-06 08:11:34 +0000 Debug: Got new command 12 from instruments: au.getScreenOrientation()

[debug] [Instruments] [INST] 2016-09-06 08:11:34 +0000 Debug: evaluating au.getScreenOrientation()

[debug] [Instruments] [INST] 2016-09-06 08:11:34 +0000 Debug: evaluation finished
[debug] [Instruments] [INST] 2016-09-06 08:11:34 +0000 Debug: responding with:
[debug] [Instruments] [INST] 2016-09-06 08:11:34 +0000 Debug: Running system command #13: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js /var/folders/x6/21227y5d45gd3cl_21p5zhp40000gn/T/instruments_sock 2,{"status":0,"v...

[debug] [UIAuto] Socket data received (33 bytes)

[debug] [UIAuto] Got result from instruments: {"status":0,"value":"PORTRAIT"}

[MJSONWP] Responding to client with driver.getOrientation() result: "PORTRAIT"
[HTTP] <-- GET /wd/hub/session/25c15718-367f-42ef-8eae-23365d444963/orientation 200 962 ms - 82 
[HTTP] --> GET /wd/hub/session/25c15718-367f-42ef-8eae-23365d444963/screenshot {}
[MJSONWP] Calling AppiumDriver.getScreenshot() with args: ["25c15718-367f-42ef-8eae-2...
[debug] [iOS] Executing iOS command 'getScreenshot'
[debug] [iOS] Taking screenshot: '/var/folders/x6/21227y5d45gd3cl_21p5zhp40000gn/T/appium-instruments/Run 1/screenshot4902d2b5-0eaa-4dd2-9573-39cefdb34e51.png'
[debug] [UIAuto] Sending command to instruments: au.capture('screenshot4902d2b5-0eaa-4dd2-9573-39cefdb34e51')

[debug] [Instruments] [INST] 2016-09-06 08:11:35 +0000 Debug: Got new command 13 from instruments: au.capture('screenshot4902d2b5-0eaa-4dd2-9573-39cefdb34e51')

[debug] [Instruments] [INST] 2016-09-06 08:11:35 +0000 Debug: evaluating au.capture('screenshot4902d2b5-0eaa-4dd2-9573-39cefdb34e51')

[debug] [Instruments] [INST] 2016-09-06 08:11:35 +0000 Debug: target.captureRectOnScreenWithName("{origin:{x:0.00,y:0.00}, size:{height:1024.00,width:768.00}}", UIScreen, "screenshot4902d2b5-0eaa-4dd2-9573-39cefdb34e51")

[iOSLog] [IOS_SYSLOG_ROW] Sep  6 10:11:36 zblebt syncdefaultsd[4041] <Notice>: (Note ) marked "com.me.keyvalueservice" topic as "enabled" on <APSConnection: 0x15d3ff60>

[debug] [UIAuto] Socket data received (25 bytes)

[debug] [UIAuto] Got result from instruments: {"status":0,"value":""}
[debug] [iOS] Waiting 10000 ms for screenshot to be generated.

[debug] [Instruments] [INST] 2016-09-06 08:11:36 +0000 Screenshot captured.

[debug] [Instruments] [INST] 2016-09-06 08:11:36 +0000 Debug: evaluation finished

[debug] [Instruments] [INST] 2016-09-06 08:11:36 +0000 Debug: responding with:
[debug] [Instruments] [INST] 2016-09-06 08:11:36 +0000 Debug: Running system command #14: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js /var/folders/x6/21227y5d45gd3cl_21p5zhp40000gn/T/instruments_sock 2,{"status":0,"v...

[debug] [UIAuto] Sending command to instruments: au.getScreenOrientation()

[debug] [Instruments] [INST] 2016-09-06 08:11:37 +0000 Debug: Got new command 14 from instruments: au.getScreenOrientation()

[debug] [Instruments] [INST] 2016-09-06 08:11:37 +0000 Debug: evaluating au.getScreenOrientation()

[debug] [Instruments] [INST] 2016-09-06 08:11:37 +0000 Debug: evaluation finished
[debug] [Instruments] [INST] 2016-09-06 08:11:37 +0000 Debug: responding with:
[debug] [Instruments] [INST] 2016-09-06 08:11:37 +0000 Debug: Running system command #15: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js /var/folders/x6/21227y5d45gd3cl_21p5zhp40000gn/T/instruments_sock 2,{"status":0,"v...

[debug] [UIAuto] Socket data received (33 bytes)

[debug] [UIAuto] Got result from instruments: {"status":0,"value":"PORTRAIT"}

[MJSONWP] Responding to client with driver.getScreenshot() result: "iVBORw0KGgoAAAANSUhEUgAABg...
[HTTP] <-- GET /wd/hub/session/25c15718-367f-42ef-8eae-23365d444963/screenshot 200 3312 ms - 97842 
[HTTP] --> GET /wd/hub/session/25c15718-367f-42ef-8eae-23365d444963/contexts {}
[MJSONWP] Calling AppiumDriver.getContexts() with args: ["25c15718-367f-42ef-8eae-2...
[debug] [iOS] Executing iOS command 'getContexts'
[debug] [iOS] Getting list of available contexts
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: false 
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[iOS] Attempted to get a list of webview contexts but could not connect to ios-webkit-debug-proxy. If you expect to find webviews, please ensure that the proxy is running and accessible
[debug] [iOS] No web frames found.
[MJSONWP] Responding to client with driver.getContexts() result: ["NATIVE_APP"]
[HTTP] <-- GET /wd/hub/session/25c15718-367f-42ef-8eae-23365d444963/contexts 200 12 ms - 86

So I did some more reading and testing and I found out one thing:

In the Appium Inspector, using real iOS device, i can search for the button without problem. If I click on “Locate”, using “accessibility id” Stategy options, i type my accessibilityIdentifier in the “Value” field and I click Search, the button is found with success, it is correctly shown and selected with red circle. (See pic image on gitlab

But if I try to “Touch -> Tap” on the button, it will not happen.

Could anyone please share some opinions?


This is log from searching:

[HTTP] --> POST /wd/hub/session/e6c23d5f-5a6f-4752-8119-5a4e5837be68/elements {"using":"accessibility id","value":"my_button"}

[MJSONWP] Calling AppiumDriver.findElements() with args: ["accessibility id","my_but...
[debug] [iOS] Executing iOS command 'findElements'
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [UIAuto] Sending command to instruments: au.getElementsByAccessibilityId('my_button')
[debug] [Instruments] [INST] 2016-09-12 13:09:52 +0000 Debug: Got new command 19 from instruments: au.getElementsByAccessibilityId('my_button')
[debug] [Instruments] [INST] 2016-09-12 13:09:52 +0000 Debug: evaluating au.getElementsByAccessibilityId('my_button')
[debug] [Instruments] [INST] 2016-09-12 13:09:52 +0000 Debug: evaluation finished
[debug] [Instruments] [INST] 2016-09-12 13:09:52 +0000 Debug: Lookup returned [object UIAButton] with the name "my_button" (id: 1).
[debug] [Instruments] [INST] 2016-09-12 13:09:52 +0000 Debug: responding with:
[debug] [Instruments] [INST] 2016-09-12 13:09:52 +0000 Debug: Running system command #20: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js /var/folders/x6/21227y5d45gd3cl_21p5zhp40000gn/T/instruments_sock 2,{"status":0,"v...
[debug] [UIAuto] Socket data received (40 bytes)
[debug] [UIAuto] Got result from instruments: {"status":0,"value":[{"ELEMENT":"1"}]}
[MJSONWP] Responding to client with driver.findElements() result: [{"ELEMENT":"1"}]
[HTTP] <-- POST /wd/hub/session/e6c23d5f-5a6f-4752-8119-5a4e5837be68/elements 200 615 ms - 89 
[HTTP] --> GET /wd/hub/session/e6c23d5f-5a6f-4752-8119-5a4e5837be68/element/1/location {}
[MJSONWP] Calling AppiumDriver.getLocation() with args: ["1","e6c23d5f-5a6f-4752-81...
[debug] [iOS] Executing iOS command 'getLocation'
[debug] [UIAuto] Sending command to instruments: au.getElement('1').getElementLocation()
[debug] [Instruments] [INST] 2016-09-12 13:09:53 +0000 Debug: Got new command 20 from instruments: au.getElement('1').getElementLocation()
[debug] [Instruments] [INST] 2016-09-12 13:09:53 +0000 Debug: evaluating au.getElement('1').getElementLocation()
[debug] [Instruments] [INST] 2016-09-12 13:09:53 +0000 Debug: evaluation finished
[debug] [Instruments] [INST] 2016-09-12 13:09:53 +0000 Debug: responding with:
[debug] [Instruments] [INST] 2016-09-12 13:09:53 +0000 Debug: Running system command #21: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js /var/folders/x6/21227y5d45gd3cl_21p5zhp40000gn/T/instruments_sock 2,{"status":0,"v...
[debug] [UIAuto] Socket data received (42 bytes)
[debug] [UIAuto] Got result from instruments: {"status":0,"value":{"x":349,"y":494.5}}
[MJSONWP] Responding to client with driver.getLocation() result: {"x":349,"y":494.5}
[HTTP] <-- GET /wd/hub/session/e6c23d5f-5a6f-4752-8119-5a4e5837be68/element/1/location 200 939 ms - 91 
[HTTP] --> GET /wd/hub/session/e6c23d5f-5a6f-4752-8119-5a4e5837be68/element/1/size {}
[MJSONWP] Calling AppiumDriver.getSize() with args: ["1","e6c23d5f-5a6f-4752-81...
[debug] [iOS] Executing iOS command 'getSize'
[debug] [UIAuto] Sending command to instruments: au.getElement('1').getElementSize()
[debug] [Instruments] [INST] 2016-09-12 13:09:54 +0000 Debug: Got new command 21 from instruments: au.getElement('1').getElementSize()
[debug] [Instruments] [INST] 2016-09-12 13:09:54 +0000 Debug: evaluating au.getElement('1').getElementSize()
[debug] [Instruments] [INST] 2016-09-12 13:09:54 +0000 Debug: evaluation finished
[debug] [Instruments] [INST] 2016-09-12 13:09:54 +0000 Debug: responding with:
[debug] [Instruments] [INST] 2016-09-12 13:09:54 +0000 Debug: Running system command #22: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js /var/folders/x6/21227y5d45gd3cl_21p5zhp40000gn/T/instruments_sock 2,{"status":0,"v...

[debug] [UIAuto] Socket data received (47 bytes)
[debug] [UIAuto] Got result from instruments: {"status":0,"value":{"width":70,"height":34}}
[MJSONWP] Responding to client with driver.getSize() result: {"width":70,"height":34}
[HTTP] <-- GET /wd/hub/session/e6c23d5f-5a6f-4752-8119-5a4e5837be68/element/1/size 200 1107 ms - 96 
[HTTP] --> GET /wd/hub/session/e6c23d5f-5a6f-4752-8119-5a4e5837be68/element/1/name {}
[MJSONWP] Calling AppiumDriver.getName() with args: ["1","e6c23d5f-5a6f-4752-81...
[debug] [iOS] Executing iOS command 'getName'
[debug] [UIAuto] Sending command to instruments: au.getElement('1').type()
[debug] [Instruments] [INST] 2016-09-12 13:09:55 +0000 Debug: Got new command 22 from instruments: au.getElement('1').type()
[debug] [Instruments] [INST] 2016-09-12 13:09:55 +0000 Debug: evaluating au.getElement('1').type()
[debug] [Instruments] [INST] 2016-09-12 13:09:55 +0000 Debug: evaluation finished
[debug] [Instruments] [INST] 2016-09-12 13:09:55 +0000 Debug: responding with:
[debug] [Instruments] [INST] 2016-09-12 13:09:55 +0000 Debug: Running system command #23: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js /var/folders/x6/21227y5d45gd3cl_21p5zhp40000gn/T/instruments_sock 2,{"status":0,"v...
[debug] [UIAuto] Socket data received (34 bytes)
[debug] [UIAuto] Got result from instruments: {"status":0,"value":"UIAButton"}
[MJSONWP] Responding to client with driver.getName() result: "UIAButton"
[HTTP] <-- GET /wd/hub/session/e6c23d5f-5a6f-4752-8119-5a4e5837be68/element/1/name 200 951 ms - 83