java

dannybarrientos

·

AppiumDriver

·

Java

·

Total Size: 1.55 KB

·

·

Created: 3 months ago

·

Edited: 3 months ago

package com.cedaniel200.eribank.pageobject.utils.drivers; import io.appium.java_client.AppiumDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.remote.DesiredCapabilities; import java.net.MalformedURLException; import java.net.URL; import static java.util.concurrent.TimeUnit.SECONDS; public class OwnAppiumDriver { private AppiumDriver<WebElement> driver; private static OwnAppiumDriver ownAppiumDriver; public static AppiumDriver<WebElement> AndroidtheApp(String deviceName_, String UDID_, String URL_){ ownAppiumDriver=new OwnAppiumDriver(); DesiredCapabilities capabilities= new DesiredCapabilities(); capabilities.setCapability("platformName", "android"); capabilities.setCapability("platformVersion", "8.1.0"); capabilities.setCapability("udid", UDID_); capabilities.setCapability("automationName", "uiautomator2"); capabilities.setCapability("appPackage", "com.google.android.calculator"); capabilities.setCapability("appActivity", "com.android.calculator2.Calculator"); capabilities.setCapability("deviceName", deviceName_); try { ownAppiumDriver.driver= new AppiumDriver<WebElement>(new URL(URL_), capabilities); } catch (MalformedURLException e) { } ownAppiumDriver.driver.manage().timeouts().implicitlyWait(10, SECONDS); return ownAppiumDriver.driver; } public static AppiumDriver<WebElement> theAndroidOpenedApp(){ return ownAppiumDriver.driver; } }

Driver donde se puede controlar sin utilizar el propierties

1 bit

50 views

Are you sure you want to delete?