0

I am new to the JAVA + Selenium. I am using JAVa version 14x and selenium 3.141.x.

I came across WebDriverManager dependency which eliminates tedious task of maintaining browserDriver when our browsers' versions are upgraded. I a small selenium script to launch Chrome browser with the Help of WebDriverManager. However, it is not working and throwing an exception. Please details of error. Can someone please help me where I ma going wrong with this?

PS: Browser is launched if I uncomment row #12; and comment #13

WebDriverManager Maven Dependency

<!-- https://mvnrepository.com/artifact/io.github.bonigarcia/webdrivermanager -->
<dependency>
    <groupId>io.github.bonigarcia</groupId>
    <artifactId>webdrivermanager</artifactId>
    <version>4.2.2</version>
</dependency>

Error enter image description here

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" java.lang.NoSuchMethodError: 'java.lang.String org.apache.commons.io.IOUtils.toString(java.io.InputStream, java.nio.charset.Charset)'
    at io.github.bonigarcia.wdm.versions.Shell.runAndWaitNoLog(Shell.java:66)
    at io.github.bonigarcia.wdm.versions.Shell.runAndWaitArray(Shell.java:55)
    at io.github.bonigarcia.wdm.versions.Shell.runAndWait(Shell.java:49)
    at io.github.bonigarcia.wdm.versions.VersionDetector.getBrowserVersionInWindows(VersionDetector.java:220)
    at io.github.bonigarcia.wdm.versions.VersionDetector.getDefaultBrowserVersion(VersionDetector.java:180)
    at io.github.bonigarcia.wdm.managers.ChromeDriverManager.getBrowserVersionFromTheShell(ChromeDriverManager.java:124)
    at io.github.bonigarcia.wdm.WebDriverManager.detectBrowserVersion(WebDriverManager.java:718)
    at io.github.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(WebDriverManager.java:591)
    at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:543)
    at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:287)
    at Academy.Temp.main(Temp.java:20)
Pradeep
  • 11
  • 2

1 Answers1

0

Try adding commons.io to your pom.xml:

<dependency>
    <groupId>commons-io</groupId>
    <artifactId>commons-io</artifactId>
    <version>2.7</version>
</dependency>

As suggested here.

Mate Mrše
  • 7,997
  • 10
  • 40
  • 77