我可以用 firefox portable 控制 selenium 吗?
Can I control selenium with firefox portable?
我已经阅读了很多有关使用selenium 和便携式firefox 的文章。但是代码对我不起作用。我做错什么了吗?我正在使用 firefox portable 67 和 Geckodriver v0.24.0.
FirefoxDriverService driverService = FirefoxDriverService.CreateDefaultService(@"D:\C# Project\FirefoxPortal tesst\FirefoxPortal tesst\bin\Debug\", "geckodriver.exe");
FirefoxOptions options = new FirefoxOptions();
//var profile = new FirefoxProfileManager().GetProfile("");
options.Profile = new FirefoxProfile(@"D:\C# Project\FirefoxPortal tesst\FirefoxPortal tesst\bin\Debug\FirefoxPortable\Data\profile");
options.BrowserExecutableLocation = @"D:\C# Project\FirefoxPortal tesst\FirefoxPortal tesst\bin\Debug\FirefoxPortable\FirefoxPortable.exe";
IWebDriver driver = new FirefoxDriver(driverService, options);
driver.Navigate().GoToUrl("https://whosebug.com/");
我今天没时间,试试改一下
options.BrowserExecutableLocation = @"D:\C# Project\FirefoxPortal tesst\FirefoxPortal tesst\bin\Debug\FirefoxPortable\FirefoxPortable.exe";
到
options.BrowserExecutableLocation = @"D:\C# Project\FirefoxPortal tesst\FirefoxPortal tesst\bin\Debug\FirefoxPortable\App\firefox64\firefox.exe";
或者到你有 firefox.exe 文件的任何地方。
我已经阅读了很多有关使用selenium 和便携式firefox 的文章。但是代码对我不起作用。我做错什么了吗?我正在使用 firefox portable 67 和 Geckodriver v0.24.0.
FirefoxDriverService driverService = FirefoxDriverService.CreateDefaultService(@"D:\C# Project\FirefoxPortal tesst\FirefoxPortal tesst\bin\Debug\", "geckodriver.exe");
FirefoxOptions options = new FirefoxOptions();
//var profile = new FirefoxProfileManager().GetProfile("");
options.Profile = new FirefoxProfile(@"D:\C# Project\FirefoxPortal tesst\FirefoxPortal tesst\bin\Debug\FirefoxPortable\Data\profile");
options.BrowserExecutableLocation = @"D:\C# Project\FirefoxPortal tesst\FirefoxPortal tesst\bin\Debug\FirefoxPortable\FirefoxPortable.exe";
IWebDriver driver = new FirefoxDriver(driverService, options);
driver.Navigate().GoToUrl("https://whosebug.com/");
我今天没时间,试试改一下
options.BrowserExecutableLocation = @"D:\C# Project\FirefoxPortal tesst\FirefoxPortal tesst\bin\Debug\FirefoxPortable\FirefoxPortable.exe";
到
options.BrowserExecutableLocation = @"D:\C# Project\FirefoxPortal tesst\FirefoxPortal tesst\bin\Debug\FirefoxPortable\App\firefox64\firefox.exe";
或者到你有 firefox.exe 文件的任何地方。