2017-02-10 7 views
0

私は2.53から3.0.1に自分のSeleniumアプリを移行しています。まず、ブラウザを起動して特定のページに移動するだけの小さなアプリでテストしたいと思います。
また、Firefox(バージョン51.0、Portable App)用のカスタムバイナリを使用したいと思います。新しいFirefoxDriver + Marionetteを使用したSelenium 3.0.1が開始ページに貼り付けられました

これは私のコードです:

public class Selenium { 

     public static void main(String[] args) { 
      WebDriver driver = createFFDriver(); 
      driver.navigate().to("http:...."); 
      System.out.println("Finished"); 
     } 

     public static WebDriver createFFDriver(){ 
      System.setProperty(GeckoDriverService.GECKO_DRIVER_EXE_PROPERTY,"foo/geckodriver64.exe"); 
      DesiredCapabilities capabilities = DesiredCapabilities.firefox(); 
      capabilities.setCapability("firefox_binary","foo/firefox.exe"); 
      return new FirefoxDriver(capabilities); 
     } 
} 

ブラウザが実際に開きますが、ブロックされました。
ログ

1486713046153 geckodriver INFO Listening on 127.0.0.1:12466 
Feb 10, 2017 8:50:46 AM org.openqa.selenium.remote.ProtocolHandshake 
createSession INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end 
1486713046731 mozprofile::profile INFO Using profile path foo\AppData\Local\Temp\rust_mozprofile.p25D0Gb1sBQm 
1486713046752 geckodriver::marionette INFO Starting browser foo\firefox\51.0\FirefoxPortable.exe 
1486713046782 geckodriver::marionette INFO Connecting to Marionette on localhost:52818 

なぜGeckodriverが127.0.0.1:12466をリスニングしているが、localhost:52818上のマリオネットに接続しようとしていますか?

これは私がはまり込むのページです: enter image description here

EDIT: それはRemoteWebDriverのstartSessionメソッドで立ち往生:

Response response = this.execute("newSession", parameters); 

答えて

0

と完璧に動作します。
従来のFirefox(51.0.1)では期待通りに動作します。

0

私はセレンV 3.0.1を使用してコードを試してみましたし、 Firefox 51.0.1(32ビット)、URL /その他のWebドライバ機能へのアクセスに成功しました/ブロッキングなし。

UPDATE

WebDriver firefox; System.setProperty(GeckoDriverService.GECKO_DRIVER_EXE_PROPERTY,"pathtogeckodriver"); FirefoxProfile profile = new FirefoxProfile(); firefox = new FirefoxDriver( new FirefoxBinary( new File(System.getProperty("user.dir"), "\\FirefoxPortable\\FirefoxPortable.exe")), profile); driver.get("http://www.google.com");

これはFirefoxのポータブル版はGeckoのドライバでうまく機能していないようだポータブルFirefoxバージョン(51.0.1)

+0

動作しません。ポータブルアプリケーション版のFirefoxを使用していますか? – buzz2buzz

+0

私はしようとしましたが、どちらもうまくいきません...ブラウザが起動すると、まだユーザーのプロフィールページにこだわっています。どの設定ポイントが私たちを区別できるかについてのアイデアはありますか? – buzz2buzz

+0

どのような例外がありますか? /どこで立ち往生したのですか? –

関連する問題