4

上下文:Azure、C#、ClearScript、Selenium、Firefox

我将 Selenium 的 Firefox 符号公开到 ClearScript JavaScript 环境中。在以下 JavaScript 代码中,从 C# 公开/导出的符号以 CS 为前缀。

// Preamble_LaunchBrowser.js
driverService = CSFirefoxDriverService.CreateDefaultService();
driverService.FirefoxBinaryPath = "C:\\Program Files\\Mozilla Firefox\\firefox.exe";
driverService.HideCommandPromptWindow = true;
driverService.SuppressInitialDiagnosticInformation = true;
var options = new CSFirefoxOptions();
driver = new CSFirefoxDriver(driverService, options, CSTimeSpan.FromSeconds(10));
driver.Url = "http://www.google.com.au/";

目前我不支持配置文件,但想以某种方式添加它们。如何在 FirefoxDriverService 的上下文中指定配置文件?

4

1 回答 1

1

At present I have no support for profiles, but would like to add them somehow. How would I specify a profile in the context of a FirefoxDriverService?

Forgive me if I'm missing the point.

Just start up FireFox with this command line firefox.exe -p to create a new profile.

Then when you run your javascript, run it in FireFox under the newly created profile.

于 2016-10-26T12:51:20.760 回答