selenium webdriver 等待元素
2024-09-04 19:05:42
/**显示等待并返回元素
* @param driver
* @param locator
*/
public static WebElement showWait(WebDriver driver, final String locator)
{
return new WebDriverWait(driver, 10).until(new ExpectedCondition<WebElement>() {
public WebElement apply(WebDriver d) {
return d.findElement(By.id(locator));
}
});
} /**隐式等待
* @param driver
*/
public static void implicitWait(WebDriver driver) {
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
}
最新文章
- A*算法的原理 <;转>;
- 【转】Tomcat 的三种(bio,nio.apr) 高级 Connector 运行模式
- SQL 语句-partition by
- python中的装饰器
- 大型网站系统架构实践(四)http层负载均衡之haproxy实践篇(一)
- python利用or在列表解析中调用多个函数.py
- R语言记录程序运行的时间
- JavaScript跨域解决办法
- 【转】 C语言自增自减运算符深入剖析
- OSGi-开发环境的建立和HelloWorld(04)
- C++中const几中用法
- WCF Restful调用跨域解决方案
- mysql 5.7~默认sql_mode解读
- Myeclipse加载php插件
- 【题解】Luogu P4054 [JSOI2009]计数问题
- JS中的HTML片段
- Mysql 5.7 windows安装 zip安装
- PAT 1074 宇宙无敌加法器
- Docker背景介绍
- todocmvc的安装