Questions tagged [ios-ui-automation]

Automated UI Testing using the Automation instrument included with Instruments for iOS development. Not to be confused with [xcode-ui-testing] which was introduced in Xcode 7.

Instruments is an application shipped with Xcode and used to help profile applications in both iOS and OS X development. One of the tools included with Instruments is the UIAutomation instrument which allows for automated testing of user interfaces using scripts written in JavaScript. This functionality was introduced with the iOS 4 SDK.

This tag specifically focuses on using this functionality in relation to iOS development. These scripts can be used not only to automate a user's interaction with the application, but they can also contain asserts which can test if the application is behaving according to the developer's expectations.

For the new Xcode 7 UI Testing feature, see .

756 questions
9
votes
5 answers

UIAutomation's dragInsideWithOptions has no effect on iOS7 simulator

Since I use Xcode 5 and the new iOS 7 simulator to run UIAutomation tests with Instruments, dragInsideWithOptions and dragFromToForDuration functions have simply no effect. (The same tests worked fine with iOS 6.1 simulator.) Is this a known bug, or…
fabe
  • 718
  • 5
  • 10
9
votes
2 answers

UIAutomation: Check if element exists before tapping

We have a iPad app which includes a two-column news reader. The left view contains the list of news of which some link directly to a news and some push another view controller with another list of news. This will also cause a UIButton to be set as…
Sebastian Wramba
  • 10,087
  • 8
  • 41
  • 58
8
votes
1 answer

XCode4 Unit Testing and UIAutomation

I'm looking to set up testing at my company, but I'm a little fuzzy on the best way to start. I know that I can use a framework for unit testing, such as OCUnit, GHUnit or SenTestingKit... so far so good. I can make a target which logic tests my…
Sam
  • 3,659
  • 3
  • 36
  • 49
8
votes
0 answers

UI Testing failure - App state is XCApplicationStateRunningActive not XCApplicationStateNotRunning

I am using XCUI tests to automate testing of some of the flows in our application (~35 test scenarios) with Xcode 7.2.1 Running these tests locally will consistently pass, whereas running them on our virtual machine instance (Parallels, Mac mini,…
Harry Bloom
  • 2,359
  • 25
  • 17
8
votes
4 answers

UIAutomation and XCTestCase: how to wait for a button to activate

I'm writing a UIAutomation test case and I need to wait for the user to be activated before continuing. There doesn't seem to be a nice way to check for a button to change to the enabled state. Whats the best was to wait for something to happen in…
Brian
  • 772
  • 1
  • 13
  • 31
8
votes
4 answers

Simulate orientation changes in iOS for testing purposes

I would like to test my app's ability to handle orientation changes (portrait/landscape). I'm currently using KIF and as far as I know, it cannot do this. Is there a way to simulate the rotation events programmatically for the iOS simulator? I don't…
Tomas Andrle
  • 13,132
  • 15
  • 75
  • 92
7
votes
1 answer

uiautomation recorded scripts save location

I can't seem to figure out how to save recorded scripts in the "UI Automation" tool in Instruments. I launch my iphone app with "Profile" select the "UI Automation" tool, add a "New Script" and start the script recording. I click around and I can…
FishStix
  • 4,994
  • 9
  • 38
  • 53
7
votes
1 answer

How does #import work in iOS' UI Automation?

I'm making a small test framework that uses the JavaScript module pattern for UI Automation testing on iOS. However, I seem to be getting odd results based on #import and extending modules. I have the base test module called…
baalexander
  • 2,579
  • 1
  • 25
  • 32
7
votes
5 answers

Issuing a synchronous HTTP GET request or invoking shell script in JavaScript from iOS UIAutomation

I am trying to use Apple's UIAutomation to write unit tests for an iOS Application that has a server-side component. In order to setup the test server in various states (as well as simulate two clients communicating through my server), I would like…
esilver
  • 27,713
  • 23
  • 122
  • 168
7
votes
4 answers

Instruments always launches iPad Simulator for Universal Apps with Automation, how can I force it to use the iPhone Simulator?

I've created a universal binary using iOS 4.2 and Xcode 3.2.5. I'm trying to do some automation testing on the application and since the interfaces are slightly different between the iPad and iPhone versions, I have separate UIAutomation scripts.…
smountcastle
  • 620
  • 5
  • 14
7
votes
3 answers

Getting text from TextView in UI test in XCTest

I'm trying XCode for iOS UI testing. My test application has UITextView element with accessibility identifire displayTextView. I tried simple test that taps this element, types some text it and then check the result the following way: XCUIElement…
Yulia
  • 1,087
  • 9
  • 16
7
votes
1 answer

How to run ios simulator for ui Automation test on jenkins

I'm trying to run a UI Automation script from jenkins : instruments -w 'iPhone 6 (8.1 Simulator)' \ -t…
mesh
  • 113
  • 5
7
votes
4 answers

Disable Hardware Keyboard for iOS Simulator using UIAutomation

I'm doing some automated tests in the iOS simulator using UIAutomation. In Xcode 6, the iOS simulator's keyboard behavior changed to be similar to a real device, and now there is a menu item to connect/disconnect your Mac's keyboard to the…
Matt Mc
  • 8,882
  • 6
  • 53
  • 89
7
votes
4 answers

UIAutomation : Change location when the app is in background

I am working on UIAutomation. I need to change the location when the app is in background. I have tried following line of code: var target =…
Prasad Devadiga
  • 2,573
  • 20
  • 43
7
votes
1 answer

UIAutomation through command line on a real device

I know starting from Xcode 4.2 it is possible to run UIAutomation scripts through command line. I've tried this and is working perfectly fine for me in simulator. I'd like to know how to get this run in an actual device.I searched and got the…
1 2
3
50 51