lib/vapir-ie/container.rb in vapir-ie-1.7.2 vs lib/vapir-ie/container.rb in vapir-ie-1.8.0

- old
+ new

@@ -21,43 +21,21 @@ include Vapir::Container include Vapir::Exception public # see documentation for the common Vapir::Container#handling_existence_failure - def handling_existence_failure(options={}) - options=handle_options(options, :handle => :ignore) + def handling_existence_failure(options={}, &block) begin - yield + base_handling_existence_failure(options, &block) rescue WIN32OLERuntimeError, RuntimeError, NoMethodError, Vapir::Exception::ExistenceFailureException - raise if $!.class==RuntimeError && $!.message !~ /HRESULT/ # sometimes WIN32OLE raises a RuntimeError instead of a WIN32OLERuntimeError. only catch a RuntimeError if it's from WIN32OLE, indicated by HRESULT in the error message. + if [WIN32OLERuntimeError, RuntimeError, NoMethodError].any?{|klass| $!.is_a?(klass) } && $!.message !~ Vapir::IE::ExistenceFailureCodesRE + raise + end handle_existence_failure($!, options) end end - public - # Note: @container is the container of this object, i.e. the container - # of this container. - # In other words, for ie.table().this_thing().text_field().set, - # container of this_thing is the table. - - # This is used to change the typing speed when entering text on a page. - attr_accessor :typingspeed - attr_accessor :type_keys - - def copy_test_config(container) # only used by form and frame - @typingspeed = container.typingspeed - @type_keys = container.type_keys - end - private :copy_test_config - # Write the specified string to the log. def log(what) @container.logger.debug(what) if @logger end - -# def set_container container -# @container = container -# @page_container = container.page_container -# end - - private end # module end