标签:version log4 androi style apach oid cap class exce
import io.appium.java_client.android.AndroidDriver; import io.appium.java_client.android.AndroidElement; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.junit.Test; import org.openqa.selenium.Point; import org.openqa.selenium.remote.DesiredCapabilities; import java.net.URL; import java.util.concurrent.TimeUnit; public class AppTest { private static AndroidDriver<AndroidElement> driver; static Logger log = LogManager.getLogger( InterfaceTest.class.getName()); Login login = new Login(driver); PageObject pageobject = new PageObject(driver); @org.junit.BeforeClass public static void beforeTest() throws Exception { DesiredCapabilities capabilities=new DesiredCapabilities(); capabilities.setCapability("deviceName", "Default"); capabilities.setCapability("device", "android"); capabilities.setCapability("platformName", "Android"); capabilities.setCapability("browserName", ""); capabilities.setCapability("version", "7.0"); capabilities.setCapability("appPackage", "com.eg.XXXXXX"); capabilities.setCapability("appActivity", ".XXXXLogin"); driver=new AndroidDriver<AndroidElement>(new URL("http://localhost:4723/wd/hub"),capabilities); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); } /** * 关闭 */ @org.junit.AfterClass public static void afterTest() { if (driver != null) { driver.quit(); } log.debug("---------------------------测试完毕"); } @Test public void testOpenAPI() throws InterruptedException { log.debug("------------------------开始测试"); loginTest(); } public void loginTest() { 具体的测试内容............. }
标签:version log4 androi style apach oid cap class exce
原文地址:http://www.cnblogs.com/111testing/p/7707351.html