List of usage examples for org.openqa.selenium.html5 SessionStorage setItem
void setItem(String key, String value);
From source file:org.suren.autotest.web.framework.settings.AutoModuleProxy.java
License:Apache License
/** * sessionStorage?//w ww . ja va 2 s . c o m * @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; }