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

net.serenitybdd.core.webdriver.IsMobile Maven / Gradle / Ivy

There is a newer version: 4.2.8
Show newest version
package net.serenitybdd.core.webdriver;

import net.thucydides.core.webdriver.WebDriverFacade;
import org.openqa.selenium.WebDriver;

public class IsMobile {
    public static boolean driver(WebDriver driver) {
        WebDriver proxiedDriver = (driver instanceof WebDriverFacade) ? ((WebDriverFacade) driver).getProxiedDriver() : driver;

        try {
            return Class.forName("io.appium.java_client.AppiumDriver").isAssignableFrom(proxiedDriver.getClass());
        } catch (ClassNotFoundException e) {
            return false;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy