尝试了以下代码,但是没有用。好像
bug在
selenium 3.0
LoggingPreferences pref = new LoggingPreferences(); pref.enable(LogType.BROWSER, Level.OFF); pref.enable(LogType.CLIENT, Level.OFF); pref.enable(LogType.DRIVER, Level.OFF); pref.enable(LogType.PERFORMANCE, Level.OFF); pref.enable(LogType.PROFILER, Level.OFF); pref.enable(LogType.SERVER, Level.OFF); DesiredCapabilities desiredCapabilities = DesiredCapabilities.firefox(); desiredCapabilities.setCapability(CapabilityType.LOGGING_PREFS, pref); WebDriver driver = new FirefoxDriver(desiredCapabilities); driver.get("https://www.google.com/"); driver.findElement(By.id("lst-ib")).sendKeys("something"); Thread.sleep(2000); driver.quit();
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)