如何隐藏由 selenium rc 启动的 Firefox 附加弹出窗口?

发布于 2024-09-14 07:07:45 字数 197 浏览 7 评论 0原文

每次我测试我的selenium测试时,firefox的瞬间都会弹出并显示selenium rc页面。没关系而且很酷。但我有问题。对于每个测试,我还必须看到 Firefox 的页面弹出,并显示 selenium 插件已添加到 Firefox。

有没有什么方法可以配置selenium,使其在没有弹出页面的情况下启动firefox,因为经过一百次测试,它开始激怒我;D

everytime i test my selenium test, the instant of firefox will popup and show page of selenium rc. It's ok and cool. But i have problem. For every test i also have to see a firefox's page pop up and shown selenium plugin have been add to firefox.

is there any way to configure selenium so it initiate firefox without a popup page cause after a hundred test, it start to irritate me ;D

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

难理解 2024-09-21 07:07:45

我确信这是另一个问题的重复,因为我觉得我以前已经回答过它,但我找不到它。如果我随后找到它,那么我会更新我的答案。

您需要设置 extensions.lastAppVersion 首选项以匹配您要启动的 Firefox 版本。否则,您通常会在 Firefox 和插件管理器弹出窗口中看到一个附加选项卡。

您可能需要将 Selenium 配置为使用自定义 Firefox 配置文件才能进行此更改。

I'm sure this is a duplicate of another SO question, as I feel like I've answered it before, but I can't find it. If I do subsequently find it then I will update my answer.

You need to set the extensions.lastAppVersion preference to match the version of Firefox that you're launching. Otherwise you will generally have an additional tab in Firefox and the Addons manager popup.

You may need to configure Selenium to use a custom Firefox profile in order to make this change.

分分钟 2024-09-21 07:07:45

从配置文件目录中删除 extensions.rdf 文件将解决此问题。我为 Selenium 测试创建了一个单独的配置文件,仅用于 Selenium 测试。我很想听听是否还有其他方法。我的“extensions.lastAppVersion”已更新并反映了当前的浏览器版本,因此上述技巧对我不起作用。

请记住,用户调用 selenium 将重新创建 extensions.rdf 文件,因此我更喜欢为 Selenium 保留单独的配置文件

Removing the extensions.rdf file from profile directory will fix this issue . I have created a separate profile for Selenium tests, which is only used for Selenium Tests. I would love to hear if there is other way around . My "extensions.lastAppVersion" is updated and reflects the current browser version therefore the above trick does not work for me .

Remember, invoking selenium by user will re-create extensions.rdf file, therefore I prefer to keep separate profile for Selenium

橘亓 2024-09-21 07:07:45

找到这个答案并尝试后,我发现将 Selenium 会话中创建的临时配置文件中的 Extensions.rdf 和 extensions.ini 文件合并并将其放入自定义配置文件目录中可以解决此问题。

合并extensions.ini 时,请小心避免路径名错误。

Having found this answer and had a go, I found that merging the Extensions.rdf and extensions.ini file from the temporary profile created in a Selenium session and putting that into your Custom Profile directory solves this problem.

When merging extensions.ini, be careful to avoid getting the pathnames wrong.

余罪 2024-09-21 07:07:45

使用它 -

从地址栏输入“about:config”并添加/更新以下内容:
- extensions.update.notifyUser (type=boolean; value=false)
- extensions.newAddons (type=boolean; value=false)

这对我有用。

Use this -

From the address bar type “about:config” and add/update the following:
- extensions.update.notifyUser (type=boolean; value=false)
- extensions.newAddons (type=boolean; value=false)

It worked for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文