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

Verify text color in iphone uiautomation

I am testing an app with ios uiautomation and I need to verify the color of some static text controls. Is this possible? I didn't see any methods or properties that allow access to text styling.
Darrel
  • 141
  • 3
14
votes
7 answers

Handling Alert with UIAutomation

I'm trying to test the presence of an UIAlertView with UIAutomation but my handler never gets called. At the beginning of my javascript i write : UIATarget.onAlert = function onAlert(alert) { UIALogger.logMessage("alertShown"); return…
vdaubry
  • 11,369
  • 7
  • 54
  • 76
13
votes
4 answers

postbuild UIAutomation script not running in jenkins

I am trying to do End-to-End automation for an iOS project. My aim is to automate the continuous integration process with attaching UIAutomation scripts as post build action. So from the time when a user do check his code in SVN and till we get…
vikas
  • 488
  • 8
  • 18
13
votes
4 answers

Can't get value of UIAStaticText?

I'm trying to access the value() of a UIAStaticText (a UILabel in the objective C code) JavaScript object. I can set the value just fine using setValue() and I can confirm that the simulator updates the text, but when I try to get the value I only…
MdaG
  • 2,680
  • 2
  • 34
  • 46
13
votes
1 answer

Testing screen tracking with UI automation on iOS

So I had this idea to test the implementation of my screen tracking (with Google Analytics) on my app using UI automation. The original idea was to build a UI script to go through the screens while checking if the tracking events are being sent…
12
votes
5 answers

Clicking keyboard 'Next' key using UIAutomation

I have a search field in my app and I have set the return key type of the keyboard for this field to UIReturnKeyNext. I am attempting to write a UIAutomation test that clicks the Next button on the keyboard using the following…
kodie
  • 429
  • 6
  • 13
12
votes
1 answer

UIAutomation Nested Accessibilty Elements Disappear from Hierarchy

I have a view with two subviews a button and an Image, I turn on accessibility and set the label on the subviews and I can see the hierarchy by calling UIATarget.localTarget().frontMostApp().mainWindow().logElementTree(); I get the following for…
Neil Foley
  • 1,763
  • 1
  • 13
  • 32
12
votes
1 answer

How to add accessibility identifier to ios (cordova/webview) in html

I am doing mobile ios webview app automation using appium. I am unable to see the id attributes by using appium inspector.some says need to add accessibility id attribute so that appium can inspect that element. But we know how to add accessibility…
Durga Prasad
  • 301
  • 1
  • 2
  • 8
12
votes
7 answers

Unable to set accessibilityIdentifier of UISegmentedControl's segments

I found out, that even though I could set accessibilityLabel of UISegmentedControl's segment (see: How do I set the accesibility label for a particular segment of a UISegmentedControl?), I couldn't set accessibilityIdentifier, which was equally…
Matt Pennig
  • 156
  • 1
  • 5
10
votes
1 answer

How about UI automation testing for iOS app with instruments & Javascripts

Get knowing the automation UI testing for iOS apps from WWDC2010 video session, but no practices for it. From codeproject project,we can have one example. Questions here to hear from people who have involved this. Any limitations ? Any good…
Forrest
  • 122,703
  • 20
  • 73
  • 107
10
votes
6 answers

When testing an iPhone application, is it enough to just use the Leaks instrument?

I am about to finish my first iPhone application, and I'm am wondering if there are a set of steps that are used to check the app for memory leaks, performance, etc.? Is checking with the Leaks instrument enough? Are there any series of tests that…
Veeru
  • 4,936
  • 2
  • 43
  • 61
10
votes
4 answers

Unit Testing is Wonderful, But

I took the time to set up some Unit Tests and set up the targets in XCode, etc., and they're pretty useful for a few classes. However: I want to test small UI pieces for which I don't want to launch the entire application. There is no concept of…
Dan Rosenstark
  • 68,471
  • 58
  • 283
  • 421
10
votes
3 answers

UIAutomation: Any way to dismiss "Would Like To Use Your Current Location" alert?

my app is using location services, and for automated testing, I want to be able to dismiss the "APP Would Like To Use Your Current Location" popup. However, when I try to do this in Instruments with a UIAutomation script, I get this error: Fail:…
Asking One
  • 161
  • 4
9
votes
4 answers

How can I turn the output of my iOS UIAutomation tests into JUnit style output for Jenkins?

I am using UIAutomation scripts to test my iOS application. I've managed to get the scripts running from the command line but now I need to convert the output (pass/fails) in a format that Jenkins can understand, ideally JUnit style. Has anyone…
MandyW
  • 1,117
  • 3
  • 14
  • 23
9
votes
6 answers

Simulating pressing the Home button in Xcode 7 UI Automation

I've got it down to: XCUIDevice.pressButton(noideawhatgoeshere) I've tried XCUIDeviceButtonHome, home, Home, 1 How do I simulate pressing the home button in Xcode on iOS?
cakes88
  • 1,857
  • 5
  • 24
  • 33
1
2
3
50 51