[Wtr-general] attachRecording method in WatirMaker script
Matthew Hailstone
matthew.hailstone at gmail.com
Mon Oct 2 10:22:15 EDT 2006
I am using Watir 1.4.1. Thanks for the reply.
On 9/29/06, Bret Pettichord <bret at pettichord.com> wrote:
> There is an incompatability between Watir 1.5 and Ruby 1.8.5 that could
> possibly lead to this error. What version of Watir are you using?
>
> Bret
>
>
> On 9/29/06, Matthew Hailstone <matthew.hailstone at gmail.com> wrote:
> >
> > I modified the watirmaker script
> >
> http://www.hanselman.com/blog/content/binary/WatirMaker.rb.txt
> > to contain the following method right under startRecording
> >
> > def attachRecording
> >
> > # initialize IE
> > require 'watir'
> > @watirie = Watir::IE.attach(:title,/#{$windowName}/)
> > @ie = @watirie.getIE()
> > @ie.visible = TRUE
> >
> > browserEvents = WIN32OLE_EVENT.new( @ie, 'DWebBrowserEvents2' )
> > browserEvents.on_event { |*args| browserEventHandler( *args ) }
> >
> > # print script header
> > puts
> "##//////////////////////////////////////////////////////////////////////////////////////////////////"
> > puts "##"
> > puts "## Watir script recorded by WatirMaker."
> > puts "##"
> > puts
> "##//////////////////////////////////////////////////////////////////////////////////////////////////"
> > puts ""
> > puts "#requires"
> > puts "require 'watir'"
> > puts ""
> > puts "#includes"
> > puts "include Watir"
> > puts ""
> > puts "ie = IE.attach(:title,/#{$windowName}/}"
> > # puts "ie.set_fast_speed()" this doesn't seem to work so well
> > with multiple frames
> > puts ""
> >
> > # capture events
> > catch( :done ) {
> > loop {
> > WIN32OLE_EVENT.message_loop
> > }
> > }
> >
> > # IE takes a moment to close.
> > # Making it invisible in the interim produces a slightly nicer
> > user experience.
> > @ie.visible = FALSE
> > end
> >
> > And at the end of the file I inserted:
> >
> > wm = WatirMaker.new
> > wm.startRecording if !$windowName
> > wm.attachRecording if $windowName
> >
> > I get the following error:
> >
> > watirmaker.rb:168: [BUG] Segmentation fault
> > ruby 1.8.5 (2006-08-25) [i386-mswin32]
> >
> > This is found in the attachRecording method at the following:
> >
> > WIN32OLE_EVENT.message_loop
> >
> > I start the command like this:
> >
> > ruby -s watirmaker.rb -windowName="MyTitle"
> >
> > I have already sought help from the creators of watirmaker.rb. They
> > referred me to this list and the general ruby list. Any help would be
> > extremely helpful.
> >
> > Thanks!
> >
> > Matthew
> > _______________________________________________
> > Wtr-general mailing list
> > Wtr-general at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/wtr-general
> >
>
>
> _______________________________________________
> Wtr-general mailing list
> Wtr-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general
>
>
More information about the Wtr-general
mailing list