gpt4 book ai didi

javascript - Dojo 实习生设置 firefox 配置文件名称

转载 作者:行者123 更新时间:2023-11-28 20:23:31 26 4
gpt4 key购买 nike

您好,我正在尝试在 intern 的环境设置中设置 firefox 配置文件名称配置文件。我试过了

environments: [
{ browserName: 'firefox',firefox_profile:'default' },
{firefox_profile:'default'}
],

 environments: [
{ browserName: 'firefox',profile:'default' },
{profile:'default'}
],

还有

 capabilities: {
'selenium-version': '2.42.0',
firefox_profile:'default'
},

Selenium capabilities 中所述但是 firefox 仍然以匿名配置文件启动。

但是如果我使用 watir ,

 def setup
@browser = Watir::Browser.new :firefox, :profile => 'default'
goto_ecp_console_manage_page
end

浏览器启动'kinit-ed'(kerberos) 的默认配置文件

最佳答案

作为Selenium capabilities您提到的页面指出,firefox_profile 的值必须是 Base64 编码的配置文件。具体来说,您压缩一个 Firefox 配置文件目录,对其进行 Base64 编码,并将该字符串用作 firefox_profile 的值。 firefox-profile npm 包可以使这个过程更容易。你最终会得到类似的东西:

environments: [
{ browserName: 'firefox', firefox_profile: 'UEsDBBQACAAIACynEk...'; },
...
],

我建议将配置文件字符串存储在单独的模块中,因为它大约有 250kb。

关于javascript - Dojo 实习生设置 firefox 配置文件名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25180890/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com