serenity-bdd / serenity-cucumber-starter

A skeleton project for Serenity BDD and Cucumber JVM
Apache License 2.0
180 stars 285 forks source link

Serenity : Could not instantiate new WebDriver instance of type class org.openqa.selenium.firefox.FirefoxDriver (Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: LINUX #62

Closed vpachpute062 closed 2 years ago

vpachpute062 commented 2 years ago

Hello Team

I have downloaded serenity framework from https://github.com/serenity-bdd/serenity-cucumber-starter

I am able to run on chrome perfectly. But when I change browser to firefox, it's giving me error as below.

Caused by: net.thucydides.core.webdriver.DriverConfigurationError: Could not instantiate new WebDriver instance of type class org.openqa.selenium.firefox.FirefoxDriver (Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: LINUX
Build info: version: '4.1.1', revision: 'e8fcc2cecf'
System info: host: 'administrator-Latitude-3510', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-94-generic', java.version: '11.0.13'
Driver info: driver.version: ProvideNewDriver). See below for more details.

headless.mode = false

serenity { take.screenshots = FOR_FAILURES } #

Chrome options can be defined using the chrome.switches property

# chrome.switches = """--start-maximized;--test-type;--no-sandbox;--ignore-certificate-errors; --disable-popup-blocking;--disable-default-apps;--disable-extensions-file-access-check; --incognito;--disable-infobars,--disable-gpu"""

drivers { windows { webdriver.gecko.driver = src/test/resources/webdriver/windows/chromedriver.exe } mac { webdriver.gecko.driver = src/test/resources/webdriver/mac/chromedriver } linux { webdriver.gecko.driver = src/test/resources/webdriver/linux/geckodriver } }

gecko.firefox.options=""" { "args": ["-headless", "-profile", "/path/to/my/profile"], "prefs": { "dom.ipc.processCount": 8 }, "log": { "level": "trace" } } """

wakaleo commented 2 years ago

Are you sure that this file exists? "src/test/resources/webdriver/linux/geckodriver". Otherwise delete the drivers section and let WebDriverManager download the right driver.

vpachpute062 commented 2 years ago

Hi @wakaleo Thanks for your suggestion. Yes, geckodriver binary exists at this location. Issue has been resolved. Might be an issue with compatibility. Earlier my firefox version was 96.0 and geckodriver version was geckodriver-v0.30.0-linux64 Later I downgraded firefox version 95.0.1 and with same geckodriver version (i.e.geckodriver-v0.30.0-linux64), it worked out.