Sha256: 05ed1b260f33c75ef8f1ed7edc24e4d357267c92ce519a7a3ef9145b0e387f93
Contents?: true
Size: 1.37 KB
Versions: 4
Compression:
Stored size: 1.37 KB
Contents
module Watir class Frame < Element include PageContainer TAG = ['FRAME', 'IFRAME'] attr_accessor :document # Find the frame denoted by how and what in the container and return its ole_object def locate frame, document = @container.locator_for(FrameLocator, @how, @what).locate if frame && document @o = frame begin @document = document.document rescue WIN32OLERuntimeError => e # This frame's content is not directly accessible but let the # user continue so they can access the frame properties raise e unless e.message =~ /Access is denied/ end end end def ole_inner_elements document.body.all end private :ole_inner_elements def initialize(container, how, what) set_container container @how = how @what = what copy_test_config container end def document assert_exists if @document @document else raise FrameAccessDeniedException, "IE will not allow access to this frame for security reasons. You can work around this with ie.goto(frame.src)" end end def attach_command @container.page_container.attach_command + ".frame(#{@how.inspect}, #{@what.inspect})".gsub('"','\'') end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
watir-2.0.1 | lib/watir/frame.rb |
watir-2.0.0 | lib/watir/frame.rb |
watir-2.0.0.rc3 | lib/watir/frame.rb |
watir-2.0.0.rc2 | lib/watir/frame.rb |