Java 类org.openqa.selenium.html5.SessionStorage 实例源码

项目:phoenix.webui.framework    文件:AutoModuleProxy.java   
/**
 * 保存sessionStorage信息
 * @param account
 */
private void saveSessionStorage(String account)
{
    WebDriver driver = util.getEngine().getDriver();
    if(driver instanceof WebStorage)
    {
        WebStorage webStorage = (WebStorage) driver;
        SessionStorage sessionStorage = webStorage.getSessionStorage();

        Properties pro = new Properties();
        for(String key : sessionStorage.keySet())
        {
            pro.setProperty(key, sessionStorage.getItem(key));
        }

        PathUtil.proStore(pro, "sessionStorage." + account);
    }
}
项目:phoenix.webui.framework    文件:AutoModuleProxy.java   
/**
 * 加载sessionStorage信息
 * @param accountNameValue
 * @return
 */
private boolean loadSessionStorage(String accountNameValue, Map<String, String> customMap)
{
    WebDriver webDriver = util.getEngine().getDriver();
    if(webDriver instanceof WebStorage)
    {
        WebStorage webStorage = (WebStorage) webDriver;
        SessionStorage sessionStorage = webStorage.getSessionStorage();

        Properties pro = new Properties();
        if(PathUtil.proLoad(pro, "sessionStorage." + accountNameValue))
        {
            if(pro.isEmpty())
            {
                return false;
            }

            pro.putAll(customMap);

            pro.stringPropertyNames().parallelStream().forEach((key) -> {
                sessionStorage.setItem(key, pro.getProperty(key));
            });

            return true;
        }
    }

    return false;
}
项目:Java-Testing-Toolbox    文件:JSWebStorage.java   
@Override
public SessionStorage getSessionStorage() {
    return new JSSessionStorage(this.getDriverContext());
}
项目:domui    文件:MyChromeDriver.java   
@Override
public SessionStorage getSessionStorage() {
    return this.webStorage.getSessionStorage();
}