Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Retrieving Firefox browser console logs #2935

Unanswered
mwsessom asked this question in Q&A
Discussion options

I am trying to retrieve the browser console logs from Firefox. I'm able to do this with the Chrome container but have been unsuccessful using the Firefox container.

Firefox offers a couple preferences to redirect console logs to stdout devtools.console.stdout.content and devtools.console.stdout.chrome. However, I don't believe the Firefox container is capturing the stdout from Firefox.

Is there a way to capture stdout coming from the Firefox browser? Maybe there's a way to redirect the output to a file? The only output coming from the docker run ... cmd seems to be the Selenium log.

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

You can capture Firefox browser console logs by enabling the preferences below in your moz: firefoxOptions capabilities:
Json -
"moz:firefoxOptions": {
"prefs": {
"devtools.console.stdout.content": true,
"devtools.console.stdout.chrome": true
}
}

Then start Firefox with --jsconsole or --console flags.
If running inside Docker, you can map a log file path like:

Gitbash -
docker run ... > firefox_console.log 2>&1

Finally, use docker logs <container_id> to retrieve the console output. This approach works reliably for most recent Selenium-Firefox images.

You must be logged in to vote
1 reply
Comment options

Well, this works if you're just running Firefox by itself from the terminal. The output gets printed to stdout. However, this is not the issue I'm facing.

When Selenium launches Firefox, the output doesn't go to docker logs. The logs from docker logs only show output from the starting process which is java -jar selenium-server.jar... (https://github.com/SeleniumHQ/docker-selenium/blob/trunk/Standalone/start-selenium-standalone.sh#L217).

So how can I capture the stdout from a process in the Selenium-Firefox image that is not the starting/entrypoint process?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /