From: Paul Rogers Date: 2007-07-24T04:39:59+09:00 Subject: Re: watir checker being run twice? On Jul 23, 1:28 pm, "Kyle Schmitt" wrote: > 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 but if you use an existing @ie, it will already have a checker. Im not using the version of watir that you are, but I use lots of checkers and dont see this problem. If you do the simplest thing ( 1 page, 1 ie and 1 checker ) does it run twice? Paul