Selenium WebDriver 现在是否理解页面加载? [英] Selenium WebDriver does it understand page loads now?

查看:36
本文介绍了Selenium WebDriver 现在是否理解页面加载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用当前形式的 Selenium WebDriver 是否可以理解页面加载?

With the current form of Selenium WebDriver does it understand page loads now?

在我最近比较 WatiN 与 Selenium 与 X 的研究中,我所看到的支持 WatiN 的最大观点之一是它理解页面加载的概念,而至少在旧版本的 Selenium 上,您必须伪造这一点使用等待/线程睡眠等.

In my recent research comparing WatiN vs Selenium vs X one of the biggest points I've seen in favor of WatiN was that it understands the concept of a page is loaded, whereas atleast on older versions of Selenium you had to fake this using waits/thread sleeps etc.

这是否不再是对 Selenium 的有效否定?

Is this now no longer a valid negative against Selenium?

推荐答案

是的,Selenium WebDriver 中的许多函数只有在页面加载后才返回.换句话说,许多旧的 -action-andwait 函数刚刚变成了 -action-.

Yes, many of the functions in Selenium WebDriver return only after the page has loaded. In other words, many of the old -action-andwait functions have just become -action-.

查看文档 可以准确告诉您哪些功能阻塞,哪些不等待页面加载.例如,这里是 click 函数描述的片段:

Looking at the documentation can tell you exactly which functions block and which don't wait for the page to load. For example, here is a snippet of the click function description:

点击这个元素.如果这导致加载新页面,则此方法将阻塞,直到页面加载完毕.

Click this element. If this causes a new page to load, this method will block until the page has loaded.

这篇关于Selenium WebDriver 现在是否理解页面加载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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