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