我有一个示例测试套件如下:
@Test(groups="swipeTest")
public void swipeTest() {
WebElement wl = driver.findElementByName("Video");
JavascriptExecutor js = (JavascriptExecutor) driver;
HashMap<String, String> scrollObject = new HashMap<String, String>();
scrollObject.put("direction", "right");
scrollObject.put("element", ((RemoteWebElement) wl).getId());
js.executeScript("mobile: swipe", scrollObject);
我正在使用 Appium (1.6.4) 和 TestNg 运行这个测试套件,并观察它在本地模拟器中运行良好。但是,同一段代码在 AWS Device Farm 中不起作用。
swipeTest failed: Unknown command, all the mobile commands except scroll
have been removed. (WARNING: The server did not provide any stacktrace
information) Command duration or timeout: 215 milliseconds Build info:
version: '3.2.0', revision: '8c03df6b79', time: '2017-02-23 10:51:31 +0000'
System info: host: 'ip-172-31-13-65', ip: '172.31.13.65', os.name: 'Linux',
os.arch: 'amd64', os.version: '3.13.0-53-generic', java.version: '1.8.0_65'
Driver info: io.appium.java_client.ios.IOSDriver Capabilities
[{app=com.sears.relay, networkConnectionEnabled=false,
databaseEnabled=false, deviceName=546f99bb46f19bd77d35316105eda6af056611ae,
platform=MAC, platformVersion=10.0.2, webStorageEnabled=false,
locationContextEnabled=false, browserName=, takesScreenshot=true,
javascriptEnabled=true, platformName=iOS,
udid=546f99bb46f19bd77d35316105eda6af056611ae}] Session ID: 5360d97b-4fa9-
440e-af0a-5b9b55acf87d
为了在 AWS Device Farm 而不是 IOSDriver 上运行,我初始化了 RemoteWebDriver 并遵循https://aws.amazon.com/blogs/mobile/test-ios-apps-on-aws-device-farm-中概述的过程使用-appium-part-1-prerequisities-environment-set-up-and-test-creation/
非常感谢任何帮助。