隐含等待Vs有什么区别在selenium webdriver中显式等待? [英] What is difference between Implicit wait Vs. Explicit wait in selenium webdriver?

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

问题描述

请分享有关selenium webdriver的知识。请显示实时示例。

Kindly share the knowledge about selenium webdriver. Please show the real time example.

推荐答案

检查以下链接:


  • Implicit Wait - 它通过轮询DOM来指示Web驱动程序等待一段时间。一旦声明了隐式等待,它将在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.

明确等待 + ExpectedConditions - 这是自定义条件。如果我们希望执行等待一段时间直到达到某种条件,它将被使用。

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.

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

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