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

问题描述

点击带有FirefoxDriver的Selenium 2.0b3 Java API的按钮时出现问题。单击该按钮会将表单发送到Web服务器,然后浏览器会在表单提交后转到新页面。

I have an issue when clicking on a button with Selenium 2.0b3 Java API with FirefoxDriver. Clicking on the button sends a form to the webserver and then browser goes to a new page as a result of the form submission.

单击element.click中的元素时(),selenium正在等待浏览器完成其操作。浏览器等待页面加载完成。但是,由于某些广告请求,有时页面加载会花费大量时间。

When clicking on an element with element.click(), selenium is waiting for the browser to complete its operations. The browser waits until the page load is finished. But, sometimes the page load takes an enormous amount of time due to some advertisement requests.

如何解决和页面加载?

编辑:

如:

谢谢

推荐答案

尝试仅针对firefoxdriver wiki页面最后一节中列出的Firefox的测试版功能

Try the beta feature only for Firefox listed in the last section of the firefoxdriver wiki page http://code.google.com/p/selenium/wiki/FirefoxDriver

您至少需要2.9版本,我建议使用最新版本2.18(2.0b3现已快一年了!)

You will need at least version 2.9, I recommend going with the latest 2.18 (2.0b3 is nearly a year old now!)

这篇关于Selenium 2:中断页面加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 04:49