You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I write appium tests, it looks like I can only declare driver as either an EnhancedAndroidDriver type, or an EnhancedIOSDriver 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:
private static AppiumDriver<MobileElement> driver;
public AppiumDriver<MobileElement> getDriver() throws IOException {
if (PLATFORM_NAME.equals("Android")) {
driver = new AndroidDriver<MobileElement>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
} else if (PLATFORM_NAME.equals("iOS")) {
driver = new IOSDriver<MobileElement>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
}
return driver;
}
But it seems impossible to take this approach with the Enhanced drivers because they don't share a common type. Please advise!
When I write appium tests, it looks like I can only declare
driveras either anEnhancedAndroidDrivertype, or anEnhancedIOSDrivertype. 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
driverrefers 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!