Search in sources :

Example 61 with DesiredCapabilities

use of org.openqa.selenium.remote.DesiredCapabilities in project java-client by appium.

the class AndroidTest method beforeClass.

/**
 * initialization.
 */
@BeforeClass
public static void beforeClass() {
    service = AppiumDriverLocalService.buildDefaultService();
    service.start();
    if (service == null || !service.isRunning()) {
        throw new AppiumServerHasNotBeenStartedLocallyException("An appium server node is not started!");
    }
    File appDir = new File("src/test/java/io/appium/java_client");
    File app = new File(appDir, "ApiDemos-debug.apk");
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.ANDROID);
    capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Emulator");
    capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
    driver = new AppiumDriver<>(service.getUrl(), capabilities);
}
Also used : AppiumServerHasNotBeenStartedLocallyException(io.appium.java_client.service.local.AppiumServerHasNotBeenStartedLocallyException) DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities) File(java.io.File) BeforeClass(org.junit.BeforeClass)

Example 62 with DesiredCapabilities

use of org.openqa.selenium.remote.DesiredCapabilities in project java-client by appium.

the class BaseAndroidTest method beforeClass.

/**
 * initialization.
 */
@BeforeClass
public static void beforeClass() {
    service = AppiumDriverLocalService.buildDefaultService();
    service.start();
    if (service == null || !service.isRunning()) {
        throw new AppiumServerHasNotBeenStartedLocallyException("An appium server node is not started!");
    }
    File appDir = new File("src/test/java/io/appium/java_client");
    File app = new File(appDir, "ApiDemos-debug.apk");
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.ANDROID_UIAUTOMATOR2);
    capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Emulator");
    capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
    driver = new AndroidDriver<>(service.getUrl(), capabilities);
}
Also used : AppiumServerHasNotBeenStartedLocallyException(io.appium.java_client.service.local.AppiumServerHasNotBeenStartedLocallyException) DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities) File(java.io.File) BeforeClass(org.junit.BeforeClass)

Example 63 with DesiredCapabilities

use of org.openqa.selenium.remote.DesiredCapabilities in project java-client by appium.

the class FingerPrintTest method initDriver.

private static void initDriver() {
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Emulator");
    capabilities.setCapability("appPackage", "com.android.settings");
    capabilities.setCapability("appActivity", "Settings");
    driver = new AndroidDriver<>(service.getUrl(), capabilities);
    driver.manage().timeouts().implicitlyWait(15, SECONDS);
}
Also used : DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities)

Example 64 with DesiredCapabilities

use of org.openqa.selenium.remote.DesiredCapabilities in project java-client by appium.

the class AppXCUITTest method beforeClass.

/**
 * initialization.
 */
@BeforeClass
public static void beforeClass() {
    service = AppiumDriverLocalService.buildDefaultService();
    service.start();
    if (service == null || !service.isRunning()) {
        throw new AppiumServerHasNotBeenStartedLocallyException("An appium server node is not started!");
    }
    File appDir = new File("src/test/java/io/appium/java_client");
    File app = new File(appDir, "TestApp.app.zip");
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "");
    capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "10.1");
    capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 6");
    capabilities.setCapability(IOSMobileCapabilityType.ALLOW_TOUCHID_ENROLL, "true");
    // sometimes environment has performance problems
    capabilities.setCapability(IOSMobileCapabilityType.LAUNCH_TIMEOUT, 500000);
    capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.IOS_XCUI_TEST);
    capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
    driver = new IOSDriver<>(service.getUrl(), capabilities);
}
Also used : AppiumServerHasNotBeenStartedLocallyException(io.appium.java_client.service.local.AppiumServerHasNotBeenStartedLocallyException) DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities) File(java.io.File) BeforeClass(org.junit.BeforeClass)

Example 65 with DesiredCapabilities

use of org.openqa.selenium.remote.DesiredCapabilities in project java-client by appium.

the class BaseIOSWebViewTest method beforeClass.

@BeforeClass
public static void beforeClass() {
    service = AppiumDriverLocalService.buildDefaultService();
    service.start();
    if (service == null || !service.isRunning()) {
        throw new AppiumServerHasNotBeenStartedLocallyException("An appium server node is not started!");
    }
    File appDir = new File("src/test/java/io/appium/java_client");
    File app = new File(appDir, "WebViewApp.app.zip");
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "");
    capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "9.2");
    // sometimes environment has performance problems
    capabilities.setCapability(IOSMobileCapabilityType.LAUNCH_TIMEOUT, 500000);
    capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone Simulator");
    capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
    driver = new IOSDriver<>(service.getUrl(), capabilities);
}
Also used : AppiumServerHasNotBeenStartedLocallyException(io.appium.java_client.service.local.AppiumServerHasNotBeenStartedLocallyException) DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities) File(java.io.File) BeforeClass(org.junit.BeforeClass)

Aggregations

DesiredCapabilities (org.openqa.selenium.remote.DesiredCapabilities)173 File (java.io.File)55 ChromeDriver (org.openqa.selenium.chrome.ChromeDriver)40 HashMap (java.util.HashMap)33 URL (java.net.URL)32 RemoteWebDriver (org.openqa.selenium.remote.RemoteWebDriver)29 ChromeOptions (org.openqa.selenium.chrome.ChromeOptions)28 Test (org.testng.annotations.Test)22 FirefoxDriver (org.openqa.selenium.firefox.FirefoxDriver)20 BeforeClass (org.junit.BeforeClass)19 FirefoxProfile (org.openqa.selenium.firefox.FirefoxProfile)18 TestSetup (com.coveros.selenified.utilities.TestSetup)17 PhantomJSDriver (org.openqa.selenium.phantomjs.PhantomJSDriver)15 WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)14 Before (org.junit.Before)13 Test (org.junit.Test)13 MalformedURLException (java.net.MalformedURLException)12 WebDriver (org.openqa.selenium.WebDriver)12 Actions (org.openqa.selenium.interactions.Actions)12 Dimension (org.openqa.selenium.Dimension)11