Class: Watir::FrameJavaScripter

Inherits:
JavaScripter show all
Defined in:
lib/safariwatir/scripter.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from JavaScripter

#find_cell, #operate

Constructor Details

#initialize(frame) ⇒ FrameJavaScripter

Returns a new instance of FrameJavaScripter.



68
69
70
# File 'lib/safariwatir/scripter.rb', line 68

def initialize(frame)
  @page_container = "parent.#{frame.name}"
end

Instance Method Details

#wrap(script) ⇒ Object



72
73
74
75
76
77
# File 'lib/safariwatir/scripter.rb', line 72

def wrap(script)
  # add in frame name when referencing parent or document
  script.gsub! "parent", "parent.#{@page_container}"
  script.gsub! "document", "#{@page_container}.document"
  super(script)
end