New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change log level on chromeDriver. #75

Closed
GoogleCodeExporter opened this Issue Apr 15, 2015 · 13 comments

Comments

Projects
None yet
1 participant
@GoogleCodeExporter
Contributor

GoogleCodeExporter commented Apr 15, 2015

HI guys i need help to hange log level on chromeDriver.

the chromeDriver default level log is Debug im trying

http://code.google.com/p/chromedriver/wiki/CapabilitiesAndSwitches
http://code.google.com/p/selenium/wiki/DesiredCapabilities#JSON_object

Im trying use this code that works on fireFox,it seems he does not recognize 
the capabilities "loggingPrefs"

"
  public void createDriver() {

      LoggingPreferences logs = new LoggingPreferences();
      logs.enable(LogType.DRIVER, Level.INFO);
      DesiredCapabilities capabilities =DesiredCapabilities.chrome();
      capabilities.setCapability(CapabilityType.LOGGING_PREFS, logs);
      driver = new RemoteWebDriver(service.getUrl(),capabilities);
  }

"

--------------------------------------------------------------------------------
--------------------------------

[TestNG] Running:
  /tmp/testng-eclipse-255235876/testng-customsuite.xml

Started ChromeDriver
port=19309
version=18.0.1022.0
log=/opt/trunk/auction-tests-novo/chromedriver.log
[DEBUG] [main] 2012-04-27 16:27:00,227 ThreadSafeClientConnManager:314  - 
Closing connections idle longer than 100 MILLISECONDS
[DEBUG] [main] 2012-04-27 16:27:00,231 ConnPoolByRoute:725  - Closing 
connections idle longer than 100 MILLISECONDS
[DEBUG] [main] 2012-04-27 16:27:00,328 ThreadSafeClientConnManager:221  - Get 
connection: HttpRoute[{}->http://localhost:19309], timeout = 120000
[DEBUG] [main] 2012-04-27 16:27:00,331 ConnPoolByRoute:350  - 
[HttpRoute[{}->http://localhost:19309]] total kept alive: 0, total issued: 0, 
total allocated: 0 out of 2000
[DEBUG] [main] 2012-04-27 16:27:00,332 ConnPoolByRoute:523  - No free 
connections [HttpRoute[{}->http://localhost:19309]][null]
[DEBUG] [main] 2012-04-27 16:27:00,332 ConnPoolByRoute:369  - Available 
capacity: 2000 out of 2000 [HttpRoute[{}->http://localhost:19309]][null]
[DEBUG] [main] 2012-04-27 16:27:00,332 ConnPoolByRoute:549  - Creating new 
connection [HttpRoute[{}->http://localhost:19309]]
[DEBUG] [main] 2012-04-27 16:27:00,350 DefaultClientConnectionOperator:145  - 
Connecting to localhost:19309
[DEBUG] [main] 2012-04-27 16:27:00,374 RequestAddCookies:132  - CookieSpec 
selected: best-match
[DEBUG] [main] 2012-04-27 16:27:00,391 RequestAuthCache:75  - Auth cache not 
set in the context
[DEBUG] [main] 2012-04-27 16:27:00,392 DefaultHttpClient:643  - Attempt 1 to 
execute request
[DEBUG] [main] 2012-04-27 16:27:00,392 DefaultClientConnection:264  - Sending 
request: POST /session HTTP/1.1
[DEBUG] [main] 2012-04-27 16:27:00,393 wire:63  - >> "POST /session 
HTTP/1.1[\r][\n]"
[DEBUG] [main] 2012-04-27 16:27:00,395 wire:63  - >> "Accept: application/json, 
image/png[\r][\n]"
[DEBUG] [main] 2012-04-27 16:27:00,396 wire:63  - >> "Content-Type: 
application/json; charset=utf-8[\r][\n]"
[DEBUG] [main] 2012-04-27 16:27:00,396 wire:63  - >> "Content-Length: 
111[\r][\n]"
[DEBUG] [main] 2012-04-27 16:27:00,397 wire:63  - >> "Host: 
localhost:19309[\r][\n]"
[DEBUG] [main] 2012-04-27 16:27:00,398 wire:63  - >> "Connection: 
Keep-Alive[\r][\n]"
[DEBUG] [main] 2012-04-27 16:27:00,398 wire:63  - >> "[\r][\n]"
[DEBUG] [main] 2012-04-27 16:27:00,398 headers:268  - >> POST /session HTTP/1.1
[DEBUG] [main] 2012-04-27 16:27:00,399 headers:271  - >> Accept: 
application/json, image/png
[DEBUG] [main] 2012-04-27 16:27:00,399 headers:271  - >> Content-Type: 
application/json; charset=utf-8
[DEBUG] [main] 2012-04-27 16:27:00,399 headers:271  - >> Content-Length: 111
[DEBUG] [main] 2012-04-27 16:27:00,399 headers:271  - >> Host: localhost:19309
[DEBUG] [main] 2012-04-27 16:27:00,400 headers:271  - >> Connection: Keep-Alive
[DEBUG] [main] 2012-04-27 16:27:00,400 wire:77  - >> 
"{"desiredCapabilities":{"loggingPrefs":{"driver":"INFO"},"platform":"ANY","brow
serName":"chrome","version":""}}"
[DEBUG] [main] 2012-04-27 16:27:00,402 wire:63  - << "HTTP/1.1 400 Bad 
Request[\r][\n]"
[DEBUG] [main] 2012-04-27 16:27:00,405 wire:63  - << 
"content-length:114[\r][\n]"
[DEBUG] [main] 2012-04-27 16:27:00,406 wire:63  - << 
"content-type:application/json; charset=utf-8[\r][\n]"
[DEBUG] [main] 2012-04-27 16:27:00,406 wire:63  - << "[\r][\n]"
[DEBUG] [main] 2012-04-27 16:27:00,407 DefaultClientConnection:249  - Receiving 
response: HTTP/1.1 400 Bad Request
[DEBUG] [main] 2012-04-27 16:27:00,408 headers:252  - << HTTP/1.1 400 Bad 
Request
[DEBUG] [main] 2012-04-27 16:27:00,408 headers:255  - << content-length:114
[DEBUG] [main] 2012-04-27 16:27:00,408 headers:255  - << 
content-type:application/json; charset=utf-8
[DEBUG] [main] 2012-04-27 16:27:00,414 DefaultHttpClient:487  - Connection can 
be kept alive indefinitely
[DEBUG] [main] 2012-04-27 16:27:00,422 wire:77  - << 
"{"status":400,"value":{"message":"loggingPrefs.driver must be of type integer, 
not string. Received: \"INFO\"\n"}}"
[DEBUG] [main] 2012-04-27 16:27:00,422 ThreadSafeClientConnManager:270  - 
Released connection is reusable.
[DEBUG] [main] 2012-04-27 16:27:00,423 ConnPoolByRoute:434  - Releasing 
connection [HttpRoute[{}->http://localhost:19309]][null]
[DEBUG] [main] 2012-04-27 16:27:00,423 ConnPoolByRoute:460  - Pooling 
connection [HttpRoute[{}->http://localhost:19309]][null]; keep alive 
indefinitely
[DEBUG] [main] 2012-04-27 16:27:00,423 ConnPoolByRoute:679  - Notifying no-one, 
there are no waiting threads
FAILED CONFIGURATION: @BeforeMethod createDriver
org.openqa.selenium.WebDriverException: loggingPrefs.driver must be of type 
integer, not string. Received: "INFO"
 (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 178 milliseconds
Build info: version: '2.18.0', revision: '15704', time: '2012-01-27 17:37:17'
System info: os.name: 'Linux', os.arch: 'i386', os.version: 
'2.6.35-31-generic-pae', java.version: '1.6.0_27'
Driver info: driver.version: RemoteWebDriver
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:147)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:113)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:439)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:139)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:94)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:102)
    at common.ChromeTestCase.createDriver(ChromeTestCase.java:75)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
    at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:551)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:640)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:894)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1219)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
    at org.testng.TestRunner.privateRun(TestRunner.java:768)
    at org.testng.TestRunner.run(TestRunner.java:617)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
    at org.testng.SuiteRunner.run(SuiteRunner.java:240)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:87)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
    at org.testng.TestNG.run(TestNG.java:1022)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:109)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:202)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:173)

