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
5
votes
2 answers

How does UIAutomation determine whether a UIAElement.isVisible()

I have a view with the following structure: GrandView -Parent View1 -Parent View2 --Child View1 --Child View2 The child views take up almost all of the bounds of Parent View2, but there is still some space around the edges. I can select Parent…
Heath Borders
  • 30,998
  • 16
  • 147
  • 256
5
votes
2 answers

UIAutomation Instrument Exception "Target app is not frontmost"

I have an iOS5 iPad app that uses CLLocationManager that I'm testing with UIAutomation. Before I run my test script, I manually press "OK" on the dialog that iOS presents when I use CLLocationManager. Occassionally, my test scripts will fail to…
Heath Borders
  • 30,998
  • 16
  • 147
  • 256
5
votes
5 answers

UIAPickerWheel.selectValue() not working for text values within UIDatePicker

I have created a simple project using storyboards containing just a UIDatePicker with mode=Date (so that dates appear like "November" "28" "2011"). Within Instruments UI Automation I am trying to set the values of the individual date picker wheels.…
MandyW
  • 1,117
  • 3
  • 14
  • 23
5
votes
3 answers

Getting values out of text fields with UIAutomation

I'm trying to understand how UIAutomation can be used to perform automatic application tests, so I've created a temperature converter app that can be driven from the JavaScript interface. Here's the UI: The top text field has an Accessibility label…
user23743
5
votes
1 answer

How to check element properties in iOS gui automation?

All UI Automation examples I've seen uses standard components whose state can be inspected with the JavaScript API using the value() method. This is a bit limiting. Lets say you want to check the color or alpha value and whatnot. How can I inspect…
Martin Wickman
  • 19,662
  • 12
  • 82
  • 106
5
votes
2 answers

UIAutomation iPhone: Is it possible to segment the script into several files

I want to write UIAutomation (JavaScript based) tests for a rather complex iPhone App. I dont't want to use one single huge file, but to seperate the testing functions and helpers by using several files. Is that possible at all? How do you structure…
Rene Berlin
  • 1,171
  • 7
  • 21
5
votes
4 answers

how can I improve iPhone UI Automation?

I was googling a lot in order to find a solution for my problems with UI Automation. I found a post that nice summarizes the issues: There's no way to run tests from the command line.(...) There's no way to set up or reset state. (...) Part of the…
Maciek Sawicki
  • 6,717
  • 9
  • 34
  • 48
5
votes
1 answer

Why is it the button in my view cant be seen by UIAutomation?

i am able to see the view but im unable to see/tap the button inside it. The button has a accessibility label of UIA_loginview_loginbutton with accesibility enabled. why is it not showing on logElementTree()? var target =…
Aldrich
  • 93
  • 6
5
votes
1 answer

IPhone real device automation environment setup

I am trying to write script using Java and Selenium. Using Appium tool for automation. I finished testing web app on simulator. I want to know if it is possible to run test script by connecting the real iPhone device to MAC through Wifi. If yes,…
5
votes
3 answers

iOS UIAutomation: is it possible to compare screenshots to reference images?

The title explains it already. I'm looking for a solution to compare screenshots taken with target.captureScreenWithName in a UIAutomation script to some reference images. This would be really nice to test some custom views.
V1ru8
  • 6,139
  • 4
  • 30
  • 46
5
votes
1 answer

How to pass arguments to an IPA while deploying it on the device?

To automate my app, I need to pass some parameters to the built IPA as I deploy it on various devices and run my automation. From various threads I figured I can use "ios-deploy" (https://github.com/phonegap/ios-deploy), a project forked from the…
codeToDeath
  • 137
  • 1
  • 8
5
votes
0 answers

Remove the authorization prompt from command line instruments (Under mavericks)

Similar to this question, except that the authorization database changed formats for mavericks and the old solution doesn't work: Is there a way to remove the authorization prompt from command-line instances of Instruments (XCode)? The specific…
Shish
  • 2,773
  • 19
  • 16
5
votes
5 answers

Is there a way to run several Scripts continuously in Instruments (iOS) UI Automation?

Whenever I try to do UI Automation in Instruments (iPhone simulator) by Apple, I have several different scripts to run. The problem is that I need to sit back and run each script when the former one ends. I wonder then what's the use of Automation…
5
votes
2 answers

iOS UI Automation element finds no sub-elements

I'm just starting out with UI Automation for my iOS app and am already having trouble. I'm unable to attach screen shots so I'll do my best to describe my scenario. I'm building for iOS 6.0 and am using a storyboard. The app launches to a screen…
fogwolf
  • 931
  • 7
  • 26
5
votes
1 answer

UIAutomation - different results from Instruments and Command Line

When I run a UIAutomation script in Instruments, everything works fine but when I run the exact same script from the command line, I get this error : Cannot perform action on invalid element: UIAElementNil from…