我们的团队正在使用docker部署selenium网格.默认日志级别似乎设置为INFO.我想将它设置为更高,严重或完全关闭它们.我做了三次尝试,但到目前为止,没有任何效果.
方法一:
从selenium客户端,我试图在DesiredCapabilities中的RemoteWebDriver上设置LoggingPreferences:
DesiredCapabilities desiredCapabilities = DesiredCapabilities.firefox();
LoggingPreferences logs = new LoggingPreferences();
logs.enable(LogType.BROWSER,Level.SEVERE);
logs.enable(LogType.CLIENT,Level.SEVERE);
ogs.enable(LogType.DRIVER,Level.SEVERE);
logs.enable(LogType.SERVER,Level.SEVERE);
desiredCapabilities.setCapability(CapabilityType.LOGGING_PREFS,logs);
desiredCapabilities.setCapability(FirefoxDriver.PROFILE,profile);
WebDriver driver = new RemoteWebDriver(new URL(host:4444/wd/hub"),desiredCapabilities);
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("webdriver.log.driver","OFF");
profile.setPreference("webdriver.log.file","/dev/null");
方法3:我尝试修改位于/opt/selenium/config.json的容器中的config.json:
{
"capabilities": [
{
"browserName": "*firefox","maxInstances": 1,"seleniumProtocol": "Selenium"
},{
"browserName": "firefox","seleniumProtocol": "WebDriver"
}
],"configuration": {
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy","maxSession": 1,"port": 5555,"register": true,"registerCycle": 5000,"logLevel":FATAL
}
}
到目前为止,我一直无法做任何改变日志记录行为的事情.
最佳答案
原文链接:https://www.f2er.com/docker/435746.html