测试需要同时在多个android设备上运行,就需要启动多个appium
使用adb命令获取udid,命令:adb get-serialno
使用的是testng测试框架,代码使用java编写
第一台,运行真机,代码如下:
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import io.appium.java_client.android.AndroidDriver;
public class StartGoogle {
public AndroidDriver driver;
@BeforeClass
public void startTest() throws MalformedURLException {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(&