我尝试加载Portable Firefox
FirefoxProfile profile = new FirefoxProfile();
var binary = new FirefoxBinary(Directory.GetCurrentDirectory()+ @"\FirefoxPortable64\FirefoxPortable.exe");
var driver = new FirefoxDriver(binary, profile);
但我在第Unable to find a matching set of capabilities
行
var driver = new FirefoxDriver(binary, profile);
你可以帮我吗?
在var driver = new FirefoxDriver(binary, profile);
行中,我有警告:
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);
但它不起作用,再次出现错误Unable to find a matching set of capabilities
答案 0 :(得分:0)
解决方案;
options.BrowserExecutableLocation = Directory.GetCurrentDirectory() + @"\FirefoxPortable32\App\Firefox\firefox.exe";