-- 
Bruno Daniel Marinho

Sun Certified Java Associate
Sun Certified Java Programmer 
Sun Certified Web Component Developer
Oracle Certified Professional, Java EE 5 Business Component Developer
Oracle Certified Professional Java EE 5 Web Services Developer

Blog de Tecnologia
brunodanielmarinho.wordpress.com




Original issue reported on code.google.com by bdmsty...@gmail.com on 27 Apr 2012 at 7:34

@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Apr 15, 2015

Contributor

Original comment by barancev on 3 May 2012 at 2:57

  • Added labels: Browser-Chrome, Component-WebDriver
Contributor

GoogleCodeExporter commented Apr 15, 2015

Original comment by barancev on 3 May 2012 at 2:57

  • Added labels: Browser-Chrome, Component-WebDriver
@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Apr 15, 2015

Contributor

Original comment by david.bu...@theautomatedtester.co.uk on 5 May 2012 at 8:52

Contributor

GoogleCodeExporter commented Apr 15, 2015

Original comment by david.bu...@theautomatedtester.co.uk on 5 May 2012 at 8:52

@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Apr 15, 2015

Contributor
ChromeDriver should accept the level as a string. Right now it mistakenly 
expects the integer equivalent of the log level.

Original comment by kkania@chromium.org on 7 May 2012 at 5:32

  • Changed state: Accepted
  • Added labels: Priority-Low
  • Removed labels: Browser-Chrome, Component-WebDriver, Priority-Medium
