Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > IE Automation/Recorder - Watir/Wet

Reply
Thread Tools

IE Automation/Recorder - Watir/Wet

 
 
asif.kazi@gmail.com
Guest
Posts: n/a
 
      01-24-2006
Hi,
I am trying to write a Record and Playback utility for Watir and WET,
using Ruby and the OLE provision it provides.

My detailed knowledge about IE and DOM is limited though, I am using
the the code below to capture HTML events by extending the sample code
at the end of this email.

ev = WIN32OLE_EVENT.new(ie, 'HTMLElementEvents2')
ev.on_event {|*args| html_event_handler(*args)}

I am able to detect clicks on components , focus in /out etc. however I
am unable to successfully, detect "onchange".

I am particularly interested in capturing this change so that i can
determine when the user entered data in fields, comboboxes, text areas
etc.

Any takers ?
Thanks and Regards,
Asif



Sample code you will find relevant

$urls = []
def navigate(url)
$urls << url
end

def stop_msg_loop
puts "IE has exited..."
throw :done
end

def default_handler(event, *args)
case event
when "BeforeNavigate"
puts "Now Navigating to #{args[0]}..."
end
end

ie = WIN32OLE.new('InternetExplorer.Application')
ie.visible = TRUE
ie.gohome
ev = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents')

ev.on_event {|*args| default_handler(*args)}
ev.on_event("NavigateComplete") {|url| navigate(url)}
ev.on_event("Quit") {|*args| stop_msg_loop}

catch(:done) {
loop {
WIN32OLE_EVENT.message_loop
}
}


puts "You Navigated to the following URLs: "
$urls.each_with_index do |url, i|
puts "(#{i+1}) #{url}"
end

 
Reply With Quote
 
 
 
 
Serge Kolgan
Guest
Posts: n/a
 
      02-16-2006
unknown wrote:

> I am able to detect clicks on components , focus in /out etc. however I
> am unable to successfully, detect "onchange".
>
> I am particularly interested in capturing this change so that i can
> determine when the user entered data in fields, comboboxes, text areas
> etc.


I'd be interested to see the solution to this question, too.

--
Posted via http://www.ruby-forum.com/.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57