attachRecording method in WatirMaker script

I modified the watirmaker script
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 = @ie, 'DWebBrowserEvents2' )
browserEvents.on_event { |*args| browserEventHandler( *args ) }

# print script header

puts “##”
puts “## Watir script recorded by WatirMaker.”
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 {

# IE takes a moment to close.
# Making it invisible in the interim produces a slightly nicer

user experience.
@ie.visible = FALSE

And at the end of the file I inserted:

wm =
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:


I start the command like this:

ruby -s watirmaker.rb -windowName=“MyTitle”

Any thoughts?


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs