I am attempting to retrieve JS/Console logs using Selenium's RemoteWebDriver (Java). I understand it is possible using "non-Remote" WebDriver using an approach such as discussed here: Capturing browser logs with Selenium WebDriver using Java
However, when using this with a RemoteWebDriver instance, I get an org.openqa.selenium.UnsupportedCommandException:
exception when executing the following line:
LogEntries logEntries = driver.manage().logs().get(LogType.BROWSER);
The config for the driver is:
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
LoggingPreferences logPrefs = new LoggingPreferences();
logPrefs.enable(LogType.BROWSER, Level.ALL);
desiredCapabilities.setCapability(CapabilityType.LOGGING_PREFS, logPrefs);
driver = new RemoteWebDriver(
new URL("xxx"), desiredCapabilities);
}
Is there anyway to get console logs with RemoteWebDriver or is this simply a limitation of the class?
Thanks.