Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log level for firefox/gecko capabilities in serenity.properties #935

Closed
mmanach opened this issue Sep 20, 2017 · 5 comments
Closed

Log level for firefox/gecko capabilities in serenity.properties #935

mmanach opened this issue Sep 20, 2017 · 5 comments

Comments

@mmanach
Copy link

mmanach commented Sep 20, 2017

Hello,

Currently, the default log level for geckodriver seems to be "DEBUG"

1505915407498	Marionette	INFO	Listening on port 52508
1505915408158	Marionette	WARN	TLS certificate errors will be ignored for this session
1505915408207	Marionette	DEBUG	loaded listener.js
sept. 20, 2017 3:50:08 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFOS: Detected dialect: W3C
1505915408341	Marionette	DEBUG	Received DOM event "beforeunload" for "about:blank"
1505915408777	Marionette	DEBUG	Received DOM event "pagehide" for "about:blank"
1505915408778	Marionette	DEBUG	Received DOM event "unload" for "about:blank"

I tried to modify geckodriver log level to TRACE in serenity.properties :

  • serenity.driver.capabilities = {"moz:firefoxOptions": {"log": {"level": "trace"}}};
  • firefox.preferences= --log trace //-vv

But none seems to work.

Is it the right way ?

@mmanach mmanach changed the title Log level for firefox/gecko capabilities Log level for firefox/gecko capabilities in serenity.properties Sep 20, 2017
@wakaleo
Copy link
Member

wakaleo commented Sep 20, 2017

Do you know if gecko supports these options?

@mmanach
Copy link
Author

mmanach commented Oct 20, 2017

Hi @wakaleo ,

Having to provide a geckodriver trace for this issue (mozilla/geckodriver#962 (comment)), I dipped back into this problem.

So for the serenity.properties, it seems that this format is correct :
https://searchfox.org/mozilla-central/source/testing/geckodriver/doc/TraceLogs.md

serenity.driver.capabilities={"capabilities": {"alwaysMatch": {"moz:firefoxOptions": {"log": {"level": "trace"}}}}}

For information, I tested the line below with FF 57 beta, and it works.

#serenity.driver.capabilities={"capabilities": {"alwaysMatch": {moz:webdriverClick":"true"}}}

But for the geckodriver trace, in the console I only get few information, and not all the traces.

I only succeeded to get all logs with this implementation : http://thucydides.info/docs/serenity-staging/#_custom_webdriver_implementations

public class MyFirefoxDriver implements DriverSource {

        @Override
        public WebDriver newDriver() {
            FirefoxOptions options = new FirefoxOptions();
            options.setLogLevel(Level.ALL);

            return new FirefoxDriver(options);
        }

    @Override
    public boolean takesScreenshots() {
        return false;
    }

}

@wakaleo
Copy link
Member

wakaleo commented Oct 20, 2017

Thanks for your research into this. If you need to set the log levels programmatically, a custom driver would be the best option for now. Longer term you could propose a PR for the FirefoxDriverCapabilities class to do this in a more configurable way.

@cvarshn-cloud
Copy link

cvarshn-cloud commented Oct 12, 2020

you can use options in serenity properties like below:

gecko.firefox.options={"args": ["-headless"], "log": {"level": "info"}, "prefs": {"dom.ipc.processCount": 8,"javascript.options.showInConsole": false,"javascript.options.strict":false,"nglayout.debug.disable_xul_cache":true}}

@wakaleo wakaleo closed this as completed Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants