我想在saucelabs上运行facebook.apk。我使用curl根据SauceLabs instructions成功将apk文件下载到酱汁服务器。
我使用此代码启动应用程序:
capabilities.setCapability("appiumVersion", "1.4.0");
capabilities.setCapability("automationName", "Selendroid");
capabilities.setCapability("deviceName","Android Emulator");
capabilities.setCapability("platformVersion","4.2");
capabilities.setCapability("platformName","Android");
capabilities.setCapability("app","sauce-storage:facebook.apk");
capabilities.setCapability("appActivity","com.facebook.katana.FacebookLoginActivity");
capabilities.setCapability("appPackage", "com.facebook.katana");
capabilities.setCapability("newCommandTimeout", "300000");
try {
BaseAppiumTest.driver = new RemoteWebDriver
(new URL("http://SL_name_private:SL_key_private@ondemand.saucelabs.com:80/wd/hub"), capabilities);
} catch (MalformedURLException e) {
e.printStackTrace();
}
我经常遇到这个错误:
POST / session 0(+ 0.28s) desiredCapabilities:{" deviceName":" Android Emulator"," automationName":" Selendroid"," proxy":{ " proxyAutoconfigUrl":" http://127.0.0.1:19876/pac.js""的proxyType":" PAC"}" newCommandTimeout" :" 300000"" platformVersion":" 4.2"" platformName":" Android和#34;} =>无法创建新会话。 (原始错误:hasInternetPermissionFromManifest失败。错误:命令失败:错误:转储失败,因为没有找到AndroidManifest.xml)
我已在本地检查了fb.apk,似乎也正确下载了它。
答案 0 :(得分:1)
在Saucelabs模拟器中执行测试时,您无需提供(automationName,appActivity,appPackage)功能。
您可以使用以下示例功能:
caps.setCapability("appiumVersion", "1.13.0");
caps.setCapability("deviceName", "Samsung Galaxy S9 WQHD GoogleAPI
Emulator");
caps.setCapability("deviceOrientation", "portrait");
caps.setCapability("browserName", "");
caps.setCapability("platformVersion", "9.0");
caps.setCapability("platformName", "Android");
caps.setCapability("app", "sauce-storage:WhatsApp.apk");