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(新网址(" http://127.0.0.1:4723/wd/hub"),功能);
}
@Test
public void test() {
System.out.println("Hello");
// fail("Not yet implemented");
}
}
请参阅屏幕截图中附带的屏幕截图和错误。谁能帮我? 我在Mac 10.10.5版本上使用Appium&自动化iOS移动应用
答案 0 :(得分:0)
您必须配置您将使用的设备(真正的ios设备或ios模拟器)