使用Webdriver

时间:2016-06-17 09:24:56

标签: selenium appium

我试图下载位于Hockey App共享点的android apk文件,但只能下载文件的一部分而不是完整的文件。以下是附加的代码。

下面是我用来改变firefox配置以处理下载弹出窗口的代码

     FirefoxProfile profile = new FirefoxProfile();
            profile.setPreference("browser.download.folderList",2);
            profile.setPreference("browser.download.manager.showWhenStarting",false);
           // profile.setPreference("browser.download.dir", "Downloads");
            profile.setPreference("browser.helperApps.neverAsk.saveToDisk", "application/vnd.android.package-archive");// MIME type for apk file
            WebDriver driver = new FirefoxDriver(profile);

另外,我尝试使用Firefox的网络监视器中显示的内容类型标题(“text / html; charset = utf-8”)值。但这并没有奏效。

除了Selenium之外的任何其他方法也受到赞赏。

1 个答案:

答案 0 :(得分:0)

为什么不使用曲棍球应用程序提供的api。它非常简单..你可以从可用版本获取构建URL然后下载。我编写的脚本很简单。

https://support.hockeyapp.net/kb/api

P.S。您应该使用开发者帐户中的令牌。测试人员帐户没有获得build_url。但要求只读令牌并不困难。

相关问题