我的样本测试套件如下:
@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-using-appium-part-1-prerequisities-environment-set-up-and-test-creation/
中列出的流程进行了操作非常感谢任何帮助。
答案 0 :(得分:0)
我在AWS Device Farm团队工作。 很少有值得注意的事情最有可能导致这个问题:
在设备场上不支持Javascript appium和组注释。 希望这会有所帮助。