2

I am trying to find how to start Chrome as if it was started by webdriver, but manually from command line.

I was looking at this list of options, but couldn't find what I need. https://peter.sh/experiments/chromium-command-line-switches/

Note: I tried the --enable-automation, but it only displays the chrome is being automated... message. It still opens Chrome from my current profile in a new window.

2
  • what you mean by as if by webdriver , what is your criteria to confirm it is started by webdriver ?
    – PDHide
    Jun 10 at 16:17
  • 2
    The same way that would new ChromeDriver() start the browser. With the same options. Aelxey's answer was what I needed
    – CuriousGuy
    Jun 10 at 16:19
2

Before you're doing new ChromeDriver() in your code, add these lines:

System.setProperty("webdriver.chrome.logfile", "D:\\chromedriver.log");
System.setProperty("webdriver.chrome.verboseLogging", "true");

with your custom path to log file. Then open that file and find the line like:

[INFO]: Launching chrome: ...

There you will find the complete command line how driver starts your browser.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.