Trace log from geckodriver

887 views
Skip to first unread message

Andreas Tolfsen

unread,
Oct 11, 2017, 5:51:25 PM10/11/17
to selenium-...@googlegroups.com
Hello client maintainers, we need your help!

One of the biggest challenges we have addressing geckodriver bug
reports [1] is getting trace-level logs. Although instructions on
how to enable trace logs is well-explained in the README [2] we want
your help in filling out a howto for specific clients.

As I explain in the guide [3]:

> To help debug a problem with geckodriver or Firefox, the
> trace-level output is vital to understand what is going on. This
> is why we ask that trace logs are included when filing bugs gainst
> geckodriver. It is only under very special circumstances that a
> trace log is not needed, so you will normally find that our first
> action when triaging your issue will be to ask you to include one.
> Do yourself and us a favour and provide a trace-level log right
> away.

I want to ask all client maintainers to review the code examples in
this file and let me know if anything is missing or wrong. If the
client you maintain is not listed, I would very much appreciate if
you could provide me with an appropriate code example.

Thanks in advance!

[1] https://github.com/mozilla/geckodriver/issues
[2] https://searchfox.org/mozilla-central/source/testing/geckodriver/README.md
[3] https://searchfox.org/mozilla-central/source/testing/geckodriver/doc/TraceLogs.md

Lucas Tierney

unread,
Oct 11, 2017, 8:27:06 PM10/11/17
to Selenium Developers
Looks good for Python and Ruby. The only thing I might change for Ruby which might be better for users is to use the following (prior to driver instantiation) instead of setting DEBUG or the -d flag:

Selenium::WebDriver.logger.level = :debug

p0deje

unread,
Oct 12, 2017, 1:33:55 AM10/12/17
to selenium-...@googlegroups.com
For Ruby, all 3 variants are equivalent:

1. Selenium::WebDriver.logger.level = :debug.
2. Run with -d switch.
3. Run with DEBUG=1 environment variable.

Also, the examples are only correct for running Firefox locally, not on Server or Grid.

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/6a782d28-6570-4363-ad8d-ce0f72e9ae93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jim Evans

unread,
Oct 12, 2017, 3:23:07 AM10/12/17
to Selenium Developers
No .NET? Andreas, I really thought we’d been friends long enough for you to ask. :)

The C# syntax is similar to Java. To wit:

FirefoxOptions options = new FirefoxOptions();
options.LogLevel = FirefoxDriverLogLevel.Trace;
IWebDriver driver = new FirefoxDriver(options);

.NET, like Java, “helpfully propagates” the output to stdout.

Alexei Barantsev

unread,
Oct 12, 2017, 3:33:42 AM10/12/17
to Selenium Developers
Java binding provides two setLogLevel methods in FirefoxOptions class. It is recommented to use the one that accepts FirefoxDriverLogLevel, the other one is deprecated.

FirefoxOptions opts = new FirefoxOptions()
    .setLogLevel(FirefoxDriverLogLevel.TRACE);
WebDriver driver = new FirefoxDriver(opts);

Regards,
--
Alexei Barantsev

Andreas Tolfsen

unread,
Oct 12, 2017, 8:04:57 AM10/12/17
to selenium-...@googlegroups.com
Also sprach Lucas Tierney:

> Looks good for Python and Ruby. The only thing I might change
> for Ruby which might be better for users is to use the following
> (prior to driver instantiation) instead of setting DEBUG or the -d
> flag:
>
> Selenium::WebDriver.logger.level = :debug

Thanks for the tip! I’ve submitted a patch to update the Ruby
docs accordingly:

https://reviewboard.mozilla.org/r/188748/diff/2#index_header

Andreas Tolfsen

unread,
Oct 12, 2017, 8:08:45 AM10/12/17
to selenium-...@googlegroups.com
Also sprach Jim Evans:

> No .NET? Andreas, I really thought we’d been friends long enough
> for you to ask. :)

This was me asking (-: It is wonderful to send off an email before
you go to bed, then wake up and see your inbox filled up with
proper, useful feedback.

> The C# syntax is similar to Java. To wit:
>
> FirefoxOptions options = new FirefoxOptions();
> options.LogLevel = FirefoxDriverLogLevel.Trace;
> IWebDriver driver = new FirefoxDriver(options);
>
> .NET, like Java, “helpfully propagates” the output to stdout.

Thanks so much! I’ve submitted a patch to add a C# example:

https://reviewboard.mozilla.org/r/188750/diff/2#index_header

Am I using “C#” correctly or should also “.NET” be in there?
I’m a bit hazy on what the convention is.

Andreas Tolfsen

unread,
Oct 12, 2017, 8:09:24 AM10/12/17
to selenium-...@googlegroups.com
Also sprach Alexei Barantsev:

> Java binding provides two setLogLevel methods in FirefoxOptions
> class. It is recommented to use the one that accepts
> FirefoxDriverLogLevel, the other one is deprecated.
>
> FirefoxOptions opts = new FirefoxOptions()
> .setLogLevel(FirefoxDriverLogLevel.TRACE);
> WebDriver driver = new FirefoxDriver(opts);

Noted. I’ve submitted a patch for updating the Java example:

https://reviewboard.mozilla.org/r/188752/diff/2#index_header

Lucas Tierney

unread,
Oct 12, 2017, 8:53:34 AM10/12/17
to Selenium Developers
Andreas:

It looks like the change you submitted used :trace for the selenium logger, it needs to be :debug as the selenium logger does not have a :trace severity.

Selenium::WebDriver.logger.level = :debug

Jim Evans

unread,
Oct 12, 2017, 2:17:43 PM10/12/17
to Selenium Developers
Simply “C#” is correct as the language name. While .NET is the platform, and supports multiple languages (VB.NET, F#, etc.), but most .NET developers use C#, so that’s the most effective example language.

Andreas Tolfsen

unread,
Oct 13, 2017, 11:22:43 AM10/13/17
to selenium-...@googlegroups.com
Also sprach Lucas Tierney:

> It looks like the change you submitted used :trace for the
> selenium logger, it needs to be :debug as the selenium logger does
> not have a :trace severity.
>
>> Selenium::WebDriver.logger.level = :debug

Thanks for noticing this bug. I’ve submitted a follow-up:

https://reviewboard.mozilla.org/r/189142/diff/1#index_header

I hope I understand this correctly, that the Selenium logger should
receive a :debug symbol but the FirefoxOptions class should get
:trace?

Andreas Tolfsen

unread,
Oct 13, 2017, 11:23:25 AM10/13/17
to selenium-...@googlegroups.com
Also sprach Jim Evans:
Thanks for the clarification!
Reply all
Reply to author
Forward
0 new messages