Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Add ability to create chromedriver.log #2402

Closed
zachlysobey opened this issue Aug 5, 2015 · 4 comments · Fixed by #3068
Closed

Add ability to create chromedriver.log #2402

zachlysobey opened this issue Aug 5, 2015 · 4 comments · Fixed by #3068
Assignees
Milestone

Comments

@zachlysobey
Copy link

I have seen that chromedriver can output a logfile (https://sites.google.com/a/chromium.org/chromedriver/logging)

This page shows how to set this up when executing the exe directly: chromedriver.exe --verbose --log-path=chromedriver.log

There is no apparent way to set these arguments from protractor however.

See this StackOverflow question for more info:

http://stackoverflow.com/questions/31662828/how-to-access-chromedriver-logs-for-protractor-test/31662935

@jonrimmer
Copy link

👍

@martin770
Copy link
Contributor

I just figured it out, and responded to the Stack Overflow post. Feel free to test it and update the protractor documentation. The only issue I have is that the chromedriver.log is overwritten with every browser that opens (instead of appending the file or creating a new file for each browser session), so it may not be helpful when running a suite of tests or with sharding turned on.

If you're using the seleniumServerJar, in protractor.conf.js set the logfile path to wherever you want it to write the file:

 seleniumArgs: [
        '-Dwebdriver.chrome.logfile=/home/myUsername/tmp/chromedriver.log',
]

If you're using webdriver-manager start to run a local selenium server, you'll need to edit the webdriver-manager file:

// insert this line
args.push('-Dwebdriver.chrome.logfile=/home/myUsername/tmp/chromedriver.log');

// this line already exists in webdriver-manager, add the push to args before this line
var seleniumProcess = spawnCommand('java', args);

@cnishina cnishina self-assigned this Mar 24, 2016
cnishina added a commit to cnishina/protractor that referenced this issue May 13, 2016
cnishina added a commit to cnishina/protractor that referenced this issue May 13, 2016
cnishina added a commit to cnishina/protractor that referenced this issue May 14, 2016
cnishina added a commit to cnishina/protractor that referenced this issue May 16, 2016
cnishina added a commit to cnishina/protractor that referenced this issue May 16, 2016
cnishina added a commit to cnishina/protractor that referenced this issue May 16, 2016
cnishina added a commit to cnishina/protractor that referenced this issue May 16, 2016
cnishina added a commit that referenced this issue Jun 8, 2016
#3068)

closes #607, #2402

* Removed the config.json. This will be managed now by webdriver-manager.
* Wedriver-manager downloads the file to the node_modules/webdriver-manager/selenium folder. This will no longer appear in the protractor directory.
@cnishina
Copy link
Contributor

cnishina commented Jun 8, 2016

  • webdriver-manager has chromedriver.log this option
  • protractor now uses webdriver-manager as a node module

@attila123
Copy link

Just a minor clarification (it may help someone who is searching for this topic):
webdriver manager has the chrome_logs option (you can find it in its source code (in opts.ts or opts.js in the compiled code)), so you can use it something like:
webdriver-manager start --chrome_logs /path/to/logfile.txt

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants