Hi, Having trouble creating a frame object before a particular page contains the object.
The framework contains an object repository which contains all the objects and methods that act on a particular page. Using textfields, links, buttons etc work fine, because this is not checked on the page if it exists when the object is created. But when creating a frame object, it is checked against the current page if the frame exists, which does not allow you store the frame objects. Below is an example- class Videopage def initialize(brow) usrtxtfield = brow.frame(:id, "loginframe").text_field(:id, "lgnId1") srchtxtfield = brow.text_field(:id, "topQuery2") end #... other methods doing complex steps like login etc end Now the test code will require the above file. require 'watir' require 'watir/ie' require 'Videopage' #--- object repository file class Checktest < Test::Unit::TestCase def test_thisframe Watir::Browser.default = "ie" mybrow = Watir::Browser.new vid = Videopage.new(mybrow) mybrow.goto("http://video.aol.com") mybrow.link(:text, "Sign In").click sleep 5 end end This returns an error "in `locate': Unable to locate a frame using id and loginframe. (Watir::Exception::UnknownFrameException)" Thanks, Tony --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~----------~----~----~----~------~----~------~--~---