我想在亚马逊云上运行我的移动自动化代码,我使用Appium和Selenium webdriver设计了我的代码。 它在我的本地使用仿真器或实时设备正常运行。 我的移动自动化代码如:
File classpathRoot = new File(System.getProperty("user.dir"));
File appDir = new File(classpathRoot, "/apps");
File app = new File(appDir, "/siteaudit.apk");
System.out.println("Complete path : "+app);
DesiredCapabilities capabilities = new DesiredCapabilities();
//capabilities.setCapability("deviceName", "LG_Nexus_4_E960_real");
//capabilities.setCapability("deviceName", "Spice Mi-498");
//capabilities.setCapability("deviceName", "Nexus 5");
capabilities.setCapability("deviceName", "LG Nexus 5");
capabilities.setCapability("platformVersion", "6.0");
capabilities.setCapability("app", app.getAbsolutePath());
/*capabilities.setCapability("appPackage", "io.appium.android.apis");
capabilities.setCapability("appActivity", ".ApiDemos");*/
capabilities.setCapability("appPackage", "com.youtility.attendance.ui");
capabilities.setCapability("appActivity", ".ServerURLActivity");
driver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
答案 0 :(得分:0)
如评论中所述,请参阅AWS Device Farm TestNG documentation。我见过的两个最常见的问题是:
DesiredCapabilities
。 Device Farm在测试执行之前构建它自己的DesiredCapabilities
;如果您还为该对象设置了值,则系统行为未定义。 我最近presented a webinar介绍了在Device Farm中创建和执行Appium测试的过程。我建议您查看它以获得更多指导。