ahhh cool, I had "roughly" the same thing...but I figured I was doing it
wrong :)
I couldn't figure out the @browser = modal part...
thanks Bret
-george
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bret Pettichord
Sent: Monday, July 03, 2006 12:42 PM
To: [email protected]
Subject: Re: [Wtr-general] UI Mapping Revisited.
Is there a preferred way to map out Watir UI components/features before test execution, then possibly "bind" them later? I know there have been some conversations regarding a Watir::Map class, but is there some other way until that feature is added? My main goal is to not duplicate UI features throughout various Test Suites.
Thanks
-george
I know that i was talking about creating a Map class, but recently i've found that it was easier to just create small methods that returned various elements. Here's some of my code:
class AddMatterDialogMap
def initialize (modal)
@browser = modal
end
def matter_name; @browser.text_field(:id, 'txtMatterName'); end
def matter_no; @browser.text_field (:id, 'txtMatterNo'); end
def work_group; @browser.select_list(:id, 'ddWorkGroup'); end
def professional_in_charge; @browser.select_list(:id, 'ddPic'); end
def city; @browser.text_field(:id, 'txtCity'); end
def zip; @browser.text_field(:id, 'txtZip'); end
def country; @browser.select_list(:id, 'ddlCountry'); end
def open_date; @browser.text_field(:id, 'txtOpenDate'); end
def matter_type; @browser.select_list (:id, 'ddMatterType'); end
def close_date; @browser.text_field(:id, 'txtCloseDate'); end
def litigation; @browser.select_list(:id, 'ddLitigation'); end
def closed; @browser.checkbox(:id, 'chkClosed'); end
def notes; @browser.text_field(:id, 'txtNotes'); end
end
So to use this ...
map = AddMatterDialogMap.new ie
map.open_date.set '1/1/06'
Bret
_______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
