Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WebDriver便携式Firefox c#_C#_Selenium_Selenium Webdriver_Webdriver - Fatal编程技术网

WebDriver便携式Firefox c#

WebDriver便携式Firefox c#,c#,selenium,selenium-webdriver,webdriver,C#,Selenium,Selenium Webdriver,Webdriver,我试图加载便携式Firefox FirefoxProfile profile = new FirefoxProfile(); var binary = new FirefoxBinary(Directory.GetCurrentDirectory()+ @"\FirefoxPortable64\FirefoxPortable.exe"); var driver = new FirefoxDriver(binary, profile); 但是我发现错误无法在var driver=newfire

我试图加载便携式Firefox

FirefoxProfile profile = new FirefoxProfile();
var binary = new FirefoxBinary(Directory.GetCurrentDirectory()+ @"\FirefoxPortable64\FirefoxPortable.exe");

var driver = new FirefoxDriver(binary, profile);
但是我发现错误
无法在
var driver=newfirefoxdriver(二进制文件,概要文件)行中找到匹配的功能集

你能帮我吗

行内
var-driver=新的FirefoxDriver(二进制,配置文件)我收到警告:

FirefoxDriver不应使用FirefoxBinary对象构造。改用FirefoxOptions。此构造函数将在将来的版本中删除

如何重写代码

UPD: 我重写代码:

FirefoxProfile profile = new FirefoxProfile();
FirefoxOptions options = new FirefoxOptions();
options.Profile = profile;
options.BrowserExecutableLocation = Directory.GetCurrentDirectory() + @"\FirefoxPortable64\FirefoxPortable.exe";
var driver = new FirefoxDriver( options);
但它不起作用,再次出现错误
无法找到一组匹配的功能
解决方案

 options.BrowserExecutableLocation = Directory.GetCurrentDirectory() + @"\FirefoxPortable32\App\Firefox\firefox.exe";

虽然这在理论上可以回答这个问题,但最好添加代码的功能描述以及代码如何回答这个问题。