Selenide: how to hide selenide descriptive messages on console

Created on 3 Mar 2016  Â·  9Comments  Â·  Source: selenide/selenide

Hello Guys,

I am wondering how to hide Selenide descriptive messages when compiling and run selenide test from the console using Maven.

I need only my messages to appear which were written in the test.

question

Most helpful comment

@hana9090 Hei,
actually I have no idea why you want to hide them. It's a normal output of tests run. People typically do want to see it.

Anyway, the question is not Selenide-related. It's about hiding test output from JUnit in Maven. Try to google it.

All 9 comments

@hana9090 hi!
Please specify which message you mean.

such like these:

Running sa.vanilla.test.logintest.firefox.Vanilla_Login_successfully
Mar 03, 2016 9:54:16 AM com.codeborne.selenide.webdriver.WebDriverFactory create
WebDriver
INFO: BrowserName=firefox Version=44.0.2 Platform=WINDOWS
Mar 03, 2016 9:54:16 AM com.codeborne.selenide.webdriver.WebDriverFactory create
WebDriver
INFO: Selenide v. 3.2
Mar 03, 2016 9:54:16 AM com.codeborne.selenide.webdriver.WebDriverFactory create
WebDriver
INFO: Selenium WebDriver v. 2.50.1 build time: 2016-01-29 11:11:26
Mar 03, 2016 9:54:16 AM com.codeborne.selenide.impl.WebDriverThreadLocalContaine
r createDriver
INFO: Create webdriver in current thread 1: firefox -> FirefoxDriver: firefox on
 WINDOWS (b6b95c38-e0bf-4adc-ba01-2f7c2f1b5b3f)
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 108.981 sec <<<
FAILURE!

You can change it with your general log4j configuration. E.g. Set log level to WARN, or exclude classes that you dont want to log.

Viele Grüße

Alexei Vinogradov

Sent from mobile phone

Am 03.03.2016 um 10:02 schrieb hana9090 [email protected]:

such like these:

Running sa.vanilla.test.logintest.firefox.Vanilla_Login_successfully
Mar 03, 2016 9:54:16 AM com.codeborne.selenide.webdriver.WebDriverFactory create
WebDriver
INFO: BrowserName=firefox Version=44.0.2 Platform=WINDOWS
Mar 03, 2016 9:54:16 AM com.codeborne.selenide.webdriver.WebDriverFactory create
WebDriver
INFO: Selenide v. 3.2
Mar 03, 2016 9:54:16 AM com.codeborne.selenide.webdriver.WebDriverFactory create
WebDriver
INFO: Selenium WebDriver v. 2.50.1 build time: 2016-01-29 11:11:26
Mar 03, 2016 9:54:16 AM com.codeborne.selenide.impl.WebDriverThreadLocalContaine
r createDriver
INFO: Create webdriver in current thread 1: firefox -> FirefoxDriver: firefox on
WINDOWS (b6b95c38-e0bf-4adc-ba01-2f7c2f1b5b3f)
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 108.981 sec <<<
FAILURE!
—
Reply to this email directly or view it on GitHub.

+1 It's just a configuration issue.

Just configure log4j or JUL properly.
See http://selenide.org/2015/07/27/selenide-2.20

Hi vinogradoff
How to do that? how to access log4j ?

Hello Andrei,

I didn't know exactly how to get this done. and the link shows how to change the log format, but I need to remove all log messages or customize them.

thanks

@hana9090 Well, do you use some logging framework already?
I mean, do you use log4j, slf4j or Logback?

If not, you can configure java logging as described here:

  1. Add JVM option: -Djava.util.logging.config.file=C:\Temp\logging.properties
  2. Create file logging.properties contining something like this:
handlers=java.util.logging.ConsoleHandler
.level=INFO
com.codeborne.selenide.level=SEVERE

Thanks @asolntsev ,
now the logging for selenide is disappeared for successful tests, but for unsuccessful tests, No still there are logs appeared, can you please help me to hide them as well.
Note: I run Selenide under maven, hide maven logs by call tests by -q.
such like this:

image

@hana9090 Hei,
actually I have no idea why you want to hide them. It's a normal output of tests run. People typically do want to see it.

Anyway, the question is not Selenide-related. It's about hiding test output from JUnit in Maven. Try to google it.

Was this page helpful?
0 / 5 - 0 ratings