2014-05-09 3 views
0

Appium을 처음 사용하는 경우 다음은 THIS 자습서입니다. 실제로 문제가 생겼습니다. 내 JAVA 코드 "Bash Console"을 실행할 때 아무 일도 일어나지 않습니다.iOS와 호환되지 않는 Appium

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

발생합니다. 나는 당신의 프로그램이 이제는 무엇을해야한다고 생각하지 않습니다.

테스트 엔진 마커가 필요합니다. 주석을 달았습니다 ... 선택한 튜토리얼은 완벽하게 훌륭합니다. TestNG를 설치하는 것을 잊지 마십시오.

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

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

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