I’m attempting to return all logs from Chrome when I’m running a test case, that way we can debug if our test cases fail. I’ve implemented this by creating a devConsoleLogReader custom keyword with readLogs method. When I call the keyword in a test case, I’m only seeing WARNING and SEVERE type logs. Here’s a snippet of my code:
public class devConsoleLogReader {
@Keyword
public void readLogs() {
//printing JavaScript Console Log
File file = new File("/some/file/path")
WebDriver driver = DriverFactory.getWebDriver()
LogEntries logs = driver.manage().logs().get("browser")
for (LogEntry entry : logs) {
file.append(">>> " + new Date(entry.getTimestamp()) + " " + entry.getLevel() + " " + entry.getMessage() + "\n")
}
}
}
I also configured my Katalon project desired capabilities to have loggingPrefs setup for Chrome:
I’ve tried updating the value for browser to ALL, INFO, DEBUG, etc., but there is no change in behavior - consistently stuck on getting only SEVERE and WARNING.
I’ve consumed most of the resources and forum posts I’ve found about this subject, but cannot find an answer. Please advise on how to move forward