When setCompressedLayoutHeirarchy is enabled, views not marked as important to accessibility are discarded. This must be enabled for XPath and page source to work. If it's left enabled then it's not possible to find unimportant elements via other locator strategies.
If discard is toggled back to false at the end of an XPath request it will break XPath. To safely set discard to false, the code waits for the next find request that doesn't use XPath.
Thanks @paymand for figuring out how to make this work!
The old compressXml did not presist across uiautomator sessions.
By requesting 'DumpWindowHierarchyCompressed' it ensures the result is
always compressed, even if the server had been restarted.
For some reason if compressXml is disabled then the xpath index on Android
will return the wrong result.
- relies on xpath support for ios pull request
- adds support under the '-real xpath' locator strategy
- deprecates the original xpath strategy, which will be replaced in 1.0
- because we have no way to get a dom fragment starting from an element,
this strategy will only work for root-level queries
Add deprecation warnings for class name, tag name locator strategies.
Deprecations warnings will now be thrown for:
* 'tag name' in the native context
* 'class name' in the native context
* 'class name' in the web context
'class_name' is now a valid locator strategy for checkValidLocStrat
Add test for new class name locator
rename createCommand createGetElementCommand
Adding unit tests for new exception throwing
Add test for incorrect UIA class names
This fix adds a new option (direction) to 'mobile: scrollTo'.
If 'horizontal' is provided (or if the view is a HorizontalScrollView),
we will call setAsHorizontalList() before commencing the scroll.
Android's uiautomator has a broken long click implementation.
uiautomator will not pause long enough on long click which causes Android to detect the long click as a normal click.
This fix uses reflection to access uiautomator's private touchDown/touchUp methods to reimplement longClick correctly.
In theory I should be able to obtain a reference to android.app.UiAutomation without using reflection. However this doesn't seem possible when using uiautomator. getInstrumentation().getUiAutomation(); doesn't work because we're not using instrumentation.
Below is error message.
[ERROR] Failed to execute goal on project bootstrap: Could not resolve dependencies for project io.appium.android:bootstrap:jar:1.0.0-SNAPSHOT: The following artifacts could not be resolved: android:android:jar:4.3_r1, android.test.uiautomator:uiautomator:jar:4.3_r1: Could not find artifact android:android:jar:4.3_r1 in central (http://repo1.maven.org/maven2) -> [Help 1]