开发者

How do I load the Firebug extension into FirefoxProfile for WebDriver in C#

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..


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