Sha256: 3fefc0a754cee1b6377bb53cecfd2788640916c3895f6e874b61e5c672033d37

Contents?: true

Size: 918 Bytes

Versions: 41

Compression:

Stored size: 918 Bytes

Contents

#  This module includes checkers which are run on every page load
# 
#  In order to use this module, add a require to one of your test scripts: 
#  require 'watir/contrib/page_checker' 
#  To add checkers, call the ie.add_checker method
#
#  ie.add_checker(PageCheckers::NAVIGATION_CHECKER)
#
#  Checkers are Ruby proc objects which are called within Watir::IE and passed 
#  the current instance of ie. 

module PageCheckers        

	# This checker iterates through  the current document including any frames
	# and checks for http errors, 404, 500 etc
	NAVIGATION_CHECKER = lambda do |ie|
		if ie.document.frames.length > 1
			1.upto ie.document.frames.length do |i|
				begin
					ie.frame(:index, i).check_for_http_error
				rescue Watir::Exception::UnknownFrameException
					# frame can be already destroyed
				end          
			end
		else
			ie.check_for_http_error
		end
	end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
watir-3.0.0.rc3 lib/watir/contrib/page_checker.rb
watir-3.0.0.rc2 lib/watir/contrib/page_checker.rb
watir-3.0.0.rc1 lib/watir/contrib/page_checker.rb
watir-2.0.4 lib/watir/contrib/page_checker.rb
watir-2.0.3 lib/watir/contrib/page_checker.rb
watir-2.0.2 lib/watir/contrib/page_checker.rb
watir-2.0.2.rc1 lib/watir/contrib/page_checker.rb
watir-2.0.1 lib/watir/contrib/page_checker.rb
watir-2.0.0 lib/watir/contrib/page_checker.rb
watir-2.0.0.rc3 lib/watir/contrib/page_checker.rb
watir-2.0.0.rc2 lib/watir/contrib/page_checker.rb
watir-1.9.2 lib/watir/contrib/page_checker.rb
watir-1.9.2.rc1 lib/watir/contrib/page_checker.rb
watir-1.9.1 lib/watir/contrib/page_checker.rb
watir-1.9.1.rc1 lib/watir/contrib/page_checker.rb
watir-1.9.0 lib/watir/contrib/page_checker.rb
watir-1.9.0.rc7 lib/watir/contrib/page_checker.rb
watir-1.9.0.rc6 lib/watir/contrib/page_checker.rb
watir-1.9.0.rc5 lib/watir/contrib/page_checker.rb
watir-1.9.0.rc4 lib/watir/contrib/page_checker.rb