如何在 C# 中将 Firebug 扩展加载到 FirefoxProfile for WebDriver
我需要将 Firebug 和 NetExport 加载到 WebDriver 的 firefox 配置文件中,并且以下代码根本不起作用:
profile.AddExtension(@"C:\source\QuickQA\Test\Assemblies\firebug-1.6.2.xpi");
profile.AddExtension(@"C:\source\QuickQA\Test\Assemblies\netExport-0.8b12.xpi");
profile.SetPreference("extensions.firebug.currentVersion", "1.7.0a3");
profile.SetPreference("extensions.firebug.previousPlacement", 1);
profile.SetPreference("extensions.firebug.onByDefault", true);
profile.SetPreference("extensions.firebug.defaultPanelName", "net");
profile.SetPreference("extensions.firebug.net.enableSites", true);
profile.SetPreference("extensions.firebug.netexport.defaultLogDir", NetExportDirectory);
profile.SetPreference("extensions.firebug.netexport.alwaysEnableAutoExport", true);
这是错误:
System.IO.IOException : Cannot create "C:\source\QuickQA\Test\Assemblies\firebug-1.6.2.xpi" because a file or directory with the same name already exists.
我最好的猜测(因为对此严重缺乏文档)是 AddExtension
方法需要一个包含扩展的二进制文件的字符串,而不是其位置的路径。
有人可以解释一下吗? 一个有效的例子将不胜感激..
I need to load Firebug and NetExport into a firefox profile for WebDriver, and the following code doesn't work at all:
profile.AddExtension(@"C:\source\QuickQA\Test\Assemblies\firebug-1.6.2.xpi");
profile.AddExtension(@"C:\source\QuickQA\Test\Assemblies\netExport-0.8b12.xpi");
profile.SetPreference("extensions.firebug.currentVersion", "1.7.0a3");
profile.SetPreference("extensions.firebug.previousPlacement", 1);
profile.SetPreference("extensions.firebug.onByDefault", true);
profile.SetPreference("extensions.firebug.defaultPanelName", "net");
profile.SetPreference("extensions.firebug.net.enableSites", true);
profile.SetPreference("extensions.firebug.netexport.defaultLogDir", NetExportDirectory);
profile.SetPreference("extensions.firebug.netexport.alwaysEnableAutoExport", true);
here is the error:
System.IO.IOException : Cannot create "C:\source\QuickQA\Test\Assemblies\firebug-1.6.2.xpi" because a file or directory with the same name already exists.
My best guess (since there is a profound lack of documentation for this) is that the AddExtension
method wants a string containing the binary of the extension, instead of a path to its location.
Can someone shed some light on this?
A working example would be greatly appreciated..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明这是一个错误:http://code.google.com/ p/selenium/issues/detail?id=1894
它已被最近的修订版修复,因此如果您检查了源代码,则可以获得修复了此问题的构建。
Turns out this is a bug: http://code.google.com/p/selenium/issues/detail?id=1894
It has been fixed by a recent revision, so if you have the source code checked out you can get a build with this issue fixed.