Appium不适用于iOS

时间:2014-05-09 08:03:40

标签: ios appium

我是使用Appium的新手。遵循THIS教程。我实际上有一个问题。当我运行我的JAVA代码" Bash Console"跑步,没有别的事情发生。

这是我的Java代码:

public void setUp() throws Exception {

// set up appium

File appDir = new File("/Users/ebryx/Library/Developer/Xcode/DerivedData/AppforTesingAutomation-fwqzlaiulhrxencjlttlxpjdhkwk/Build/Products/Debug-iphonesimulator");
File app = new File(appDir, "AppforTesingAutomation.app");

DesiredCapabilities capabilities = new DesiredCapabilities();

capabilities.setCapability(CapabilityType.BROWSER_NAME, "iOS");

capabilities.setCapability(CapabilityType.VERSION, "7.0");

capabilities.setCapability(CapabilityType.PLATFORM, "Mac");

capabilities.setCapability("app", app.getAbsolutePath());

driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub")

,capabilities);

System.out.println("App launched");

}



//@AfterMethod
public void tearDown() throws Exception {
driver.quit();
}



//@Test
public void testCases() throws InterruptedException {

//String myname = "Smriti";

driver.findElement(By.name("Change Color")).click();
//driver.findElement(By.xpath("//textfield[1]")).sendKeys(myname);
driver.findElement(By.name("Change Color")).click();

Thread.sleep(5000);

// write all your tests here

}

下面是图片。

enter image description here

1 个答案:

答案 0 :(得分:1)

当然没有任何事情发生。 我相信你的程序现在还没有做什么。

您需要测试引擎标记,您已注释掉的标记... 你选择的教程非常好,我也开始使用它。别忘了安装TestNG。

@BeforeMethod
public void setUp() throws Exception {
  ...
}

@AfterMethod
public void tearDown() throws Exception {
  ...
}

@Test
public void testCases() throws InterruptedException {
  ...
}