Watir: How can I execute in a watir script a specific javascript function called
Question
In a Watir script, after I check checkboxes in a popup window, I'm trying to execute a javascript function to add objects selected to the parent window.
What works fine until now it is the check of the checkbox, but object is not added to the parent window and I get following error when I executed the watir script: in `method_missing': execScript (WIN32OLERuntimeError)
This was my approach - please let me know what other method I can use
ie.checkbox(:id => "check_asm0option0").set
ie.document.parentWindow.execScript("window.triggerOriginalChange(asm0option0, add);","JavaScript")
tr class="tr_option" rel="asm0option0"
td class="td_check"
input id="check_asm0option0" type="checkbox" value="4dbb118ddca3244e2800003d" rel="asm0option0" name="ignore"
/td
td class="td_li"
li value="0" rel="asm0option0" test /li
/td
/tr
if using .set doesn't result in your code working the way you'd expect, then examine the source and then try using .fireEvent to fire the event that should trigger the script that needs to execute.
In this case I'd try
ie.checkbox(:id => "check_asm0option0").fireEvent('onChange')
that approach is generally a bit more organic and easier than trying to invoke the script manually
发表评论
-
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 ...
相关推荐
It ran successfully once, but now when I say b=Watir::Browser.new, it produces a NoMethodError for a method 'demodulize'. I tried some stuff around and when I said require 'firewatir/firefox' , the ...
使用Watir 本自述文件供有兴趣在Watir生态系统中利用私有API Watir代码编写Watir或gem的代码的人使用。 对于我们的用户,您需要的一切都在:示例,新闻,指南,其他资源,支持信息等。补丁/请求请求的过程分叉该项目...
安装将此代码添加到您的Gemfile中: group :test do gem "watir-rails"end用法就像您在请求/集成测试中一如既往地使用Watir: browser = Watir :: Browser . newbrowser . goto home_pathbrowser . text_field ( ...
开源自动化测试工具组合: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下载地址:...
watir测试框架介绍 watir测试框架介绍 watir测试框架介绍
安装命令:gem install watir --local。
Ruby+Watir:开源轻量级、基于Ruby语言、Web应用的自动化测试框架。
烦人的 纯动态的基于Watir的页面对象DSL...对于每个元素,都定义了访问器方法,该方法返回Watir::Element实例(或子类型,如果适用)。 元素访问器方法名称为#{element_name}_#{tag_name} 。 class Page include Wat
Watir:开源轻量级、基于Ruby语言、Web应用的自动化测试框架。
在这里,我们可以找到使用Ruby编程语言进行的自动化测试,并在页面上实现了Cucumber和watir jemas。
组件出现在一个容器中,默认情况下它是一个 Watir::Browser,但可以是任何 Watir::Element 或一个组件。 组件位于 View 类中,该类为页面范围建模,浏览器中的容器。 创建一个视图对象并包含 Domkey::View。 现在您...
watir语法的详细介绍和描述,适合watir初学者。
watir介绍及安装
Watir测试框架介绍、环境配置、API介绍
watir-cn中文语言包 watir-cn中文语言包 watir-cn中文语言包 watir-cn中文语言包 watir-cn中文语言包 watir-cn中文语言包 watir-cn中文语言包 watir-cn中文语言包 watir-cn中文语言包 watir-cn中文语言包 watir-cn...
该文档比较详细地介绍了自动化测试工具watir
Watir全称是“Web Application Testing in Ruby”,发音类似“water”。它是一种基于网页模式的自动化功能测试工具。 Watir是一个Ruby库,使用多版本浏览器进行Web应用程序测试。
Watir 是一个使用 Ruby 实现的开源Web 自动化测试框架,相对于那些庞大的商业工具来说,它很小巧,也很灵活,提供的功能也足够用。 它支持当前流行的浏览器。 它是免费的开源库,而且使用起来非常的方便。
Watir 是一个使用 Ruby 实现的开源Web 自动化测试框架,相对于那些庞大的商业工具来说,它很小巧,也很灵活,提供的功能也足够用。最近抽时间试用了一下,感觉还不错,准备下一步在公司推广使用。因为 Watir 的网站...