How can I get chrome local db cookies by selenium in java?
I use following code to wait the document will be ready but local db cookies is empty
webDriverWait.until(webDriver ->
"complete".equals((JavascriptExecutor) webDriver.executeScript("return document.readyState")))
driver.get(url);
connection = DriverManager.getConnection("jdbc:sqlite:" + chromeCookieDirectory);
Statement statement = connection.createStatement();
ResultSet result = statement.executeQuery("select * from cookies");
If I add Tread.sleep and wait enough of time after driver.get(url) I got a lot of cookies.
What is the best way to do it?