From: Kyle Schmitt Date: 2007-07-24T04:28:37+09:00 Subject: Re: watir checker being run twice? Wow am I confused now. I added two such a lines to buildAssertionChecker, and one line to setupIE: see below. So it tells me when the proc is created and who its' created for when the proc is used, and who is using it and when the proc is added to the @ie object. Obviously I got tons of messages out, and they say that each of those procs is created once, and is added to the class specific @ie once. def buildAssertionChecker() puts "Creating the checker for #{self.class.name}" Proc.new do |ie| puts "checker for #{self.class.name}" @phrases.each do |phrase| if ie.text.include?phrase z=Zlib::Deflate.new(9) logError("Found #{phrase}, compressed b64 encoded page is #{Base64.encode64(z.deflate(ie.html,Zlib::FINISH))}") end end end end def setupIE() begin @ie=Watir::IE.attach(:url,/localhost/) rescue @ie=Watir::IE.new() @ie.goto(@baseURL) end @ie.waitForIE #add the checking facility puts "adding the checker to the ie object for #{self.class.name}" @ie.add_checker(buildAssertionChecker) end