com.infotel.seleniumrobot.grid.driver.AppiumAndroidBrowserDriverProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of seleniumRobot-grid Show documentation
Show all versions of seleniumRobot-grid Show documentation
Selenium grid extension for mobile testing
package com.infotel.seleniumrobot.grid.driver;
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.server.DriverProvider;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.remote.MobileCapabilityType;
public class AppiumAndroidBrowserDriverProvider extends AppiumDriverProvider implements DriverProvider {
@Override
public Capabilities getProvidedCapabilities() {
DesiredCapabilities androidCaps = new DesiredCapabilities();
androidCaps.setCapability(MobileCapabilityType.PLATFORM_NAME, "android");
androidCaps.setCapability(CapabilityType.PLATFORM, Platform.ANY);
androidCaps.setCapability(CapabilityType.BROWSER_NAME, "browser");
return androidCaps;
}
@Override
public boolean canCreateDriverInstanceFor(Capabilities capabilities) {
return "browser".equals(capabilities.getBrowserName()) && "android".equals(capabilities.getCapability(MobileCapabilityType.PLATFORM_NAME));
}
@Override
protected Class extends WebDriver> getDriverClass() {
return AndroidDriver.class;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy