gpt4 book ai didi

java - 在 Marionette 驱动程序中禁用日志跟踪

转载 作者:搜寻专家 更新时间:2023-11-01 03:18:50 27 4
gpt4 key购买 nike

MarionetteDriver 启动时,它会为每个操作打印日志语句。就像

1465882610065   Marionette  TRACE   conn0 -> [0,138,"executeScript",{"args":[],"newSandbox":false,"script":"return Math.max(document.body.scrollHeight, document.documentElement.scrollHeight,document.body.offsetHeight, document.documentElement.offsetHeight,document.body.clientHeight, document.documentElement.clientHeight);","scriptTimeout":null,"specialPowers":false}]
1465882610066 Marionette TRACE conn0 <- [1,138,null,{"value":895}]
1465882610070 Marionette TRACE conn0 -> [0,139,"executeScript",{"args":[],"newSandbox":false,"script":"window.devicePixelRatio = window.devicePixelRatio || window.screen.deviceXDPI / window.screen.logicalXDPI; var pr = window.devicePixelRatio; if (pr != undefined && pr != null) return pr; else return 1.0;","scriptTimeout":null,"specialPowers":false}]
1465882610071 Marionette TRACE conn0 <- [1,139,null,{"value":1}]
1465882610319 Marionette TRACE conn0 -> [0,140,"findElements",{"using":"css selector","value":".logOut"}]
1465882610321 Marionette TRACE conn0 <- [1,140,null,[{"element-6066-11e4-a52e-4f735466cecf":"f9d9adc3-58df-446a-953d-eb793ac27025","ELEMENT":"f9d9adc3-58df-446a-953d-eb793ac27025"}]]
1465882610325 Marionette TRACE conn0 -> [0,141,"isElementDisplayed",{"id":"f9d9adc3-58df-446a-953d-eb793ac27025"}]
1465882610335 Marionette TRACE conn0 <- [1,141,null,{"value":true}]
1465882610338 Marionette TRACE conn0 -> [0,142,"isElementEnabled",{"id":"f9d9adc3-58df-446a-953d-eb793ac27025"}]
1465882610340 Marionette TRACE conn0 <- [1,142,null,{"value":true}]
1465882610343 Marionette TRACE conn0 -> [0,143,"clickElement",{"id":"f9d9adc3-58df-446a-953d-eb793ac27025"}]
1465882610372 Marionette TRACE conn0 <- [1,143,null,{}]
1465882610398 Marionette TRACE conn0 -> [0,144,"quitApplication",{"flags":["eForceQuit"]}]
1465882610399 Marionette TRACE conn0 <- [1,144,null,{}]
1465882610404 addons.xpi DEBUG Calling bootstrap method shutdown on @spritzfirefox version 4.1.5b
1465882610415 addons.xpi DEBUG Calling bootstrap method shutdown on e10srollout@mozilla.org version 1.0
1465882610416 addons.xpi DEBUG Calling bootstrap method shutdown on firefox@getpocket.com version 1.0.2
1465882610416 addons.xpi DEBUG Calling bootstrap method shutdown on loop@mozilla.org version 1.3.2

我正在通过

启动 MarionetteDriver
System.setProperty("webdriver.gecko.driver", "geckodriver.exe");
WebDriver driver = new MarionetteDriver();

是否有任何禁用日志的功能

最佳答案

您可以使用以下代码行不显示木偶日志:

System.setProperty("webdriver.gecko.driver","src/main/resources/drivers/geckodriver.exe"); 
System.setProperty(FirefoxDriver.SystemProperty.DRIVER_USE_MARIONETTE,"true");
System.setProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE,"/dev/null");
return new FirefoxDriver();

关于java - 在 Marionette 驱动程序中禁用日志跟踪,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37803781/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com