48 textFieldsList.get(2).sendKeys("Some@example.com");
49 driver.findElement(By.name("Save")).click();
50 }
51
52 public class SwipeableWebDriver extends RemoteWebDriver implements HasTouchScreen {
53 private RemoteTouchScreen touch;
54
55 public SwipeableWebDriver(URL remoteAddress, Capabilities desiredCapabilities) {
56 super(remoteAddress, desiredCapabilities);
57 touch = new RemoteTouchScreen(getExecuteMethod());
58 }
59
60 public TouchScreen getTouch() {
61 return touch;
62 }
63 }
64 }
6. 運行Test,注意AVD里的Android如果沒有解鎖需要先解鎖
這時候我們可以看到AVD在運行了,
同時Appium的命令行有對應的輸出
7. 更多信息請參考Appium的Github
https://github.com/appium/appium
建議可以Clone下這個項目,在Sample-code文件夾下有示例
https://github.com/appium/appium/tree/master/sample-code
同時Testerhome發起翻譯活動的中文文檔也提交進去了
https://github.com/appium/appium/tree/master/docs/cn
原文轉自:http://www.cnblogs.com/oscarxie/p/3488262.html