I've tried below 2 ways but can't access the appium java client methods directly
1. ((WebDriverFacade)getDriver()).getProxiedDriver().resetApp();
it throws error cannot resolve method resetApp
2. getDriver().resetApp() doesn't work either
Please clarify if something has changed with serenity framework recently ?
What class does resetApp() come from?
It comes from public interface InteractsWithApps
https://appium.github.io/java-client/io/appium/java_client/InteractsWithApps.html#resetApp--
All Known Implementing Classes:
AndroidDriver, AppiumDriver, IOSDriver, WindowsDriver
I've set webdriver.driver = appium inside serenity.properties
Have you tried casting the proxied driver to InteractsWithApps?
I tried below but didn't work
(InteractsWithApps)((WebDriverFacade)getDriver()).getProxiedDriver().resetApp()
I'm not sure, nothing much changes in the Appium code except updates to the Appium version - maybe the API has changed?
My understanding was if I set webdriver.driver = appium then driver type should be AppiumDriver.
If this is correct, then I think typecast is not needed. Please clarify if my understanding is wrong here
Have a look at the AppiumDriverProvider class. It creates either an AndroidDriver or an IOSDriver depending on the value of appium.platformName.
@vikramvi Could you try (AppiumDriver<MobileElement>) ((WebDriverFacade) getDriver()).getProxiedDriver().resetApp();
@wakaleo @pisarenco92 sorry my mistake, I could get it working as below
((AppiumDriver)((WebDriverFacade) getDriver()).getProxiedDriver()).terminateApp("org.wordpress.android");
Working:
((WebDriverFacade) getDriver()).getCapabilities().getCapability("platformName")
output: iOS