0

Summary: How do I extract Chromedriver logs when running Selenium standalone Chrome instance? I.e. interacting via Selenium API commonly on port 4444.

Details:

We are using Protractor to connect to a container running the Docker image selenium/standalone-chrome Selenium "grid". Connection info is specified via the HUB_PORT_4444_TCP_ADDR environment variable. The connection URL ends up being http://localhost:4444/wd/hub. This works fine and our tests are running successfully in Jenkins.

For completeness I'd like to extract the Chromedriver logs and attach them to the build in case we need more info for debugging test failues. How can that be done?

This question seemed like a close match but they are running Chromedriver directly. I need to ask Selenium to provide them somehow.

Friedrich 'Fred' Clausen
  • 3,321
  • 8
  • 39
  • 70

1 Answers1

1

Log properties of standalone chrome container can be configured using JAVA_OPTS. You can add JAVA_OPTS environment variable to standalone chrome container

  name: JAVA_OPTS
  value: "-Dwebdriver.chrome.logfile=<Path to log file, with file name>"

We had a shared volume mounted, and gave path to that folder for putting log file. Used yaml file for creating container template so used in above mentioned way. If you are using CLI to launch container, same can be passed through CLI too.

Muthukumaran
  • 126
  • 1
  • 4