Contributor

GoogleCodeExporter commented Apr 15, 2015

ChromeDriver should accept the level as a string. Right now it mistakenly 
expects the integer equivalent of the log level.

Original comment by kkania@chromium.org on 7 May 2012 at 5:32

  • Changed state: Accepted
  • Added labels: Priority-Low
  • Removed labels: Browser-Chrome, Component-WebDriver, Priority-Medium
@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Apr 15, 2015

Contributor
Fixed. Will be in next version.

Original comment by z...@chromium.org on 23 May 2012 at 5:49

  • Changed state: Resolved
Contributor

GoogleCodeExporter commented Apr 15, 2015

Fixed. Will be in next version.

Original comment by z...@chromium.org on 23 May 2012 at 5:49

  • Changed state: Resolved
@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Apr 15, 2015

Contributor
Hello people the problem still persists in Ubuntu and Windows 7 I tested with 
the latest version ..
chromedriver_win_20.0.1133.0.zip and chromedriver_linux32_20.0.1133.0.zip

Original comment by bdmsty...@gmail.com on 29 May 2012 at 4:10

Contributor

GoogleCodeExporter commented Apr 15, 2015

Hello people the problem still persists in Ubuntu and Windows 7 I tested with 
the latest version ..
chromedriver_win_20.0.1133.0.zip and chromedriver_linux32_20.0.1133.0.zip

Original comment by bdmsty...@gmail.com on 29 May 2012 at 4:10

@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Apr 15, 2015

Contributor
It has been fixed but didn't make it into the 1133 release.

Original comment by kkania@chromium.org on 29 May 2012 at 5:49

Contributor

GoogleCodeExporter commented Apr 15, 2015

It has been fixed but didn't make it into the 1133 release.

Original comment by kkania@chromium.org on 29 May 2012 at 5:49

@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Apr 15, 2015

Contributor

the two files 
chromedriver_linux32_21.0.1180.4.zip 

chromedriver_linux32_20.0.1133.0.zip

looks like that contains the same file because the version that apperar on log 
version=18.0.1022.0 is the same.

and the bug still... and the feature "Change logging preferences ‘loglevel’ 
to accept string instead of integer" don't works.

Original comment by bdmsty...@gmail.com on 6 Jul 2012 at 7:44

