ios-ui-automation

Set accessibilityIdentifier on custom table section header view for UIAutomation

江枫思渺然 提交于 2019-12-10 11:25:29
问题 How does one set an accessibility identifier on a custom section header view in a UITableView? For background, since logging the element tree of a table view inside UIAutomation produces a flat list of table cells (UIATableCell instances) intermingled with table group elements (UIATableGroup), being able to identify groups makes it easier to identify the cells that belong to those groups (since they are returned in order). If I set an accessibilityIdentifier explicitly on a custom view that

UIAutomation test invocation from the command line with Xcode 6

泪湿孤枕 提交于 2019-12-10 07:16:54
问题 Running UIAutomation tests from the command line seems to break often with new Xcode releases (judging by past posts). Having never used the command line scripting for this, I found this post from 2012: Automation Instrument from the Command Line. The Problem: My command returns without error, without output results and without anything logged to the system console. The simulator does not even launch! Checking some of the paths for updates (notably, the Automation trace instrument path), I

UIAutomation : Change location when the app is in background

╄→尐↘猪︶ㄣ 提交于 2019-12-10 03:45:17
问题 I am working on UIAutomation. I need to change the location when the app is in background. I have tried following line of code: var target = UIATarget.localTarget(); UIATarget.localTarget().deactivateAppForDuration(30); target.setLocation({longitude:77.50, latitude:12.50}); but target.setLocation is not getting called until the app comes to foreground. Could any one please tell me how I can change the location when the app is in background. 回答1: Unfortunately UIAutomation can only automate

Reading preferences set by UIAutomation's UIAApplication.setPreferencesValueForKey() on the target device?

佐手、 提交于 2019-12-09 21:56:02
问题 Over the last few days I've been playing with Apple's UIAutomation framework in an attempt to try to put together a suite of acceptance tests to drive the development of an app I'm working on (in a BDD type way...). One thing I'm bumping up against is how to get the SUT into a given state so I can begin my tests if I need to set some internal state for that to happen. The problem is that Apple's Javascript environment doesn't provide any functionality I could use to communicate with the

Instruments always launches iPad Simulator for Universal Apps with Automation, how can I force it to use the iPhone Simulator?

我们两清 提交于 2019-12-09 05:50:50
问题 I've created a universal binary using iOS 4.2 and Xcode 3.2.5. I'm trying to do some automation testing on the application and since the interfaces are slightly different between the iPad and iPhone versions, I have separate UIAutomation scripts. Unfortunately, no matter what I do, when I click the record button in Instruments, it always starts the application using the iPad simulator. How can I force Instruments to launch the iPhone simulator? The universal app runs fine in the simulator for

XCTestCase not launching application in setUp class method

不想你离开。 提交于 2019-12-08 01:36:22
问题 I am using XCode 8 and XCTestCase. I created a class setUp function to be ran once before all tests, and the other setUp to be ran before each test case. I want the application to be launched once before all test cases. If I use the launch in the class setUp, it never gets executed. If I use the launch in the setUp that is ran before each test, it does launch the test. It prints: IN CLASS SETUP END CLASS SETUP IN SETUP IN TEST METHOD But the application never gets launched. If I uncomment the

Appium inspector on real device - iOS

左心房为你撑大大i 提交于 2019-12-07 23:11:54
问题 I am evaluvating Appium for my iOS automation testing. As a part of that, I am able to successfully execute appium element inspector when I choose my device target as iPhone simulator. But I am not able to invoke element inspector when I target real device. I have signed my app with a development provisioning profile and I am able to install and run my app from Xcode 5. So my app setup looks okay as I am able to run my application. Then I configured all the details in Appium.app GUI like

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

て烟熏妆下的殇ゞ 提交于 2019-12-07 17:58:47
问题 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 file. Running Instruments in Xcode5, with test scripts in .js file where I have to feed in some values from a .csv file. 回答1: iOS UIAutomation, apple provides an api for running a task on the target's host. performTaskWithPathArgumentsTimeout Using this, we can have a

UI Automation - how to capture - record using javascript editor

北战南征 提交于 2019-12-07 16:52:11
问题 MobileSafari.app doesn't have accessibility labels is there a way to capture (record) events so that i can use in the javascript for UI Automation? there was a previous post which made that statement but didn't provide any instructions as to how to record using the javascript editor details please thank you in advance! 回答1: Just open a new script in your Instrument session, and push the little record button at bottom of the page (appears on the screenshot). Now use your app and you should get

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

感情迁移 提交于 2019-12-07 06:10:45
问题 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. I can successfully use the selectValue() method to set the wheels which contains numeric values but cannot manage to set text value of the month e.g. "November". This works.. target.frontMostApp().mainWindow().pickers()[0].wheels()[1].selectValue