Reputation: 1118
I'm trying to test my phonegap application with [email protected] on my [email protected]. The app launches correctly but when I try to set the context to WEBVIEW
Appium crashes with following error:
error: Failed to start an Appium session, err was: Error: The following desired capabilities are required, but were not provided: platformName, deviceName
Ok, the message is clear but what confuses me, is that I've already set those capabilities via java-client
[...]
capabilities.setCapability("automationName", "Appium");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("platformVersion", "4.4");
capabilities.setCapability("deviceName", "Nexus 7");
capabilities.setCapability("appPackage", "my.app.package");
driver = new AppiumDriver(new URL("http://127.0.0.1:9515/wd/hub"), capabilities);
[...]
Any ideas ?
Upvotes: 2
Views: 2745
Reputation: 1370
You are testing a Phonegap app, right? Well, you need to use the Selendroid
engine then, the (default) UiAutomator engine doesn't support Webviews.
Excerpt from Appium documentation:
For [...] tests of hybrid (webview-based) apps, Appium comes bundled with another automation backend called Selendroid.
In order to configure Selendroid
, you need to specify the automationName
parameter:
To use Selendroid, all that is required is to slightly change the set of desired capabilities mentioned above, by adding the automationName capability and specifying the Selendroid automation backend.
Upvotes: 1