bonigarcia / webdrivermanager-examples

JUnit tests with Selenium WebDriver and WebDriverManager

Home Page:https://bonigarcia.dev/webdrivermanager/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when running FireFox tests on Windows

kfrajtak opened this issue · comments

Hi,
can you help me with following issue? Manager correctly gets the driver and then it fails when JVM cannot find class org/openqa/selenium/os/WindowsUtils. I tried to Google this class, but was not able to find out what Maven dependency am I missing.
Thanks,
Karel

2019-09-17 11:52:48 [main] DEBUG io.github.bonigarcia.wdm.Preferences - Preference found firefox69=0.25.0 (valid until 2019-09-18 11:21:47)
2019-09-17 11:52:48 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager - Using geckodriver 0.25.0 (since Mozilla Firefox 69 is installed in your machine)
2019-09-17 11:52:48 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager - Driver geckodriver 0.25.0 found in cache
2019-09-17 11:52:48 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager - Exporting webdriver.gecko.driver as C:\Users\kfrajtak\.m2\repository\webdriver\geckodriver\win64\0.25.0\geckodriver.exe

java.lang.NoClassDefFoundError: org/openqa/selenium/os/WindowsUtils

	at org.openqa.selenium.firefox.FirefoxBinary.locateFirefoxBinariesFromPlatform(FirefoxBinary.java:403)
	at org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:109)
	at java.base/java.util.Optional.orElseGet(Optional.java:369)
	at org.openqa.selenium.firefox.FirefoxOptions.getBinary(FirefoxOptions.java:216)
	at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:165)
	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)
	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:103)
	at io.github.bonigarcia.wdm.test.FirefoxTest.setupTest(FirefoxTest.java:52)

Hi,
can you help me with following issue? Manager correctly gets the driver and then it fails when JVM cannot find class org/openqa/selenium/os/WindowsUtils. I tried to Google this class, but was not able to find out what Maven dependency am I missing.
Thanks,
Karel

2019-09-17 11:52:48 [main] DEBUG io.github.bonigarcia.wdm.Preferences - Preference found firefox69=0.25.0 (valid until 2019-09-18 11:21:47)
2019-09-17 11:52:48 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager - Using geckodriver 0.25.0 (since Mozilla Firefox 69 is installed in your machine)
2019-09-17 11:52:48 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager - Driver geckodriver 0.25.0 found in cache
2019-09-17 11:52:48 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager - Exporting webdriver.gecko.driver as C:\Users\kfrajtak\.m2\repository\webdriver\geckodriver\win64\0.25.0\geckodriver.exe

java.lang.NoClassDefFoundError: org/openqa/selenium/os/WindowsUtils

	at org.openqa.selenium.firefox.FirefoxBinary.locateFirefoxBinariesFromPlatform(FirefoxBinary.java:403)
	at org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:109)
	at java.base/java.util.Optional.orElseGet(Optional.java:369)
	at org.openqa.selenium.firefox.FirefoxOptions.getBinary(FirefoxOptions.java:216)
	at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:165)
	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)
	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:103)
	at io.github.bonigarcia.wdm.test.FirefoxTest.setupTest(FirefoxTest.java:52)

I have the same trouble in IDEA 2019
https://gyazo.com/5cd11b4c105236ad9a7aff5a047a004a

You need to review pom.xml

add / change (if other versions) : [dnt use beta drivers :)] [better always us stable]

<dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-firefox-driver</artifactId>
            <version>3.141.59</version>
</dependency>
<dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-chrome-driver</artifactId>
            <version>3.141.59</version>
            <scope>test</scope>
</dependency>
<dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>lift</artifactId>
            <version>3.141.59</version>
</dependency>
        <dependency>
            <groupId>io.github.bonigarcia</groupId>
            <artifactId>webdrivermanager</artifactId>
            <version>3.7.1</version>
            <scope>compile</scope>
</dependency>

and i remember i found some dependency for delete better send here your pom.xml

Hi,

Same here.

I'm trying to use .browserpath to make it point to a portable Firefox and get the same error message
I'm using the examples directly and the original POM.XML.

java.lang.NoClassDefFoundError: org/openqa/selenium/os/WindowsUtils
at org.openqa.selenium.firefox.FirefoxBinary.locateFirefoxBinariesFromPlatform(FirefoxBinary.java:403)
at org.openqa.selenium.firefox.FirefoxBinary.(FirefoxBinary.java:109)...

I'll add the path to Firefox is correct as the log finds it :
"2020-01-22 13:52:28 [main] DEBUG io.github.bonigarcia.wdm.Preferences - Preference firefox=72 (valid until 2020-01-23 12:09:54)
2020-01-22 13:52:28 [main] DEBUG io.github.bonigarcia.wdm.Preferences - Preference firefox72=0.26.0 (valid until 2020-01-23 12:09:54)
2020-01-22 13:52:28 [main] INFO i.g.bonigarcia.wdm.WebDriverManager - Using geckodriver 0.26.0 (since Mozilla Firefox 72 is installed in your machine)
2020-01-22 13:52:28 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager - Driver geckodriver 0.26.0 found in cache
2020-01-22 13:52:28 [main] INFO i.g.bonigarcia.wdm.WebDriverManager - Exporting webdriver.gecko.driver as C:\Users\obordere.m2\repository\webdriver\geckodriver\win64\0.26.0\geckodriver.exe
"

SOLVED :
Commented the following in the POM :

org.seleniumhq.selenium
selenium-remote-driver
${selenium.version}