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
3
votes
1 answer

UIAutomation iOS debugging

I have an app that I am trying to automatically debug using a shotgun approach (randomly touching the app for a long period of time). I am currently using UIAutomation and this script: var target = UIATarget.localTarget(); var app =…
user293895
  • 1,465
  • 3
  • 22
  • 39
3
votes
2 answers

scrollToVisible error while testing on a device, UIAutomation

For this line of test code : view.scrollViews()[0].tapWithOptions({tapOffset:{x:0.32, y:0.25}}) I am getting this error 2012-11-02 18:09:23 +0000 None: Script threw an uncaught JavaScript error: target.frontMostApp().mainWindow().scrollViews()[0]…
codemau5
  • 31
  • 1
  • 2
3
votes
1 answer

UIAutomation get view

I'm playing with UIAutomation, and I can't reference a view... Here is the log, where the view is visible: main_view UIAApplication: name:MyProjectDemo rect:{{0, 0}, {1024, 768}} UIAWindow: rect:{{0, 0}, {1024, 768}} UIAElement: name:main_view…
mongeta
  • 2,301
  • 2
  • 32
  • 42
3
votes
0 answers

Running UIAutomation instruments from command line results in NSInvalidArgumentException

Here is what is happening: I create a brand new "Single View" application in Xcode 4.5.1, build it on the command line using this: xcodebuild -sdk iphonesimulator6.0 clean build CONFIGURATION_BUILD_DIR=/tmp/AutomationBugRepro Which results in this…
3
votes
3 answers

iOS UIATarget detect when UIViewController is loaded after a tap()?

I am writing automation testing for my iOS app and I am trying to figure out how to detect in the javascript script when a view controller fully loaded and is on screen... So right now for example the script taps on a…
zumzum
  • 17,984
  • 26
  • 111
  • 172
3
votes
3 answers

Why are UIAElement's children not equal to themselves?

I noticed some weird behavior in a UIAutomation script I had written a while back that I hadn't ran in a while. My assertions were failing; after doing some digging, I saw that when iterating a UIAElement's .elements(), subelements do not appear to…
cozykozy
  • 217
  • 1
  • 9
3
votes
0 answers

Capturing log output on an iOS device and transferring that file to host using mobiledevice framework

This question is about logging with iOS. I am using the command line version of instruments to run an application on iOS. And that part works fine. What I am wondering, is how to capture the log output of the running application? That is, to do the…
Jose
  • 31
  • 3
3
votes
2 answers

uiautomation iOS uilabel value

I am trying to get the value from a UILabel by doing a target.logElementTree() but I am unable to see the value that the Label is actually set with. It only shows the string that we set based on the…
i_raqz
  • 2,919
  • 10
  • 51
  • 87
3
votes
1 answer

Time flag error while running UI Automation on ios device

i am trying to run Automation script with instruments on an ios 5 device but it is continuously giving error in running. it is not able to execute scripts and says fail with error. when i looked at trace then found following error message with red…
vikas
  • 488
  • 8
  • 18
2
votes
1 answer

plist xml file to html /pdf format on mac

i am working on ios UI Automation. i get test results in plist which is a xml document but this is not a readable form. so i need to convert this format to some readable one in some automated way. what is the best way to convert xml into html or…
vikas
  • 488
  • 8
  • 18
2
votes
2 answers

What is UIATargetHasGoneAWOLException while operating iphone with UIAutomation through Instruments.

I am using UIAutomation, through Instruments from Xcode, to do something on iPhone, and got a weird exception: UIATargetHasGoneAWOLException. Anybody know what does this exception mean?
2
votes
0 answers

Can't find subview elements in IOS-UIAutomation

I have the following hierarchy of views MainView -> SubViewA -> ChildA,ChildB,ChildC The logElementTree() is unable to print the subview elements for the View "SubViewA". (All the views have accessibilityLabel)
2
votes
2 answers

Changing keyboard in UIAutomation

I am testing my app. There I have a textfield, where first I enter letters, then I change keyboard to numbers and enter numbers, so that I get a string qwerty123. But UIAutomation doesn't understand this. When I run this script it says "tap point…
Ann
  • 475
  • 1
  • 5
  • 14
2
votes
0 answers

Simulator timed out issue while running UIAutomation in iOS

I am running UIAutomation scripts. Some times script executes successfully while other times it crashes saying Simulator session timed out and this message is also at different interval. If I have for loop while executing script, then somes it…
Sayali
  • 593
  • 3
  • 9
  • 22
2
votes
1 answer

iOS automation : how to tap button that has no id

I have the following items in logElementTree output: UIAButton: rect:{{20, 427}, {41, 41}} UIAButton: rect:{{140, 427}, {41, 41}} These buttons have no identifier, no name, and are not drawn in XIB. On my automation test script I only use index…