上下文: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 的上下文中指定配置文件?
最佳答案
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?
如果我没说到重点,请原谅我。
只需使用此命令行 firefox.exe -p
启动 FireFox 即可创建新的配置文件。
然后当您运行 javascript 时,在 FireFox 中在新创建的配置文件下运行它。
关于javascript - 如何在 C# Selenium 中向 FirefoxDriverService 添加配置文件规范?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39909734/