There is require 'watir' --- require 'watir'
class BrowserFactory def BrowserFactory.create browser = Watir::Browser.new begin browser.speed = :zippy browser.bring_to_front rescue NoMethodError end browser end end end 2009/2/3 aidy lewis <aidy.le...@googlemail.com>: > > #How about this > > require 'watir' > > class Browser > > def initialize > @browser ||= Watir::IE.new > @browser.speed = :zippy > @browser.bring_to_front > @browser.maximize > end > > def close > @browser.close > puts "we have closed the browser" > end > > #watir methods not in Browser fall into here > def method_missing(method_name,*args) > @browser.send(method_name, *args) > end > > end > > browser ||= Browser.new > browser.goto('www.fsf.org') > browser.close > > > #Aidy > On 02/02/2009, ab.ostrow...@gmail.com <ab.ostrow...@gmail.com> wrote: >> >> Hi there! >> >> def setup >> @browser = Wayn::BrowserFactory.create >> @user = Wayn::User.new(@browser) >> @user.login('tomcio', 'haslo') >> end >> >> where >> >> class BrowserFactory >> def BrowserFactory.create >> browser = Watir::Browser.new >> >> begin >> browser.speed = :zippy >> browser.bring_to_front >> rescue NoMethodError >> end >> >> browser >> end >> end >> end >> >> I have installed: >> Ruby Version 1.8.6 >> Installer Version 186-27 >> firewatir 1.6.2 >> commonwatir 1.6.2 >> >> I have following error: >> No method error: undefinied method 'goto' for # <Watir::IE:0x3294480> >> >> I run the same script on another machine and it works therefore I dont >> know whats cousing this error. >> Thanks in advance > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---