Serenity-core: not able to access methods related to appium

Created on 4 Sep 2018  路  10Comments  路  Source: serenity-bdd/serenity-core

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 ?

question

All 10 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

samangipudi picture samangipudi  路  5Comments

rjrussell77 picture rjrussell77  路  4Comments

thePantz picture thePantz  路  4Comments

dan0935 picture dan0935  路  5Comments

Prasannajnaeyulu picture Prasannajnaeyulu  路  6Comments