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

XCTest and UI testing in iOS

I am new to unit testing in iOS and need to write unit test for an iOS 7 application. I see that XCTest is there to write unit test with the help of test navigator and assistant editor. Since "unit testing" means we are testing a piece of code…
3
votes
1 answer

Export Screenshots UIAutomation

With captureScreenWithName I can take a screenshot of the current screen. But are they saved in a directory on the mac somewhere ? Or are they only in the log messages? If not, is there a way to export them to a directory ?
3
votes
3 answers

How to fetch file content (basically read) a local file in javascript for UIAutomation iOS

Is there a possible way to read a local file in JavaScript. MyFolder: db.csv Parse.js Trying to fetch the contents of file db.csv in Parse.js, But in vain. Can you share some links where I can get enough knowledge how to read a…
coder284
  • 831
  • 1
  • 13
  • 34
3
votes
1 answer

Calling webservice from UIAutomation

Is it possible to call a webservice from UIAutomation? on this webpage http://www.geonames.org/export/ajax-postalcode-autocomplete.html it is possible to type in country and postal code, and get following…
3
votes
1 answer

UI Automation worked fine with iOS5 simulator, but not with iOS6 and iOS7

It seems like iOS5 simulator is not supported on Mavericks. That was the only simulator that worked for me, and I have a bunch of tests in UI Automation. iOS6 and iOS7 simulator takes 2-5 times longer to load (about 30-50 seconds), and my guess is…
folium
  • 353
  • 1
  • 15
3
votes
2 answers

UIATarget.onAlert doesn't work in Instruments 5.0?

This code used to work well in Automation test with Instruments 4.6: UIATarget.onAlert = function onAlert(alert) { var title = alert.name(); UIALogger.logWarning("Alert with title ’" + title + "’ encountered!"); return false; // use…
Biga
  • 531
  • 4
  • 9
3
votes
1 answer

UIAutomation working in iOS 6 but not in iOS 7 (UIATarget.setLocationWithOptions)

I try to write UIAutomation test for a location based app. Here is my code: var target = UIATarget.localTarget(); var mainWindow = target.frontMostApp().mainWindow(); // speed is in meters/sec var points = [ …
Zootyo
  • 150
  • 1
  • 7
3
votes
1 answer

How to redirect to settings/preferences in UI Automation in ios

In order to test my app i need to switch on and switch off the WIFI, bluetooth etc.Is there a way to go to settings/preferences to turn my wifi on/off using UI Automation in IOS.
Avinash
  • 823
  • 1
  • 7
  • 18
3
votes
2 answers

Chaining #imports in UIAutomation javascript

I'm trying to break up my UIAutomation test scripts into chunks, to make it possible to run them one piece at a time or all together. So I have a structure: all-tests.js: #import "tab-dates.js" #import "tab-temperatures.js" tab-dates.js: #import…
c roald
  • 1,984
  • 1
  • 20
  • 30
3
votes
1 answer

Most efficient way to grab XML tag from file with JavaScript and Regex

I'm doing some more advanced automation on iOS devices and simulators for an enterprise application. The automation is written in browserless Javascript. One of the methods works on the device but not on the simulator, so I need to code a…
Teresa Peters
  • 229
  • 3
  • 14
3
votes
2 answers

Automation of Settings app, iPhone

I am trying UI Automation on iPhone for connecting to any given Wi-Fi network. I want to automate Settings app. It should automatically: open Settings app; turn on Wi-Fi; connect to given network by providing SSID and WPA. My questions are: Is it…
Ravindra
  • 271
  • 3
  • 6
3
votes
3 answers

How to handle slow network connections with UIAutomation

I noticed that all my UI tests fail when the network is slow. For instance a user would try to login and then the next screen wouldn't load fast enough in order for another UIElement to be on screen. How can I handle a slow network connection…
codeRefiner
  • 513
  • 4
  • 6
3
votes
1 answer

How to use node modules with in UIAutomation

According to apple's documentation I can import one JS file into another with an import statement. And yes I am able to use JS functions and recursively call other JS functions. But can I include node modules into my automation. Node/npm module…
satyajit
  • 1,470
  • 3
  • 22
  • 43
3
votes
3 answers

Error running UI Automation from command line

I think this is a first - I'm getting an error and the exception constant that I'm getting back returns nothing when I search for it on Google. Basically I'm trying to run UI Automation on my iOS app from the CLI and am getting the following error…
fogwolf
  • 931
  • 7
  • 26
3
votes
1 answer

Automated Testing and Xcode Configuration File to specify API Target

So I am writing Automated tests that run from the command line to test the UI of my iOS application. I have the bash script working that cleans and builds the project and runs my UI Automated tests. The problem is, I want the command-line script to…
Endama
  • 743
  • 8
  • 25