Example usage for org.openqa.selenium.html5 LocalStorage getItem

List of usage examples for org.openqa.selenium.html5 LocalStorage getItem

Introduction

In this page you can find the example usage for org.openqa.selenium.html5 LocalStorage getItem.

Prototype

String getItem(String key);

Source Link

Usage

From source file:org.suren.autotest.web.framework.settings.AutoModuleProxy.java

License:Apache License

private void saveLocalStorage(String account) {
    WebDriver driver = util.getEngine().getDriver();
    if (driver instanceof WebStorage) {
        WebStorage webStorage = (WebStorage) driver;
        LocalStorage localStorage = webStorage.getLocalStorage();

        Properties pro = new Properties();
        for (String key : localStorage.keySet()) {
            pro.setProperty(key, localStorage.getItem(key));
        }//from  w w  w . j av  a2 s .  c o m

        PathUtil.proStore(pro, "localStorage." + account);
    }
}