[英]Has anyone managed to get Watir using IE on Ruby 1.9.1 working?
[英]How to get Javascript pop up text using Ruby 1.9.2 and Watir 1.9.1 in Windows 7 x64
該鏈接討論的是如何單擊按鈕,而不是如何獲取彈出文本http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups
它曾經在Watir 1.6.5和Ruby 1.8.6中通過以下代碼工作
require 'rubygems'
require 'watir'
require 'watir/ie'
require 'watir\contrib\enabled_popup'
#get the window with specified handle.
WindowHandle = ARGV[0].to_i#1967760
if (Watir::IE.find(:hwnd,WindowHandle)==nil)
exit(1)
else
ObjIE = Watir::IE.find(:hwnd, WindowHandle.to_i)
end
PopupHandle=ObjIE.enabled_popup(25)
winObj=WinClicker.new
PopupText=winObj.getStaticText_hWnd(PopupHandle).[](1)
puts(PopupText)
但是帶有Watir 1.9.1的Ruby 1.9.2不支持WinCLicker,因此,不可能重用相同的代碼。 任何幫助,將不勝感激。
也許RAutomation可以提供幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.