Comments (7)
Buttons appear to be broken as well.
> @driver.execute_script 'UIATarget.localTarget().frontMostApp().mainWindow().buttons().length'
=> 2
> @driver.execute_script 'UIATarget.localTarget().frontMostApp().mainWindow().buttons()'
Selenium::WebDriver::Error::IndexOutOfBoundsError:
> @driver.execute_script 'UIATarget.localTarget().frontMostApp().mainWindow().buttons().toArray()'
=> [{}, {}]
> @driver.execute_script 'UIATarget.localTarget().frontMostApp().mainWindow().buttons().firstWithName("Sign In");'
=> {}
from appium.
Appium is not a transparent wrapper around UIAutomation. The things you're trying to do should be done using the normal WebDriver commands. What needs to happen is firstWithPredicate
needs to be exposed as a method on driver
somehow, probably in the guise of find_by_xpath or something similar. Or if it's different enough, we'd create a new 'find' strategy called 'predicate', and then ruby/python/et al will have to implement find_element(:predicate)
to support it. During that lag time, we'll expose it as a special execute method, so we'll be able to use it with @driver.execute("mobile: findByPredicate", :selector => 'foo')
or whatever.
In other words, anytime you find yourself having to do something with UIAutomation, create an issue here because it's a sign that we need to account for that functionality somehow in Appium. The goal is that people write these scripts using WebDriver concepts and commands, without ever having to know any UIAutomation.
So in this case, would you mind creating another issue stating the need for something like firstWithPredicate
to work so we can assign and prioritize?
from appium.
Appium is not a transparent wrapper around UIAutomation
Would you accept a pull request that improved the UIAutomation support? It seems half baked when some things work and others fail.
In other words, anytime you find yourself having to do something with UIAutomation, create an issue here because it's a sign that we need to account for that functionality somehow in Appium
With issues such as #169, it'd be easier to just do all the work in one UIAutomation command.
from appium.
Thanks for creating the other issue.
Would you accept a pull request that improved the UIAutomation support? It seems half baked when some things work and others fail.
UIAutomation support is a crutch that we hope to dispense with after we get more mature with our support of the behavior people need to successfully automate their apps using the WebDriver protocol. The goal is not to need @driver.execute
at all outside of the context of a webview. So you could call it scaffolding, and therefore intentionally 'half-baked'. We want to focus on getting the windows on the building, not sanding hardwood planks for the scaffolding.
With issues such as #169, it'd be easier to just do all the work in one UIAutomation command.
Yes, and whenever there's a performance benefit to doing so, we want to take advantage of that. But we want to stick within the automation framework of the WebDriver spec as much as possible. Where this isn't possible, we'll extend the spec to meet our needs and ask the rest of the Selenium community to support these new concepts. WebDriver is a mature and time-tested spec, but of course it was developed for web apps, and mobile will be a new game in some respects (see my wiki article on gestures).
There's a lot we can do under the hood as well (like constructing a chain of commands to be executed all at one time, rather than executing each one along the way) to make things more efficient without the test-writer really having to know about the implementation details. I suspect something like this will help with resolving #169.
Another issue to consider is that Appium's goal is to be cross-platform, supporting not only iOS but also Android. This means there's a reason to be careful about what methods are exposed and how to do expose them in a way that follows one convention for all devices (as much as possible--there might be limits to this philosophy that we will encounter).
Happy to hear more of your thoughts on all of this, but wanted to explain why I at least am not inclined to make raw UIAutomation support better.
from appium.
constructing a chain of commands to be executed all at one time, rather than executing each one along the way
I think that would be a significant help. Certain search functions have to be written client side for now which means they're ridiculously slow. It'd be awesome to just have everything performed in one call to the server as can be done with raw UIAutomation.
Happy to hear more of your thoughts on all of this, but wanted to explain why I at least am not inclined to make raw UIAutomation support better.
I understand your perspective and agree that WebDriver is the right long term approach. I plan on looking into fixing UIAutomation as a useful immediate solution.
from appium.
Fixed in #181.
from appium.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from appium.
Related Issues (20)
- bug: minor documentation syntax issue HOT 2
- npm i appium HOT 1
- Apps
- [Feat]:运行WebDriverAgent后出现的Automation Running hold both volume buttons to stop 这个提示如何修改文字内容 HOT 1
- [Feat]:"Automaton Running hold both volume buttons to stop" HOT 1
- Changing Language from iOS settings causes appium to crash and the change doesnt go through HOT 1
- Support prefs URL scheme for iOS devices HOT 6
- bug: Continuously getting alert text in webview HOT 2
- Can not see elements inside WebView Element with XCUITest on simulator(with UIAutomator2 it works) HOT 18
- bug: Error when interacting with elements on iOS HOT 8
- Not able to switch to Webview context HOT 5
- bug: <title> An unknown Server Side error occurred while processing the command HOT 1
- appium automation testing HOT 10
- [Feat]: documentation does not remind users that they have to start the server by actually running "appium". HOT 3
- Appium and Appium Inspector cannot detect my iOS device (using xcuitest 7.10.0 on iPhone 14 iOS 16.6.1) HOT 3
- Start appium with plugin - appium server starts with error when uiautomator2 or xcuitest drivers are installed HOT 14
- Failure to detect present udid of iPhone when using Appium Inspector HOT 1
- iOS real device test screen recording 0 bytes HOT 5
- Appium session gets terminated when i try to install app on real iOS device using a URLbug: <title> HOT 18
- bug: <Appium 2.x. ResetApp and Auto grant permissions> HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from appium.