Using watir-webdriver, how can I fire an event without waiting for the page to l
Question:
The code
for i in 0..10
$browser.link(:id => "send_link").fire_event("onclick")
puts "Click #" + i.to_s
end
only displays "Click #0" to the console before crashing with an unable to locate element error. I need it to click the link 10 times, even while the page is trying to load from the first click. Is there a way to do this using watir-webdriver, or will I have to use the win32api to hijack the mouse and do a hard click?
Edit: For the time being, I attempted to get around this by using the hardware click method that worked for a different issue I had using watir and IE8, but it doesn't seem to work with watir-webdriver and Firefox 4.
http://wiki.openqa.org/display/WTR/Right+Click+an+Element
Answer:
have you tried using .click_no_wait to see if that will work for you?
10.times do |i|
$browser.link(:id => "send_link").click_no_wait
puts "Click #" + i.to_s
end
发表评论
-
Get values from a select list using xpath [closed]
2012-04-04 16:50 0http://stackoverflow.com/que ... -
How do I build Watir tests for websites?
2012-04-04 16:14 0http://stackoverflow.com/que ... -
“TypeError: can't convert String into Integer” when trying to CTRL+click or SHIF
2012-04-04 15:33 0http://stackoverflow.com/que ... -
Using Watir, how can I select a radio control using both name and value?
2012-04-04 15:23 0q http://stackoverflow.com/q ... -
Selecting multiple options in select list with shift
2012-04-04 15:19 0Q http://stackoverflow.com/ques ... -
Drag-and-Drop in Watir
2012-04-04 15:15 0http://www.cheezyworld.com/2010 ... -
How to test onclick in this object without id
2012-04-04 15:13 0http://stackoverflow.com/que ... -
Browser Certificates
2012-04-04 15:01 0http://watirwebdriver.com/b ... -
selected_options returns blank from iframe
2012-04-04 14:48 0link http://stackoverflow.com/q ... -
How to handle tinyMCE when automating with watir-webdriver?
2012-04-04 14:28 0I'm evaluating Watir-webdr ... -
Browser url not returning new url
2012-04-01 17:55 0Qhttp://stackoverflow.com/quest ... -
Can not drive Opera with watir-webdriver on Windows XP
2012-04-01 17:53 0Qhttp://stackoverflow.com/quest ... -
why must I sleep or wait using watir-webdriver and firefox?
2012-04-01 17:50 0Qhttp://stackoverflow.com/quest ... -
Firefox 4 with watir webdriver: Need help using helperApps.neverAsk to save CSV
2012-04-01 17:39 0Q http://stackoverflow.com/q ... -
Watir Webdriver counting number of items in a UL list
2012-04-01 17:22 0Q http://stackoverflow.co ... -
finding the direct child of a tag in watir
2012-04-01 17:13 0Qhttp://stackoverflow.com/quest ... -
How to determine browser type (IE, FF, Chrome, etc.)
2012-04-01 16:59 0Q http://stackoverflow.com/que ... -
Wait methods for watir-webdriver unsuccessful with JS/AJAX and new page load (Er
2012-04-01 16:19 0http://stackoverflow.com/questi ... -
How to send text to a CKEditor WYSIWYG editor box using Watir-WebDriver
2012-04-01 16:14 0Q http://stackoverflow.com/ques ... -
How can I get Browser.text.include? to be case insensitive?
2012-04-01 15:57 0Q:http://stackoverflow.com/ques ...
相关推荐
ruby2.0.0+selenium-webdriver+watir-webdriver+rails离线备份,设置环境变量后可使用(未测试)
ChromeDriver 是一款以 Google Chrome 为环境测试网站的工具,现已实现对开源的 WebDriver 通路协议的支持,因此可以轻松与现有的 WebDriver 测试工具相整合。不熟悉 WebDriver 的用户可以参考 2009 年的项目发布...
Watir-WebDriver是基于ruby开发web驱动框架 double_click 双击事件 ie .sikuli_image(:image=>"1.png").double_click right_click 右击事件 exist? 判断用户元素是否存在 edit = ie.text_field(:name,"username") ...
WATIR-WEBDRIVER自动化测试指导
压缩包中包含目前2013/01/19最新的安装文件,有rubyinstaller-1.9.2-p136、DevKit-tdm-32-4.5.1-20101214-1400-sfx、rubygems-1.8.24、watir-4.0.2、watir-webdriver-0.6.2等文件,并附上简略安装说明。
linux下离线安装watir-webdriver
使用watir-webdriver删除百度空间所有文章的ruby脚本
wairt-webdriver.aip包含了chromedriver.exe、DevKit。、IEDriverServer.exe rubyinstaller-2.1.5.exe、Ruby语言入门教程v1.0这几个文件,是使用wati-webdriver进行安装部署以及ruby语言学些所需要的必不可少的资料...
watir-cn中文语言包 watir-cn中文语言包 watir-cn中文语言包 watir-cn中文语言包 watir-cn中文语言包 watir-cn中文语言包 watir-cn中文语言包 watir-cn中文语言包 watir-cn中文语言包 watir-cn中文语言包 watir-cn...
它可以与watir和selenium-webdriver一起使用。 文献资料 项目是学习如何使用页面对象的第一个地方。 可以在上找到该项目的 。 要查看各个发行版之间的更改,请查看 要了解这种宝石的动机,请阅读此 有一本书...
I'll look into it, but in the meantime, you can roll back to an earlier version: gem uninstall activesupport gem install activesupport --version '=2.3.8' gem list activesupport #make sure 3.0.0 isn't...
开源自动化测试工具组合:Ruby+Watir安装 安装准备: 1. 工具安装包准备: Ruby官方下载地址:http://www.ruby-lang.org/zh_cn/downloads/,稳定版本Ruby 1.8.6 Watir下载地址:...
开源自动化测试工具组合:Ruby+Watir安装 安装准备: 1. 工具安装包准备: Ruby官方下载地址:http://www.ruby-lang.org/zh_cn/downloads/,稳定版本Ruby 1.8.6 Watir下载地址:...
ruby 自动化测试,watir是一个很不错的东西
watir-webdriver IE支持 IEDriverServer
Selenium Watir-Webdriver 的域特定页面组件页面组件首先对特定语义域进行建模,然后对浏览器代码进行建模。 Watir-Webdriver 是蜜蜂的膝盖! 现在使用域特定页面组件工厂!用法Domkey 是一个库,可帮助您构建用于...
ruby 2.00 selenium webdriver,watir webdriver 备份打包
watir开发文档。包括帮助文档,示例等等
web自动化测试用的工具。需要先安装ruby