How to set verbosity of marionette driver?

前端 未结 1 1376
旧时难觅i
旧时难觅i 2021-01-23 17:33

Unable to manage verbosity of marionette driver!!

Environment:

Gecko driver 0.17.0
Selenium java 3.5.3
Firefox 52.3

Tried:



        
相关标签:
1条回答
  • 2021-01-23 18:05

    The default log level for geckodriver on release builds of Mozilla Firefox is set to INFO level. Perhaps your framework or the language binding you are using (Java) is overriding the default settings.

    We can set the log level at either of the following levels:

    • All
    • CONFIG
    • FINE
    • FINER
    • FINEST
    • INFO
    • OFF
    • SEVERE
    • WARNING

    Here is the code block to set log level to OFF:

    package demo;
    
    import java.util.logging.Level;
    
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.firefox.FirefoxDriver;
    import org.openqa.selenium.firefox.FirefoxOptions;
    
    public class Gecko_TRACE_LOGS 
    {
        public static void main(String[] args) 
        {
            System.setProperty("webdriver.gecko.driver", "C:\\Utility\\BrowserDrivers\\geckodriver.exe");
            FirefoxOptions options = new FirefoxOptions();
            options.setLogLevel(Level.OFF);
            WebDriver driver =  new FirefoxDriver(options);
            driver.get("https://stackoverflow.com");
            System.out.println("Application opened");
            System.out.println("Page Title is : "+driver.getTitle());
            driver.quit();
        }
    }
    
    0 讨论(0)
提交回复
热议问题