How to enable chrome_debug.log at verbose level-4 using Web Driver?

1,658 views
Skip to first unread message

rajendraprasad reddy

unread,
Aug 27, 2014, 3:10:35 AM8/27/14
to webd...@googlegroups.com
Hi All,
I am using:
     Web Driver java bindings of version  2.42.2
     On Windows & 32 bit Laptop
     Java version "1.7.0_45"
   I need to capture browser web socket messages  and to achieve that i need to enable browser console log to verbose level-4(this switch will do that--enable-logging --v=4)
When i Start chrome manually from command prompt With command :

My application need to automate on Chrome browser  and I am using  Latest Chrome :36.0.1985.143 m
As i need to launch browser on remote machine i am using RemoteWebDriver instead of WebDriver: start chrome --enable-logging --v=4, chrome is writing log at verbose level -4 and i am able to see all the web socket communication messages .(we see this log at path : C:\Users\Administrator\AppData\Local\Google\Chrome\User Data\chrome_debug.log)
If try to achieve same thing with web driver, Chrome is only logging very minimal mode and not logging all the console log messages.

I want to enable full console log ,what changes i need to do  my script to achieve that ?

Anybody can help me on this?  

Here is providing my Code Snippet:

        DesiredCapabilities caps = DesiredCapabilities.chrome();
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--start-maximized");
        options.addArguments("--test-type");
        options.addArguments("--enable-logging --v=4");
        caps.setCapability(ChromeOptions.CAPABILITY, options);
        driver=    new RemoteWebDriver(new URL("http://" + 127.0.0.1+ ":4444/wd/hub"), caps);
         .........
Thanks in Advance,
Rajendra Prasad

rajendraprasad reddy

unread,
Aug 28, 2014, 4:50:35 AM8/28/14
to webd...@googlegroups.com

After doing some research I found the following reason for this behavior:

When i check the Chrome profile using URL:"chrome://version/", Chrome automatically adding other extensions and it's extension's  default command line option (--logging-level=1) and this is creating overloading effect, and it is again changing back the log level to leve1=1 and so "chrome_debug" contains only "verbose level-1" log entries.

Anybody help me in this?

Thanks,
Rajendra Prasad Reddy

Abhi

unread,
Aug 28, 2014, 5:19:08 AM8/28/14
to webd...@googlegroups.com
- If you are using TestNG to run the suite so in TestNG suite you can use verbose="4" at suite level, it will give you details of the test on console.

Regards,
Abhi
Reply all
Reply to author
Forward
0 new messages