简体   繁体   中英

I am checking script for exception but got some errors can anyone help?

Below is the code....

require 'watir'
@ie = Watir::IE.new 
@ie.goto 'http://asdfasdf.com'

begin
    @ie.check_for_http_error 
    rescue Watir::Exception::NavigationException => e 
    puts "Page did not load: #{e}" 
end

require 'watir/contrib/page_checker'
@ie.add_checker(PageCheckers::NAVIGATION_CHECKER)

begin
   @ie.goto "http://marekj.com/asdfasdfasdfa"
rescue Watir::Exception::NavigationException => e 
   puts "Page did not load: #{e}" 
end

I run above code but it is showing an error message:

c:/ruby192/lib/ruby/gems/1.9.1/gems/watir-2.0.3/lib/watir/page-container.rb:12:in `method_missing': (in OLE method `navigator': ) (WIN32OLERuntimeError)
OLE error code:80070005 in <Unknown>
  Access is denied.

HRESULT error code:0x80020009
  Exception occurred.
    from c:/ruby192/lib/ruby/gems/1.9.1/gems/watir-2.0.3/lib/watir/page-container.rb:12:in `check_for_http_error'
    from xception.rb:7:in `<main>'

How can I fix this?

Access is denied. error message is usually a problem with frames. Google for that error message.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM