1

i have a VPS with ubuntu 14.04 LTS and with the desktop package installed, that mean I can launch firefox from a ssh -X session. To make tests, I launched from my server the selenium standalone server jar (selenium-server-standalone-3.0.0-beta3.jar) After launching it, in another ssh session, i just enter python commands :

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

And after that, following the instructions from http://selenium-python.readthedocs.io/getting-started.html#using-selenium-with-remote-webdriver, I enter :

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

After 45sec, i have lots of errors in both server window and client window. Here is the main error :

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

I saw some people with the same problem, but even with the latest java and selenium versions, i still got this issue. Thank you in advance for your help

Saurabh Gaur
  • 23,507
  • 10
  • 54
  • 73
saperlipopette
  • 177
  • 1
  • 12

1 Answers1

0

It seems you're trying selenium 3 with latest firefox version. To support latest firefox with selenium 3, need to download latest geckodriver executable from this link and extract it into you system at any location.

Now to run selenium-server-standalone-3.0.0-beta3.jar use below command :-

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

Now you need to set capability with marionette property to true to support latest firefox with selenium 3 as below :-

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)

Note :- For more information about marionette follow this Mozilla official page

Saurabh Gaur
  • 23,507
  • 10
  • 54
  • 73
  • Tried with an older version of selenium (2.53) same issue, going to try yours ;) – saperlipopette Sep 05 '16 at 18:03
  • @saperlipopette Ya sure you can use same answer to support latest firefox with geckodriver with selenium 3 as well as selenium 2. Let me know if you have any problem..:) – Saurabh Gaur Sep 05 '16 at 18:08
  • Exception in thread "main" com.beust.jcommander.ParameterException: Unknown option: -Dwebdriver.gecko.driver – saperlipopette Sep 08 '16 at 11:28
  • Is this error occurred when you run `java -jar selenium-server-standalone-3.0.0-beta3.jar -Dwebdriver.gecko.driver = "path/to/downloaded geckodriver"` at command line?? – Saurabh Gaur Sep 08 '16 at 18:35
  • Have a look [this link](http://stackoverflow.com/questions/36831030/exception-in-thread-main-error-in-eclipse-when-trying-to-run-testng-class) may be it helps – Saurabh Gaur Sep 10 '16 at 06:46