lib/watir-webdriver/elements/frame.rb in watir-webdriver-0.0.6 vs lib/watir-webdriver/elements/frame.rb in watir-webdriver-0.0.7
- old
+ new
@@ -22,11 +22,10 @@
driver
end
end
def assert_exists
- @parent.assert_exists
# we always run locate(), to make sure the frame is switched
@element = locate
end
def execute_script(*args)
@@ -45,11 +44,11 @@
private
def locate_iframe
# hack - frame doesn't have IFrame's attributes either
- @iframe = IFrame.new(@parent, @selector).locate
+ @iframe = IFrame.new(@parent, @selector.merge(:tag_name => "iframe")).locate
if @iframe
switch_to_iframe @iframe
driver
end
@@ -95,8 +94,17 @@
loc = element.attribute(loc)
end
driver.switch_to.frame loc
end
-
end # Frame
+
+ module Container
+ def frame(*args)
+ Frame.new(self, extract_selector(args))
+ end
+
+ def frames(*args)
+ FrameCollection.new(self, extract_selector(args))
+ end
+ end
end # Watir