Selenium WebDriver中的隐式等待和显式等待之间有什么区别? [英] What is difference between Implicit wait and Explicit wait in Selenium WebDriver?

查看:735
本文介绍了Selenium WebDriver中的隐式等待和显式等待之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Selenium WebDriver中有隐式和显式等待.它们之间有什么区别?

There are Implicit and Explicit wait in Selenium WebDriver. What's the difference between them?

请分享有关Selenium WebDriver的知识.请使用隐式&显示实时示例.明确等待.

Kindly share the knowledge about Selenium WebDriver. Please show the real time example with Implicit & Explicit wait.

推荐答案

检查以下链接:

  • Implicit Wait -指示Web驱动程序等待在一段时间内通过轮询DOM.声明隐式等待后,它将在Web驱动程序实例的整个生命周期中都可用.默认情况下,该值为0.如果设置更长的默认值,则该行为将根据浏览器/驱动程序的实现定期轮询DOM.

  • Implicit Wait - It instructs the web driver to wait for some time by poll the DOM. Once you declared implicit wait it will be available for the entire life of web driver instance. By default the value will be 0. If you set a longer default, then the behavior will poll the DOM on a periodic basis depending on the browser/driver implementation.

Explicit Wait +

Explicit Wait + ExpectedConditions - It is the custom one. It will be used if we want the execution to wait for some time until some condition achieved.

这篇关于Selenium WebDriver中的隐式等待和显式等待之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