1
 import java.io.File;
 //import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.concurrent.TimeUnit;
 //import org.openqa.selenium.remote.CapabilityType;
 import org.openqa.selenium.remote.DesiredCapabilities;
 import org.openqa.selenium.remote.RemoteWebDriver;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 import io.appium.java_client.ios.IOSDriver;


    public class testone{

    public static IOSDriver driver;

    @BeforeClass
public static void setUpBeforeClass() throws Exception {

        File appDir = new File ("//Users//gangaiahl//Appium//jars//CarsGuideApp//Payload");
        File app = new File (appDir,"Car.app");
DesiredCapabilities capabilities = new DesiredCapabilities();

        capabilities.setCapability("browserName", "");
        capabilities.setCapability("platformName", "iOS");
        capabilities.setCapability("deviceName", "Car_iPhone_6");
        capabilities.setCapability("platformVersion", "9.2.1");
        capabilities.setCapability("device", "iPhone 6");

        //capabilities.setCapability("deviceName", "iPad 2");
        //capabilities.setCapability("platformVersion", "8.4");
        //capabilities.setCapability("device", "iPad");

        capabilities.setCapability("app",app.getAbsolutePath());
        capabilities.setCapability("u_did",  "840384833537f40d011032eaaf20a53705a451ce");
         //capabilities.setCapability("u_did", "5446DE10-D8D1-4346-B8C7-E4C16053FE3A");
//840384833537f40d011032eaaf20a53705a451ce
        capabilities.setCapability("bundle_id", "au.dev.com.onewaytraffic.carsguide");

driver = new IOSDriver (new URL(" http://127.0.0.1:4723/wd/hub "),capabilities);

}

@Test
public void test() {
    System.out.println("Hello");
    // fail("Not yet implemented");
}

}

在此处输入图像描述在此处输入图像描述

请参阅随附的屏幕截图和屏幕截图中的错误。谁能帮我?我在 Mac 10.10.5 版本和自动化 iOS 移动应用程序上使用 Appium

4

1 回答 1

0

您必须配置您将使用的设备(真正的 ios 设备或 ios 模拟器)

于 2016-04-27T07:46:33.443 回答