IE Automation/Recorder - Watir/Wet

A

asif.kazi

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
 
S

Serge Kolgan

unknown said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top