简体   繁体   中英

Appium not Working with iOS

Im new in using Appium. Following THIS tutorial. Im having a issue actually. When i run my JAVA code "Bash Console" runs and nothing else happens.

Here is my Java Code:

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.

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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