• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java WebStorage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.openqa.selenium.html5.WebStorage的典型用法代码示例。如果您正苦于以下问题:Java WebStorage类的具体用法?Java WebStorage怎么用?Java WebStorage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



WebStorage类属于org.openqa.selenium.html5包,在下文中一共展示了WebStorage类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: saveSessionStorage

import org.openqa.selenium.html5.WebStorage; //导入依赖的package包/类
/**
 * 保存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);
    }
}
 
开发者ID:LinuxSuRen,项目名称:phoenix.webui.framework,代码行数:22,代码来源:AutoModuleProxy.java


示例2: saveLocalStorage

import org.openqa.selenium.html5.WebStorage; //导入依赖的package包/类
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));
        }

        PathUtil.proStore(pro, "localStorage." + account);
    }
}
 
开发者ID:LinuxSuRen,项目名称:phoenix.webui.framework,代码行数:18,代码来源:AutoModuleProxy.java


示例3: loadSessionStorage

import org.openqa.selenium.html5.WebStorage; //导入依赖的package包/类
/**
 * 加载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;
}
 
开发者ID:LinuxSuRen,项目名称:phoenix.webui.framework,代码行数:34,代码来源:AutoModuleProxy.java


示例4: loadLocalStorage

import org.openqa.selenium.html5.WebStorage; //导入依赖的package包/类
private boolean loadLocalStorage(String accountNameValue, Map<String, String> customMap)
{
    WebDriver webDriver = util.getEngine().getDriver();
    if(webDriver instanceof WebStorage)
    {
        WebStorage webStorage = (WebStorage) webDriver;
        LocalStorage localStorage = webStorage.getLocalStorage();

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

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

            return true;
        }
    }

    return false;
}
 
开发者ID:LinuxSuRen,项目名称:phoenix.webui.framework,代码行数:29,代码来源:AutoModuleProxy.java


示例5: getDescription

import org.openqa.selenium.html5.WebStorage; //导入依赖的package包/类
private DesiredCapabilities getDescription(WebDriver instance, Capabilities capabilities) {
  DesiredCapabilities caps = new DesiredCapabilities(capabilities.asMap());
  caps.setJavascriptEnabled(instance instanceof JavascriptExecutor);
  if (instance instanceof TakesScreenshot) {
    caps.setCapability(CapabilityType.TAKES_SCREENSHOT, true);
  }
  if (instance instanceof LocationContext) {
    caps.setCapability(CapabilityType.SUPPORTS_LOCATION_CONTEXT, true);
  }
  if (instance instanceof ApplicationCache) {
    caps.setCapability(CapabilityType.SUPPORTS_APPLICATION_CACHE, true);
  }
  if (instance instanceof NetworkConnection) {
    caps.setCapability(CapabilityType.SUPPORTS_NETWORK_CONNECTION, true);
  }
  if (instance instanceof WebStorage) {
    caps.setCapability(CapabilityType.SUPPORTS_WEB_STORAGE, true);
  }
  if (instance instanceof FindsByCssSelector) {
    caps.setCapability(CapabilityType.SUPPORTS_FINDING_BY_CSS, true);
  }
  if (instance instanceof Rotatable) {
    caps.setCapability(CapabilityType.ROTATABLE, true);
  }
  if (instance instanceof HasTouchScreen) {
    caps.setCapability(CapabilityType.HAS_TOUCHSCREEN, true);
  }
  return caps;
}
 
开发者ID:alexkogon,项目名称:grid-refactor-remote-server,代码行数:30,代码来源:DefaultSession.java


示例6: storage

import org.openqa.selenium.html5.WebStorage; //导入依赖的package包/类
public static WebStorage storage( WebDriver driver )
{
    return null;
}
 
开发者ID:hemano,项目名称:cucumber-framework-java,代码行数:5,代码来源:WebDriverUtils.java


示例7: getWebStorage

import org.openqa.selenium.html5.WebStorage; //导入依赖的package包/类
static WebStorage getWebStorage(WebDriver driver) {
  return convert(driver, WebStorage.class, CapabilityType.SUPPORTS_WEB_STORAGE,
      RemoteWebStorage.class);
}
 
开发者ID:alexkogon,项目名称:grid-refactor-remote-server,代码行数:5,代码来源:Utils.java



注:本文中的org.openqa.selenium.html5.WebStorage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ReflectionUtils类代码示例发布时间:2022-05-23
下一篇:
Java MoveYModifier类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap