<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=072554716-03072006><FONT color=#0000ff
size=2>ahhh cool, I had "roughly" the same thing...but I figured I was doing it
wrong :)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=072554716-03072006><FONT color=#0000ff
size=2>I couldn't figure out the @browser = modal part...</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=072554716-03072006><FONT color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=072554716-03072006><FONT color=#0000ff
size=2>thanks Bret</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=072554716-03072006><FONT color=#0000ff
size=2>-george</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> wtr-general-bounces@rubyforge.org
[mailto:wtr-general-bounces@rubyforge.org] <B>On Behalf Of </B>Bret
Pettichord<BR><B>Sent:</B> Monday, July 03, 2006 12:42 PM<BR><B>To:</B>
wtr-general@rubyforge.org<BR><B>Subject:</B> Re: [Wtr-general] UI Mapping
Revisited.<BR></FONT><BR></DIV>
<DIV></DIV>On 7/3/06, <B class=gmail_sendername>George Flaherty</B> <<A
href="mailto:George.Flaherty@sas.com">George.Flaherty@sas.com</A>> wrote:
<DIV><SPAN class=gmail_quote></SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">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. <BR><BR>Thanks<BR>-george</BLOCKQUOTE>
<DIV><BR>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: <BR><BR> class
AddMatterDialogMap<BR> def initialize
(modal)<BR> @browser = modal<BR>
end<BR> <BR> def matter_name;
@browser.text_field(:id, 'txtMatterName'); end<BR> def
matter_no; @browser.text_field (:id, 'txtMatterNo'); end<BR>
def work_group; @browser.select_list(:id, 'ddWorkGroup');
end<BR> def professional_in_charge; @browser.select_list(:id,
'ddPic'); end<BR> def city; @browser.text_field(:id,
'txtCity'); end <BR> def zip; @browser.text_field(:id,
'txtZip'); end<BR> def country; @browser.select_list(:id,
'ddlCountry'); end<BR> def open_date; @browser.text_field(:id,
'txtOpenDate'); end<BR> def matter_type; @browser.select_list
(:id, 'ddMatterType'); end<BR> def close_date;
@browser.text_field(:id, 'txtCloseDate'); end<BR> def
litigation; @browser.select_list(:id, 'ddLitigation'); end<BR>
def closed; @browser.checkbox(:id, 'chkClosed'); end <BR> def
notes; @browser.text_field(:id, 'txtNotes'); end<BR> end
<BR></DIV><BR><BR>So to use this ...<BR><BR> map = AddMatterDialogMap.new
ie<BR> map.open_date.set '1/1/06'<BR><BR>Bret<BR></DIV></BODY></HTML>