使用FirefoxProfile以编程方式打开Firefox浏览器devtools

问题描述:

如何使用selenium和Java打开devtools以启动Firefox 52?使用FirefoxProfile以编程方式打开Firefox浏览器devtools

萤火虫的合并是我用FirefoxProfile以编程方式打开控制台火狐DevTools前:

profile.setPreference("extensions.firebug.console.enableSites", true); 

但萤火虫已经不现在的工作。 那么打开网络或控制台选项卡的正确方式是什么?

此外,是否有FirePath的任何模拟扩展来自动启动并使用而不是当前损坏的FirePath扩展?

+0

感谢您纠正我,并为我可怜的英语感到抱歉。 – BohdanN

我设法与特定网页和本地devtools命令行打开使用-devtools参数启动Firefox:

firefox -no-remote -profile "c:\deleteme" -devtools -url "http://example.com/" 

这似乎是可能的到的参数传递给的webdriver通过调用 addCommandLineOptions("-devtools")FirefoxBinary实例。

(通过How can I tell selenium to start firefox with certain commandline options?


或者在节点也许firefox.Options().setBinary(…).addArguments("-devtools")

看准firefox -help | more参数,但很可惜,似乎呈现并非所有的信息存在,以及在给定的信息Command_Line_Options MDC page仍然有效。 -devtools目前在MDN页面上缺少一个。