-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to programmatically switch between ios and android enhanced driver #12
Comments
I can kind of get it to seem like it might work if I declare the driver as an AppiumDriver, but then the driver.label screenshot capability breaks, because 'label' isn't part of AppiumDriver.
---> Error: Cannot resolve method 'label' in 'AppiumDriver' But this doesn't actually work at all because App Center wants the driver declared like this: and then of course the driver is supposed to be instantiated later like this: But in Java, these three variables can not be the same, despite sharing the same name:
Whichever one is declared first is used; the others are ignored. The variable |
@jerimiah797 Did you find a solution for this? |
Sorry for the delay, @albert17 . I did find a solution. I had to create an interface in Java that let me abstract each call in the driver.. I can post some code here if you are interested.. it's not in a public repo at the moment. |
When I write appium tests, it looks like I can only declare
driver
as either anEnhancedAndroidDriver
type, or anEnhancedIOSDriver
type. I want to run a simple test in a single file that will run on both platforms, but it seems I must choose either android or ios for that file to run on. How do I avoid duplicating all my test files? I am using react native and my app is basically identical on both platforms. I have done something similar with the regular AppiumDriver.Any suggestions to programmatically switch which 'EnhancedIOS/AndroidDriver' the variable
driver
refers to in Java??With the regular AppiumDriver, I can do this:
But it seems impossible to take this approach with the Enhanced drivers because they don't share a common type. Please advise!
The text was updated successfully, but these errors were encountered: