2017-07-08 11 views
0

私は webdriverをポータブルFirefoxのC#の

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

var driver = new FirefoxDriver(binary, profile); 

Firefoxの

ポータブルロードしようとしましたが、私はuはplsは私を助けることができる

ラインvar driver = new FirefoxDriver(binary, profile);にエラーUnable to find a matching set of capabilitiesを取得しますか?

そしてラインvar driver = new FirefoxDriver(binary, profile);に私は警告している:

FirefoxDriverはFirefoxBinaryオブジェクトを構築すべきではありません。代わりにFirefoxOptionsを使用してください。このコンストラクタは、将来のリリースで削除されます。

どのようにコードを書き直すことができますか?

UPD: 私はコードを書き換える:再びエラーUnable to find a matching set of capabilities

答えて

0

ソリューションを持って、

FirefoxProfile profile = new FirefoxProfile(); 
FirefoxOptions options = new FirefoxOptions(); 
options.Profile = profile; 
options.BrowserExecutableLocation = Directory.GetCurrentDirectory() + @"\FirefoxPortable64\FirefoxPortable.exe"; 
var driver = new FirefoxDriver(options); 

しかし、それは仕事をdoesntの。

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

これは理論的に質問に答えることができますが、コードが何をしているのか、どのように答えているのかを記述することをお勧めします。 – JeffC

関連する問題