1

I am using below code with WebDriverManager-

package MySelenium.mySelenium;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import io.github.bonigarcia.wdm.WebDriverManager;

public class TestSelenium {

    public static void main(String[] args) {

        WebDriverManager.chromedriver().setup();
        WebDriver driver = new ChromeDriver();
        driver.get("https://www.demoqa.com");
        driver.quit();
    }

}

Getting below message when I run my program, although it's not impacting my execution. It ran successfully but with this message-

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.
Starting ChromeDriver 89.0.4389.23

I searched on stack overflow and found that if I add below two jars in POM.xml, error will be removed, so I have added these two jars but now started getting different message-

<artifactId>slf4j-log4j12</artifactId>
<artifactId>slf4j-api</artifactId>

Message now getting-

log4j:WARN No appenders could be found for logger (io.github.bonigarcia.wdm.cache.ResolutionCache).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Starting ChromeDriver 89.0.4389.23

Kindly help to remove these messages

Gaurav
  • 101
  • 3
  • 12
  • I believe those are just a warning messages. Or is it causing any problem in launching chrome ? – Madhan Apr 18 '21 at 09:32
  • yeah...they are just warning message. My test is running successfully. Chrome is launching perfectly. But what I can do to suppress these messages. – Gaurav Apr 18 '21 at 14:38
  • attached the logs in description itself. Kindly refer the last one – Gaurav Apr 21 '21 at 16:15

1 Answers1

0

You can add the below jars files

org.slf4j

slf4j-api

1.7.5

org.slf4j

slf4j-log4j12

1.7.5

Ramesh Korla
  • 64
  • 2
  • 3
  • 8
  • As mentioned above, I have already added these two jars as well. Then start getting different warning message.(as shown above in description) – Gaurav Apr 19 '21 at 15:34
  • Unfortunately, this didn't work for me. I am still getting slf4j warnings. – Vaclav Vlcek Dec 07 '22 at 19:06