ios-ui-automation

Trouble Getting Elements by Name from UIAElementArray in UIAutomation

若如初见. 提交于 2019-12-04 18:57:06
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 view = UIATarget.localTarget().frontMostApp().mainWindow(); var textfields = view.textFields();

iOS app gets reset on creation of new appium session

做~自己de王妃 提交于 2019-12-04 18:33:07
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 "App ABC should retain it's state" but ABC gets reset. I have launched appium with --no-reset parameter.

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

我的梦境 提交于 2019-12-04 15:47:54
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 device other than through it's UI (I'm sure this is probably by design but sometimes this is just

Why are UIAElement's children not equal to themselves?

社会主义新天地 提交于 2019-12-04 12:42:27
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 picked up by UIAutomation Run the following script in UIAutomation: var elements = UIATarget.localTarget()

Unable to tap (x,y) coordinate in landscape mode

夙愿已清 提交于 2019-12-04 12:34:52
In Xcode 8 / Swift 3, using the coordinate(withNormalizedOffset: CGVector) function to interact with an XCUIElement appears to work only in portrait mode. To test this functionality, I created a single screen project with a button centered in the view. I then ran the following UI test: func testExample() { XCUIDevice.shared().orientation = .portrait let window = XCUIApplication().windows.element(boundBy: 0) let centerPoint = window.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)) centerPoint.tap() } This successfully taps the button. However, if I run the same test in landscapeLeft

WebKit Threading Violation - initial use of WebKit from a secondary thread in UI Automation

时光总嘲笑我的痴心妄想 提交于 2019-12-04 12:31:45
When I tried to run my automation scripts through the terminal with Xcode 6 I got this error message: WebKit Threading Violation - initial use of WebKit from a secondary thread. Can someone help me to run the automation scripts through terminal or instrument in Xcode 6. tres I see the same message infrequently -- even when things run successfully. You may be having troubles running instruments from command line because of changes to command line utilities for XCode 6. Check out UIAutomation test invocation from the command line with Xcode 6 adding the -w flag made things work again for me. i.e

I can't make swipe gesture work for me in Appium using Java

折月煮酒 提交于 2019-12-04 11:13:41
I can't made Swipe action work. I did browsed through the web for a few days and found many similar questions but there is no working answer. Also I have tried TouchAction class, doesn't work as well. I have Appium Version 1.4.13 (Draco) and using Java, TestNG framework. btw I made scrolling work using (you can use the same logic as a pull to refresh) here is code sample. public void scrollUp() { JavascriptExecutor js = (JavascriptExecutor) getDriver(); HashMap<String, String> scrollObject = new HashMap<String,String(); scrollObject.put("direction", "up"); scrollObject.put("element",

postbuild UIAutomation script not running in jenkins

女生的网名这么多〃 提交于 2019-12-04 10:23:36
问题 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 test result of automation, everything will be automated. Jenkins is installed on my local machine and running on localhost . Now I have automated build process through jenkins and at other end I have my shell script ready which will run UIAutomation

Start Instruments from the command line

我怕爱的太早我们不能终老 提交于 2019-12-04 10:03:10
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 start trace. This is the command I used: instruments -w {deviceId} -t /Applications/Xcode.app/Contents

UIACollectionView cells vs visibleCells

若如初见. 提交于 2019-12-04 09:02:26
I'm trying to write a test script using automation in xcode 4.5. I have a UICollectionView and I want to click on some cell not currently visible. Per documentation , I should expect cells to return all cells in the collection view, and visibleCells to return only the currently visible ones. Instead what I'm seeing is that cells returns only the currently visible cells, and calling visibleCells stops the script on 'undefined' is not a function (evaluating 'collection.visibleCells()') var target = UIATarget.localTarget(); var collection = target.frontMostApp().mainWindow().collectionViews()[0];