2016-09-05 3 views
1

VPSubuntu 14.04 LTSがあり、デスクトップパッケージがインストールされているので、ssh -Xセッションからfirefoxを起動できます。テストは、私はそれを起動した後、私のサーバーからセレンスタンドアロンサーバジャー(selenium-server-standalone-3.0.0-beta3.jar) を立ち上げ、別のsshセッションでは、私はちょうどPythonコマンドを入力するようにするに :UBUNTU GUIサーバー上のセレンサーバー、セレンクライアント

from selenium import webdriver 
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities 

その後、 http://selenium-python.readthedocs.io/getting-started.html#using-selenium-with-remote-webdriverからの指示に従って、私は次のように入力します。

driver = webdriver.Remote(
command_executor='http://127.0.0.1:4444/wd/hub', 
desired_capabilities=DesiredCapabilities.FIREFOX) 

45秒後、私はサーバーウィンドウとクライアントウィンドウの両方に多くのエラーがあります。ここで が主なエラーです:

Caused by: org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output: Error: GDK_BACKEND does not match available displays

私は同じ問題を持つ一部の人を見ましたが、それでも最新のJavaおよびセレンのバージョンで、私はまだこの問題を得ました。 ご協力いただきありがとうございます

+0

あなたのfirefoxは何ですか? ersion ?? –

+0

Mozilla Firefox 48.0 – saperlipopette

+0

答えを使用して私に教えてください:) –

答えて

0

最新のFirefoxバージョンをご使用のようです。selenium 3selenium 3で最新のFirefoxをサポートするには、download latest geckodriver executable from this linkを必要とし、それをあなたのシステムに任意の場所で抽出します。コマンド以下selenium-server-standalone-3.0.0-beta3.jar使用実行するために今

: - :

from selenium import webdriver 
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities 

caps = DesiredCapabilities.FIREFOX 

# Tell the Python bindings to use Marionette. 
caps["marionette"] = True 

driver = webdriver.Remote(command_executor = 'http://127.0.0.1:4444/wd/hub', desired_capabilities = caps) 

注 -

java -jar selenium-server-standalone-3.0.0-beta3.jar -Dwebdriver.gecko.driver = "path/to/downloaded geckodriver" 

を今、あなたは以下のようにselenium 3で最新のFirefoxをサポートするためにtruemarionetteプロパティと機能を設定する必要があります: - 詳しくはinformation about marionette follow this Mozilla official page

+0

セレンの古いバージョン(2.53)を試してみてください、あなたに試してみてください) – saperlipopette

+0

@saperlipopette確かに同じ回答をサポートに使うことができます最新のFirefox、セレン3とセレン2のgeckodriver 2.何か問題があればお知らせください:) –

+0

スレッド "main"の例外com.beust.jcommander.ParameterException:不明なオプション:-Dwebdriver.gecko.driver – saperlipopette

関連する問題