有人可以告诉我如何使用 C# 在 Selenium 中设置 firefox exe 文件的路径吗? 我认为这会有所帮助,但没有人只接受 FirefoxBinary:
FirefoxBinary binary = new FirefoxBinary("~/lib/mozilla firefox/firefox.exe");
IWebDriver driver = new FirefoxDriver(binary); //not a valid constructor
最佳答案
尝试下面的代码
//give exe path here
var service = FirefoxDriverService.CreateDefaultService("~/lib/mozilla firefox/firefox.exe");
var driver = new FirefoxDriver(service);
如果有任何问题,请告诉我。
关于c# - Selenium WebDriver-如何指定 Firefox 二进制位置 (c#),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35446890/