run UI Tests xcode 7 on a device
Asked Answered
M

2

15

Can I execute UI Tests on a physical device? I have tried a few approaches/combinations with target/scheme but I am not able to run it on a device and I am getting no errors either.

Mithraism answered 14/12, 2015 at 16:42 Comment(0)
R
24

You have to enable Enable UI Automation at Settings / Developer

Enable UI Automation"

(maybe a restart is needed, as usual) :-)

Ram answered 1/2, 2016 at 11:27 Comment(1)
Thanks @Flori. It is now working. Might have been the new xcode versionMithraism
G
5

Yes you can. What is the real issue and what have you tried so far?

You should be able to run the test simply by selecting your device from the device menu enter image description here

then running your test by clicking the arrow by your test

enter image description here

Also, make sure your UI Target is pointing to your app:

enter image description here

Guayule answered 14/12, 2015 at 17:10 Comment(7)
This is what I have done so far: 1) My UI Test target is: MyUITests <br/> 2) Created a new scheme and linked to my UI Test Target (MyUITests)<br/> 3) When I select that scheme using the Run button nothing really runs on my device and I just get a "Build Succeded" (device is selected)<br/> 4) When I select that scheme using the Test button nothing really runs on my device and I just get a "Test Succeded" (device is selected)<br/> <br/> Not really sure what step I might be missingMithraism
@jonnycage what device are you using with what iOS, and what version is your xcode? And does your test run fine on a simulator?Guayule
I am using an iPhone 6 running iOS 9.2 and the latest xCode. Yes the tests run perfect on the simulatorMithraism
@jonnycage You don't need to create a new scheme. Select your Debug scheme or your regular one then make sure your MyUITests target is pointing to that target as Application Target.Guayule
I'm seeing this issue as well. I believe it may be a bug with 7.2.Pga
@ApopheniaOverload I did have this same problem before as well when I installed 7.2 beta. This problem went away for me when I updated my device to 9.2: #34184765Guayule
Thanks @JamesGoe. I got it running on the device. Restarted my phone and my mac and all worked. Although none of them pass (they all pass using the simulator). On the device I am getting "UI Testing Failure - App accessibility isn't loaded". Any ideas?Mithraism

© 2022 - 2024 — McMap. All rights reserved.