Use Firefox WebDriver with Mozilla GechoDriver

Q

How to use Firefox WebDriver with Mozilla GechoDriver?

✍: FYIcenter.com

A

If you are using the Firefox WebDriver with the Selenium Java API, you need to set the webdriver.gecko.driver system property to the path to the Mozilla GechoDriver driver as shown below.

1. Make sure that you have Mozilla GechoDriver WebDriver Server installed:

C:\fyicenter>dir \fyicenter\selenium\geckodriver
        14,478,647 geckodriver.exe

2. Set the webdriver.chrome.driver system property to the GechoDriver server program path and run the test again.

C:\fyicenter> java -classpath \
   .;\fyicenter\selenium\java\client-combined-3.141.59.jar;\
   \fyicenter\selenium\java\libs\guava-25.0-jre.jar;\
   \fyicenter\selenium\java\libs\okhttp-3.11.0.jar;\
   \fyicenter\selenium\java\libs\okio-1.14.0.jar;\
   \fyicenter\selenium\java\libs\commons-exec-1.3.jar \
   -Dwebdriver.gecko.driver=\fyicenter\selenium\geckodriver\geckodriver.exe \
   FirefoxTest

... mozrunner::runner       INFO    Running command: 
   "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-foreground" "-no-remote" 
   "-profile" "C:\\Users\\fyicenter\\AppData\\Local\\Temp\\rust_mozprofile.8nu3Uoj0IyMZ"
... Marionette INFO    Listening on port 61187
... Marionette WARN    TLS certificate errors will be ignored for this session
... Marionette DEBUG   [6442450945] Frame script loaded
... Marionette DEBUG   [6442450945] Frame script registered
   Apr  1, 2019 12:09:19 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
... Marionette DEBUG   [6442450945] Received DOM event beforeunload for about:blank
... Marionette DEBUG   [6442450945] Received DOM event pagehide for about:blank
... Marionette DEBUG   [6442450945] Received DOM event DOMContentLoaded for https://www.google.com/?gws_rd=ssl
... Marionette DEBUG   [6442450945] Received DOM event pageshow for https://www.google.com/?gws_rd=ssl
... Marionette INFO    Stopped listening on port 61187
[Parent 8020, Gecko_IOThread] WARNING: pipe error: 109: 
   file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
[Child 7716, Chrome_ChildThread] WARNING: pipe error: 109: 
   file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346

###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv

As you can see, we are getting a different error, which is caused by version compatibility issues of Selenium Firefox WebDriver, Mozilla GechoDriver, and MozillaFirefox. See next tutorial on how to fix it.

 

Compatibility of WebDriver Java API for Firefox

Firefox WebDriver Test with Selenium Java API

Starting with Selenium WebDriver Client Java API

⇑⇑ Selenium Tutorials

2020-01-29, 1783🔥, 0💬