使用selenium和phantom js时,我无法移除显示initialisation logs
以下是我用于无头测试的代码
DesiredCapabilities dcap = new DesiredCapabilities();
String[] phantomArgs = new String[] { "--webdriver-loglevel=NONE" };
dcap.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS, phantomArgs);
PhantomJSDriver driver = new PhantomJSDriver(dcap);