本文整理了Java中org.openqa.selenium.Cookie.validate()
方法的一些代码示例,展示了Cookie.validate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Cookie.validate()
方法的具体详情如下:
包路径:org.openqa.selenium.Cookie
类名称:Cookie
方法名:validate
暂无
代码示例来源:origin: org.openqa.selenium.webdriver/webdriver-common
public Cookie(String name, String value, String domain, String path, Date expiry) {
this.name = name;
this.value = value;
this.path = path == null || "".equals(path) ? "/" : path;
this.domain = domain;
if (expiry != null) {
//igonre the milliseconds because firefox only keeps the seconds
this.expiry = new Date(expiry.getTime() / 1000 * 1000);
} else {
this.expiry = null;
}
validate();
}
代码示例来源:origin: com.github.becauseQA/becauseQA-utils
public void addCookie(Cookie cookie) {
cookie.validate();
execute(DriverCommand.ADD_COOKIE, ImmutableMap.of("cookie", cookie));
}
代码示例来源:origin: com.github.becausetesting/commons
public void addCookie(Cookie cookie) {
cookie.validate();
execute(DriverCommand.ADD_COOKIE, ImmutableMap.of("cookie", cookie));
}
代码示例来源:origin: out0fmemory/GuozhongCrawler
public void addCookie(Cookie cookie) {
cookie.validate();
execute(DriverCommand.ADD_COOKIE, ImmutableMap.of("cookie", cookie));
}
代码示例来源:origin: org.openqa.selenium.webdriver/webdriver-common
@Override
protected void validate() {
super.validate();
String domain = getDomain();
if (domain != null && !"".equals(domain)) {
try {
String domainToUse = domain.startsWith("http") ? domain : "http://" + domain;
URL url = new URL(domainToUse);
InetAddress.getByName(url.getHost());
} catch (MalformedURLException e) {
throw new IllegalArgumentException(String.format("URL not valid: %s", domain));
} catch (UnknownHostException e) {
throw new IllegalArgumentException(String.format("Domain does not exist: %s", domain));
}
}
}
内容来源于网络,如有侵权,请联系作者删除!