Module: Vapir::IE::Container

Includes:
Container, Exception
Included in:
Element, PageContainer
Defined in:
lib/vapir-ie/container.rb

Overview

This module contains the factory methods that are used to access most html objects

For example, to access a button on a web page that has the following html

<input type = button name= 'b1' value='Click Me' onClick='javascript:doSomething()'>

the following watir code could be used

ie.button(:name, 'b1').click

or

ie.button(:value, 'Click Me').to_s

there are many methods available to the Button object

Is includable for classes that have @container, document and ole_inner_elements

Instance Method Summary collapse

Instance Method Details

#handling_existence_failure(options = {}, &block) ⇒ Object

see documentation for the common Vapir::Container#handling_existence_failure



26
27
28
29
30
31
32
33
34
35
# File 'lib/vapir-ie/container.rb', line 26

def handling_existence_failure(options={}, &block)
  begin
    base_handling_existence_failure(options, &block)
  rescue WIN32OLERuntimeError, RuntimeError, NoMethodError, Vapir::Exception::ExistenceFailureException
    if [WIN32OLERuntimeError, RuntimeError, NoMethodError].any?{|klass| $!.is_a?(klass) } && $!.message !~ Vapir::IE::ExistenceFailureCodesRE
      raise
    end
    handle_existence_failure($!, options)
  end
end

#log(what) ⇒ Object

Write the specified string to the log.



37
38
39
# File 'lib/vapir-ie/container.rb', line 37

def log(what)
  @container.logger.debug(what) if @logger
end