gpt4 book ai didi

firefox - Selenium - 如何使用控制台、脚本和网络打开 Firebug

转载 作者:行者123 更新时间:2023-12-04 17:12:25 27 4
gpt4 key购买 nike

我已经设置了一个自定义的 firefox 配置文件并在 selenium RC 启动时加载它。该配置文件已安装 firebug,当我使用该配置文件手动启动 firefox 时,firebug 处于事件状态。但是,当 selenium 启动该配置文件时,firebug 位于右下方,但未启用。如何确保它在启动时启用?或者,如何启用它(javascript 或?)- 我正在使用 Java API。

最佳答案

如果您创建一个新的 Firefox 配置文件并将其分配给您的驱动程序,则需要将新创建的 Firefox 配置文件的 extensions.firebug.allPagesActivation 值设置为 on .

例如在 Ruby 中,使用 Capybara:

profile = Selenium::WebDriver::Firefox::Profile.new
profile.add_extension("./firebug-1.10.6.xpi")

profile["extensions.firebug.console.enableSites"] = true
profile["extensions.firebug.net.enableSites"] = true
profile["extensions.firebug.script.enableSites"] = true
profile["extensions.firebug.allPagesActivation"] = "on"

Capybara::Selenium::Driver.new app, :browser => :firefox, :profile => profile

请参阅 Firebug Preferences 的文档

关于firefox - Selenium - 如何使用控制台、脚本和网络打开 Firebug ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4681072/

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