Method: PageObject#in_frame

Defined in:
lib/page-object.rb

#in_frame(identifier, frame = nil, &block) ⇒ Object

Identify an element as existing within a frame. A frame parameter is passed to the block and must be passed to the other calls to PageObject. You can nest calls to in_frame by passing the frame to the next level.

Examples:

in_frame(:id => 'frame_id') do |frame|
  text_field_element(:id => 'fname', :frame => frame)
end

Parameters:

  • identifier (Hash)

    how we find the frame. The valid keys are:

    • :id

    • :index

    • :name

    • :class

  • frame (defaults to: nil)

    passed from a previous call to in_frame. Used to nest calls

  • block

    that contains the calls to elements that exist inside the frame.



296
297
298
# File 'lib/page-object.rb', line 296

def in_frame(identifier, frame=nil, &block)
  platform.in_frame(identifier, frame, &block)
end