[英]Appium for iOS using Eclipse
public static boolean swipeToDirection_iOS_XCTest(MobileElement el, String direction) {
try {
JavascriptExecutor js = (JavascriptExecutor) driver;
HashMap<String, String> swipeObject = new HashMap<String, String>();
if (direction.equals("d")) {
swipeObject.put("direction", "down");
} else if (direction.equals("u")) {
swipeObject.put("direction", "up");
} else if (direction.equals("l")) {
swipeObject.put("direction", "left");
} else if (direction.equals("r")) {
swipeObject.put("direction", "right");
}
swipeObject.put("element", el.getId());
js.executeScript("mobile:swipe", swipeObject);
return true;
} catch (Exception e) {
return false;
}
}
我试图运行这段代码,它不能识别我创建了javascript执行器对象的驱动程序。 据我所知,它是语法的一部分,但它显示错误:“驱动程序无法解析为变量”。
I have already invoked the following: import org.openqa.selenium.JavascriptExecutor;
有人可以帮忙吗?
一位朋友帮了忙。 驱动程序基本上是我们创建的iOS驱动程序实例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.