All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.infotel.seleniumrobot.grid.driver.AppiumAndroidBrowserDriverProvider Maven / Gradle / Ivy

There is a newer version: 5.0.11
Show newest version
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 getDriverClass() {
		return AndroidDriver.class;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy