简体   繁体   English

Appium无法在iOS上使用

[英]Appium not Working with iOS

Im new in using Appium. 我在使用Appium中是新手。 Following THIS tutorial. 遵循教程。 Im having a issue actually. 我实际上有一个问题。 When i run my JAVA code "Bash Console" runs and nothing else happens. 当我运行我的JAVA代码时,“ Bash Console”将运行,并且什么也没有发生。

Here is my Java Code: 这是我的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

}

Below is the image. 下面是图像。

在此处输入图片说明

Of course nothing happens. 当然没事了。 I believe your program just doesn't now what to do. 我相信您的程序现在不该做什么。

You need the test engine markers, those you have commented out... The tutorial you chose is perfectly fine, I got started with that too. 您需要测试引擎标记,那些您已经注释掉的标记。您选择的教程非常好,我也从这里开始。 Don't forget to install TestNG. 不要忘记安装TestNG。

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

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM