In a Web Driver Automation Script, How to Start Chrome Browser with Specific Command line Switches?

53 views
Skip to first unread message

rajendraprasad reddy

unread,
Aug 28, 2014, 7:14:27 AM8/28/14
to webd...@googlegroups.com

 

Hi All,
Anybody help me how to start Chrome Browser with Specific Command line Switches?

If i start manually chrome, starting with following Command Line options:
Command Line"C:\Program Files\Google\Chrome\Application\chrome.exe" --flag-switches-begin --flag-switches-end

If i start chrome with Web driver automation  script, starting with following Command Line options:

"C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-background-networking --disable-client-side-phishing-detection --disable-component-update --disable-default-apps --disable-hang-monitor --disable-prompt-on-repost --disable-sync --disable-web-resources --enable-logging --enable-logging --v=4 --full-memory-crash-report --ignore-certificate-errors --load-extension="C:\Users\ADMINI~1\AppData\Local\Temp\scoped_dir6680_6230\internal" --logging-level=1 --metrics-recording-only --no-first-run --password-store=basic --remote-debugging-port=12959 --safebrowsing-disable-auto-update --safebrowsing-disable-download-protection --start-maximized --test-type --use-fake-ui-for-media-stream --use-mock-keychain --user-data-dir="C:\Users\Administrator\AppData\Local\Google\Chrome\New User\\" --flag-switches-begin --flag-switches-end

In automation script i am supplying only following Command line options:

        String userProfile= "C:\\Users\\Administrator\\AppData\\Local\\Google\\Chrome\\New User\\";
        ChromeOptions options = new ChromeOptions();
        options.addArguments("user-data-dir="+userProfile);
        options.addArguments("--start-maximized");
        options.addArguments("--use-fake-ui-for-media-stream");
        options.addArguments("--test-type");
        options.addArguments("--enable-logging --v=4");

I am not able to understand from where the following additional command line options are adding to chrome?

--load-extension="C:\Users\ADMINI~1\AppData\Local\Temp\scoped_dir6680_6230\internal" --logging-level=1 --metrics-recording-only --no-first-run --password-store=basic --remote-debugging-port=12959 --safebrowsing-disable-auto-update --safebrowsing-disable-download-protection --start-maximized --test-type --use-fake-ui-for-media-stream --use-mock-keychain --user-data-dir="C:\Users\Administrator\AppData\Local\Google\Chrome\New User\\" --flag-switches-begin --flag-switches-end

Because of this additional options log level resetting to verbose level-1 and i am not able to see all the logs.

Anybody can help me in this?

Thanks in advance.
Rajendra Prasad Reddy



Reply all
Reply to author
Forward
0 new messages