【问题标题】:Using protractor to open file url with Firefox使用量角器在 Firefox 中打开文件 url
【发布时间】:2016-03-17 19:35:16
【问题描述】:

目前我正在尝试(强制)使用量角器访问文件作为网站(html 文件)。当我尝试这样做时,量角器出现错误,内容如下:

    Failed: Access to 'file:///C:/filelocation/index.html' from script denied
    Build info: version: '2.48.2', revision: '41bccdd', time: '2015-10-09 19:59:12'
    System info: host: 'BAHCND4397GQF', ip: '10.138.1.189', os.name: 'Windows 7', os.arch: 'amd64',os.version: '6.1', java.version: '1.8.0_72'
    Driver info: driver.version: unknown

在互联网上搜索解决方案后,我发现问题是 Firefox 问题,添加的简单说明:

    user_pref("capability.policy.policynames", "localfilelinks");
    user_pref("capability.policy.localfilelinks.sites", "C:/MendisSoftwareList/Software%20List/cwmdt-applications-parent/common-parent/index.html");
    user_pref("capability.policy.localfilelinks.checkloaduri.enabled", "allAccess");

到“user.js”文件。经过更多研究,我发现此文件必须位于我尝试使用的 Firefox 配置文件中,我已将其放置在以下位置:

    C:\Users\userName\AppData\Roaming\Mozilla\Firefox\Profiles\Profile

无济于事。坦率地说,我没有想法。任何帮助,将不胜感激。 这是我的资源列表:

https://groups.google.com/forum/#!msg/selenium-users/Guh9x4HEWls/pbEjrsq5pXUJ
http://kb.mozillazine.org/User.js_file
https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/6373

提前致谢。

【问题讨论】:

  • 你的意思是你需要用firefox打开你的url?如果然后尝试功能:{ browserName:'firefox',}
  • 我目前正在使用 Firefox,我的浏览器确实可以使用它打开。但是它会立即崩溃。

标签: javascript selenium firefox jasmine protractor


【解决方案1】:

我在这里找到了这个问题的部分答案:Opening a file with protractor

满足我的需求并实现我的目标。

但是,出于我自己和社区的目的,我希望听到更深入的答案,因此任何和所有其他问题和 cmets 请随时留下另一个答案或留在 cmets 中。

谢谢

【讨论】:

    猜你喜欢
    • 2014-09-09
    • 1970-01-01
    • 1970-01-01
    • 2011-12-24
    • 1970-01-01
    • 2020-04-11
    • 1970-01-01
    • 2019-08-14
    相关资源
    最近更新 更多