Contributor

GoogleCodeExporter commented Apr 15, 2015


the two files 
chromedriver_linux32_21.0.1180.4.zip 

chromedriver_linux32_20.0.1133.0.zip

looks like that contains the same file because the version that apperar on log 
version=18.0.1022.0 is the same.

and the bug still... and the feature "Change logging preferences ‘loglevel’ 
to accept string instead of integer" don't works.

Original comment by bdmsty...@gmail.com on 6 Jul 2012 at 7:44

@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Apr 15, 2015

Contributor
Zori, can you check this?

Original comment by kkania@chromium.org on 11 Jul 2012 at 1:01

Contributor

GoogleCodeExporter commented Apr 15, 2015

Zori, can you check this?

Original comment by kkania@chromium.org on 11 Jul 2012 at 1:01

@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Apr 15, 2015

Contributor
I try again using this code.

          LoggingPreferences logs = new LoggingPreferences();
          logs.enable(LogType.DRIVER, Level.INFO);
          DesiredCapabilities capabilities =DesiredCapabilities.chrome();
          capabilities.setCapability(CapabilityType.LOGGING_PREFS, logs);
          driver = new RemoteWebDriver(service.getUrl(),capabilities);

This time works but incorrect

I set the log level "INFO" and still stay em "Debug level"

follows the log attached.

Original comment by bdmsty...@gmail.com on 16 Jul 2012 at 6:17

Attachments:

Contributor

GoogleCodeExporter commented Apr 15, 2015

I try again using this code.

          LoggingPreferences logs = new LoggingPreferences();
          logs.enable(LogType.DRIVER, Level.INFO);
          DesiredCapabilities capabilities =DesiredCapabilities.chrome();
          capabilities.setCapability(CapabilityType.LOGGING_PREFS, logs);
          driver = new RemoteWebDriver(service.getUrl(),capabilities);

This time works but incorrect

I set the log level "INFO" and still stay em "Debug level"

follows the log attached.

Original comment by bdmsty...@gmail.com on 16 Jul 2012 at 6:17

Attachments:

@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Apr 15, 2015

Contributor
Hi,
The log that you attached is not the actual chromedriver log. On line 8 of the 
logfile you attached is the path to the chromedriver.log. This is the one that 
the logging preference refers to. If you open the chromedriver log, there 
should be logs with level INFO and above. "DEBUG" is not a valid log level (see 
http://code.google.com/p/selenium/wiki/DesiredCapabilities#JSON_object).

Original comment by z...@chromium.org on 16 Jul 2012 at 8:03

Contributor

GoogleCodeExporter commented Apr 15, 2015

Hi,
The log that you attached is not the actual chromedriver log. On line 8 of the 
logfile you attached is the path to the chromedriver.log. This is the one that 
the logging preference refers to. If you open the chromedriver log, there 
should be logs with level INFO and above. "DEBUG" is not a valid log level (see 
http://code.google.com/p/selenium/wiki/DesiredCapabilities#JSON_object).

Original comment by z...@chromium.org on 16 Jul 2012 at 8:03

@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Apr 15, 2015

Contributor
ok thanks.

Original comment by bdmsty...@gmail.com on 16 Jul 2012 at 8:09

Contributor

GoogleCodeExporter commented Apr 15, 2015

ok thanks.

Original comment by bdmsty...@gmail.com on 16 Jul 2012 at 8:09

@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Apr 15, 2015

Contributor

Original comment by kkania@chromium.org on 13 Mar 2013 at 11:45

  • Changed state: Closed
Contributor

GoogleCodeExporter commented Apr 15, 2015

Original comment by kkania@chromium.org on 13 Mar 2013 at 11:45

  • Changed state: Closed
@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Apr 15, 2015

Contributor

Original comment by samu...@chromium.org on 21 Feb 2015 at 12:27

  • Changed state: Fixed
Contributor

GoogleCodeExporter commented Apr 15, 2015

Original comment by samu...@chromium.org on 21 Feb 2015 at 12:27

  • Changed state: Fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment