I need to open the Preferences page in Firefox using WebDriver, in order to clear the cache in a browser-specific way.
While investigating the issue, I found a Python solution and tried to translate it in Java, but WebDriver misinterpretes the uri:
driver.get("about:preferences#privacy");
and sends "/about:preferences#privacy" instead which Firefox doesn't know how to open.
I also tried a JavaScript way:
driver.executeScript("window.location.replace('about:preferences#privacy');")
driver.executeScript("window.open('about:preferences#privacy');")
but these are just ignored by the browser.
I assume there MUST be a Java way because this had already been implemented with Python WebDriver (see the first link).
Update: this turned out to be a non-WebDriver issue. In fact this originates in the testing framework that we're using and which is built around Selenium - Quantum Perfecto. The described behavior doesn't happen in pure Selenium. I sent a request to the framework support team to solve the issue in their code.