I have to enable verbose logging in Chrome / ChromeDriver to see why my geb tests are failing. Does anybody know how I can do that. Heres my GebConfig:
String chromeDriverDownloadFullPath = "https://chromedriver.storage.googleapis.com/${chromeDriverVersion}/${chromeDriverZipFileName}"
File chromeDriverLocalFile = downloadDriver(
currentPlatformName,
chromeDriverDownloadFullPath,
chromeDriverExecFileName,
'zip',
"chrome",
chromeDriverVersion)
System.setProperty('webdriver.chrome.driver', chromeDriverLocalFile.absolutePath)
Locale locale = getLocale()
ChromeOptions options = new ChromeOptions();
options.addArguments("--lang=" + locale.country);
options.addArguments("--headless");
options.addArguments("--disable-gpu");
options.addArguments("--no-sandbox");
options.addArguments("--user-data-dir=/data");
DesiredCapabilities jsCapabilities = DesiredCapabilities.chrome()
Map<String, Object> prefs = new HashMap<>()
prefs.put("intl.accept_languages", locale.toLanguageTag())
options.setExperimentalOption("prefs", prefs)
jsCapabilities.setCapability(ChromeOptions.CAPABILITY, options)
ChromeDriver chromeDriver = new ChromeDriver(options)
chromeDriver.manage().window().setSize(getDimension())
return chromeDriver
To obtain verbose logs from ChromeDriver we can configure the logfile and the type_of_logging as follows:
System.setProperty("webdriver.chrome.driver", "C:\\Utility\\BrowserDrivers\\chromedriver.exe");
System.setProperty("webdriver.chrome.logfile", "C:\\Utility\\BrowserDrivers\\chromedriver.log");
System.setProperty("webdriver.chrome.verboseLogging", "true");
I can see from your code you have provided :
System.setProperty('webdriver.chrome.driver', chromeDriverLocalFile.absolutePath)
In a similar fashion try to provide :
System.setProperty('webdriver.chrome.logfile', chromeDriverLocalFile.absolutePath);
System.setProperty('webdriver.chrome.verboseLogging', boolean);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With