ios-ui-automation

iOS app gets reset on creation of new appium session

久未见 提交于 2019-12-06 14:17:25
问题 I am performing following steps Set capabilities and launch ABC app. By providing app path capabilities.setCapability("app", "/Users/changdeojadhav/Library/Developer/Xcode/DerivedData/ABC/Build/Products/Debug-iphonesimulator/ABC.app"); capabilities.setCapability("bundleId","com.abc.ABC-Demo"); Perform some actions quit driver by driver.quit() Set capabilities for Xyz app. And launch XYZ app Perform some steps quit driver by driver.quit() relaunch ABC app as mentioned in step #1. Expected is

What is UIATargetHasGoneAWOLException while operating iphone with UIAutomation through Instruments.

╄→尐↘猪︶ㄣ 提交于 2019-12-06 13:15:37
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? I've found that this occurs when certain unknown conditions exist AND an iPhone is connected to the computer. Disconnecting the iPhone will solve the problem. Unfortunately, I don't know what the "certain unknown conditions" are, because a connected iPhone device doesn't automatically result in this exception. But I do see that disconnecting the iPhone is sufficient to prevent it. I found this article that

UI Automation Testing: How do I select UIAPickerWheel values?

最后都变了- 提交于 2019-12-06 13:06:31
问题 I've hit a roadblock in trying to write some automated tests for my iPhone app. Judging from the documentation I feel like this should select the first row of the first component of my UIPickerView: var picker = UIATarget.localTarget().frontMostApp().mainWindow().pickers()[0]; var aWheel = picker.wheels()[0]; var someVals = aWheel.values(); aWheel.selectValue(someVals[0]); But instead I get the following error, logged in Instruments: Exception raised while running script: - selectValue

Trouble Getting Elements by Name from UIAElementArray in UIAutomation

青春壹個敷衍的年華 提交于 2019-12-06 12:37:26
问题 I'm having trouble getting interface elements by name in a UIAutomation script. I have set up the accessibility panel for a text control: And I know that I have the right parent view, as this code will work to set the field contents: var view = UIATarget.localTarget().frontMostApp().mainWindow(); var textfields = view.textFields(); textfields[0].setValue("testuser"); Unfortunately, if I try to access the field by name, as the docs seem to indicate I should be able to do, I get an error: var

Appium inspector on real device - iOS

孤人 提交于 2019-12-06 10:47:56
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 bundle id, device etc... and started the appium server and inspector. When inspector is launched, my app is

How to enter text into a textfield in a web view using UIAutomation

可紊 提交于 2019-12-06 09:54:07
My iOS app has a log-in page with username and password textfields. These text fields are in a web view. I am trying to automate the log-in process with UIAutomation . I know that working with content in a web view with UIAutomation is tricky. I am able to tap into the text fields using target.tap({x:100, y:200}); but I want to have UIAutomation enter text after the field has been tapped. How can I achieve this? Felix You can do something like: Get the reference to the webview var webView=window.scrollViews()[0].webViews()[0]; Tap the textView that you want to edit: webView.textFields()[0].tap

Set accessibilityIdentifier on custom table section header view for UIAutomation

谁都会走 提交于 2019-12-06 09:19:20
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 gets returned as a section header view, I can confirm that the accessibilityIdentifier property is

XCTestCase not launching application in setUp class method

China☆狼群 提交于 2019-12-06 07:43:05
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 line to launch the application in the second setUp, it will get launched. How can I have the

Why are UIAElement's children not equal to themselves?

痴心易碎 提交于 2019-12-06 06:42:13
问题 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 be equal to themselves. This has worked for me as expected in the past, but appears to be broken in at least XCode 4.3.2 To repro: create a single-view app throw some elements in the view, set Accessibility Labels on the elements so they get

Start Instruments from the command line

有些话、适合烂在心里 提交于 2019-12-06 04:13:05
问题 I followed this site to get started with UI Automation. http://blog.manbolo.com/2012/04/08/ios-automated-tests-with-uiautomation#1.2 I am trying to start Instruments from the command line. Unfortunately I get an error: 2013-03-14 14:06:36.376 instruments[17854:1207] Connection to the remote device lost while launching target. Aborting... 2013-03-14 14:06:36.378 instruments[17854:1207] Recording cancelled : At least one target failed to launch; aborting run Instruments Trace Error : Failed to