A
aidy
Hi,
[wasn't sure which group to submit this post to Watir or Ruby, but even
though I use Watir, I think it is more of a Ruby question]
If I use 'require' for example on two files within a master file:
require 'browser'
require 'logon'
And these two files contain this code
browser.rb
require 'watir'
def start_browser (url)
@ie = Watir::IE.new
@ie.goto(url)
@ie.maximize()
end
logon.rb
def login (username, password)
@ie.linktext, 'Log in').click
@ie.text_fieldname, "userid").set(username)
@ie.text_fieldname, "password").set(password)
@ie.buttonvalue,'Log in').click
end
Will the i.e. instance be the same in logon as browser, or are they
different objects?
Should I be using this pre-fix '@@'?
I am uncomfortable that Ruby allows me to slide into functional
programming while I am consciously trying to move to OO.Is this a
problem do you think, for Web scripting?
Aidy
[wasn't sure which group to submit this post to Watir or Ruby, but even
though I use Watir, I think it is more of a Ruby question]
If I use 'require' for example on two files within a master file:
require 'browser'
require 'logon'
And these two files contain this code
browser.rb
require 'watir'
def start_browser (url)
@ie = Watir::IE.new
@ie.goto(url)
@ie.maximize()
end
logon.rb
def login (username, password)
@ie.linktext, 'Log in').click
@ie.text_fieldname, "userid").set(username)
@ie.text_fieldname, "password").set(password)
@ie.buttonvalue,'Log in').click
end
Will the i.e. instance be the same in logon as browser, or are they
different objects?
Should I be using this pre-fix '@@'?
I am uncomfortable that Ruby allows me to slide into functional
programming while I am consciously trying to move to OO.Is this a
problem do you think, for Web scripting?
Aidy