From: Paul Rogers Date: 2007-07-24T03:59:58+09:00 Subject: Re: watir checker being run twice? On Jul 23, 12:28 pm, "Kyle Schmitt" wrote: > On 7/23/07, Paul Rogers wrote:> > You'd do better to post to the watir list. > > > This might be due to a number of reasons - if you can post some html I > > > might be better able to help you. > > > Which version of watir are you using? > > > > Paul > > > actually looking at it again, if you always use the same phrases, then > > you are basically asking watir to run a new error_checker, but which > > is checking for exactly the same thing. > > If the phrases are different for each page, then maybe delete the > > checker when youve finished with it > > > Paul > > Paul, I'm using Watir 1.5.1.1192. > As far as the error checker, it's defined and set in the setupIE > method, which is only run once. Each page has it's own @ie object, so > when pages aren't using the default list of things to look for, they > shouldn't conflict. > I wanted it setup this way, because there are times the test needs to > go to different pages and back again (SuperPage has a browseTo method > that I excluded from the previous post, so there is no watir/ie object > in the main test). If you inherit from superpage then setupIE ( and hence the error checker) will get run every time you create a subclass of superpage - which is probably where you get multiple error checkers if you alter buildErrorCHecker to something like ( I havent tstted it ) def buildAssertionChecker() 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 then you will see which page each checker is being created for Paul