ios-ui-automation

Why am I seeing “An error occurred while trying to run the script.” in the UI Automation instrument?

被刻印的时光 ゝ 提交于 2019-11-30 17:46:24
When I try to run a UI Automation script on iOS 5 devices I am getting the following error: "An error occurred while trying to run the script." The same script is running perfectly in the simulator or on an iOS 4.3.3 device. How can I solve this problem? user1751511 This should fix this issue: sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer On devices you should explicity allow to run UI Automation scripts. Go to Settings -> Developer Switch Enable UI Automation to on After turning the option on, the error went away and everything worked as expected. I would try closing

Programmatically turn on/off wifi on real iOS device with UI Automation

廉价感情. 提交于 2019-11-30 14:18:16
I have already read once or twice that turn on/off wifi on a real iOS device (iPad in my case) with a UI Automation script seems not possible. I've also read that you can create a script with the target "Settings" but it seems that it's only for simulators, am I right ? Do you have any ideas or solutions for me ? Regards, dorit i was able to do so (just make sure you target application is on foremost state when doing so): var target = UIATarget.localTarget(); target.dragFromToForDuration({x:0.1, y:557.00}, {x:211.00, y:206.00}, 0.5); //to expose the actions panel on iOS target.frontMostApp()

How to check element properties in iOS gui automation?

江枫思渺然 提交于 2019-11-30 10:05:48
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 the properties of a view? An example: a tap on a certain element should make it "selected". I'd like to perform a tap on it and then verify that isSelected is TRUE. Update: I found the withPredicate() method which should do it in theory, except it seems to only trigger on name properties: element.withPredicate("isSelected == YES") // always fails

Handling Alert with UIAutomation

爱⌒轻易说出口 提交于 2019-11-30 08:32:37
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 false; } As i understand it, as soon as i specify my onAlert function, it should get called when an alertView appears during my tests. So i run a test that shows an alertView, here is the code that shows the alert : UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:message message:nil delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];

Launch a specific Hardware version of iOS simulator using instruments command line utility

末鹿安然 提交于 2019-11-30 04:50:24
I am using UIAutomation provided by Apple -> Xcode -> instruments. I have my Javascripts and the whole automation using instruments command line infrastructure running up. I got an additional task of running automation on previous versions of simulator (iOS 6.0 , 5.1, 5.0, 4.3.2) to provide better coverage. But i do not know a way to specify which version of iOS simulator to choose from. by default it always chooses the lates iOS simulator. I have tried the following things: Specifying the path where the simulator is kept which includes the version path of simulator. Making a custom Automation

Why am I seeing “An error occurred while trying to run the script.” in the UI Automation instrument?

空扰寡人 提交于 2019-11-30 01:13:52
问题 When I try to run a UI Automation script on iOS 5 devices I am getting the following error: "An error occurred while trying to run the script." The same script is running perfectly in the simulator or on an iOS 4.3.3 device. How can I solve this problem? 回答1: This should fix this issue: sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer 回答2: On devices you should explicity allow to run UI Automation scripts. Go to Settings -> Developer Switch Enable UI Automation to on After

Check Email during Xcode UI Testing?

怎甘沉沦 提交于 2019-11-29 17:28:49
UPDATE: Is this still possible with the new way of UI testing with Xcode ? Can I programmatically access my email from an iOS UI Automation script? I want to access the signup code that my iPhone app emails to my email account. If you have a way for your device/simulator to receive the code while still in the app then you can write a script an iOS UIA script to do this. However with the current state of the built in iOS UIA tool, you cannot access anything that is outside of your app. So basically you cannot launch your app, then launch another app (like safari) go to mail.google.com blah blah

Launch a specific Hardware version of iOS simulator using instruments command line utility

对着背影说爱祢 提交于 2019-11-29 01:54:52
问题 I am using UIAutomation provided by Apple -> Xcode -> instruments. I have my Javascripts and the whole automation using instruments command line infrastructure running up. I got an additional task of running automation on previous versions of simulator (iOS 6.0 , 5.1, 5.0, 4.3.2) to provide better coverage. But i do not know a way to specify which version of iOS simulator to choose from. by default it always chooses the lates iOS simulator. I have tried the following things: Specifying the

Check Email during Xcode UI Testing?

天涯浪子 提交于 2019-11-28 13:47:20
问题 UPDATE: Is this still possible with the new way of UI testing with Xcode? Can I programmatically access my email from an iOS UI Automation script? I want to access the signup code that my iPhone app emails to my email account. 回答1: If you have a way for your device/simulator to receive the code while still in the app then you can write a script an iOS UIA script to do this. However with the current state of the built in iOS UIA tool, you cannot access anything that is outside of your app. So

UIAutomation's dragInsideWithOptions has no effect on iOS7 simulator

穿精又带淫゛_ 提交于 2019-11-28 08:37:25
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 the usability of this functions has changed? Is there anyone who could use this function with iOS 7 simulator on iPad? Same issue here. In addition to dragInsideWithOptions not working, dragFromToForDuration and flickFromTo aren't working either in Xcode 5 with iOS 7. I have been searching and waiting for a solution as well. Until then, swiping won