<!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>&nbsp;</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> &lt;<A 
href="mailto:George.Flaherty@sas.com">George.Flaherty@sas.com</A>&gt; 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&nbsp; i've found that it was easier to just create small methods that 
returned various elements. Here's some of my code: <BR><BR>&nbsp; class 
AddMatterDialogMap<BR>&nbsp;&nbsp;&nbsp; def initialize 
(modal)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @browser = modal<BR>&nbsp;&nbsp;&nbsp; 
end<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; def matter_name; 
@browser.text_field(:id, 'txtMatterName'); end<BR>&nbsp;&nbsp;&nbsp; def 
matter_no; @browser.text_field (:id, 'txtMatterNo'); end<BR>&nbsp;&nbsp;&nbsp; 
def work_group; @browser.select_list(:id, 'ddWorkGroup'); 
end<BR>&nbsp;&nbsp;&nbsp; def professional_in_charge; @browser.select_list(:id, 
'ddPic'); end<BR>&nbsp;&nbsp;&nbsp; def city; @browser.text_field(:id, 
'txtCity'); end <BR>&nbsp;&nbsp;&nbsp; def zip; @browser.text_field(:id, 
'txtZip'); end<BR>&nbsp;&nbsp;&nbsp; def country; @browser.select_list(:id, 
'ddlCountry'); end<BR>&nbsp;&nbsp;&nbsp; def open_date; @browser.text_field(:id, 
'txtOpenDate'); end<BR>&nbsp;&nbsp;&nbsp; def matter_type; @browser.select_list 
(:id, 'ddMatterType'); end<BR>&nbsp;&nbsp;&nbsp; def close_date; 
@browser.text_field(:id, 'txtCloseDate'); end<BR>&nbsp;&nbsp;&nbsp; def 
litigation; @browser.select_list(:id, 'ddLitigation'); end<BR>&nbsp;&nbsp;&nbsp; 
def closed; @browser.checkbox(:id, 'chkClosed'); end <BR>&nbsp;&nbsp;&nbsp; def 
notes; @browser.text_field(:id, 'txtNotes'); end<BR>&nbsp; end&nbsp; 
<BR></DIV><BR><BR>So to use this ...<BR><BR>&nbsp; map = AddMatterDialogMap.new 
ie<BR>&nbsp; map.open_date.set '1/1/06'<BR><BR>Bret<BR></DIV></BODY></HTML>