Hi all,

I've only been doing this for a few months, script writing and all, and have 
found the going slow at times.  I'd thought I'd post some lines from a script 
of mine to help others getting started out there.  This portion of script may 
contain a line or two of helpful code if you are looking at getting started 
with Watir and generating log files;

   $logger.log("")
   $logger.log("## Beginning of test: Access Web Application-Navigate to 
Homepage") #Prints to Log file
   $logger.log("Step 1: Go to test site")#Prints to Log file
   $logger.log("Access Test Site")#Prints to Log file
   $ie.goto("http://dispositioningstestsite";)#not a real site by the way. . . 
   $logger.log($ie.down_load_time)#records response time and prints to Log file
   $ie.maximize()#maximizes the IE window
   $logger.log("**IE Page Title**")#Prints to Log file
   $logger.log($ie.title)#records IE page title and prints to Log File
   $logger.log("**IE Page Text**")#Prints to Log file
   $logger.log($ie.text)#records IE page text and prints to Log File
   $logger.log("Select selectlist option 01")#Prints to Log file
   $ie.select_list(:id, 'selectlist').select_value('01')
   $logger.log("Select Organisation 'OK' button")#Prints to Log file
   $ie.button(:id, 'OrganisationButton').click
   $logger.log($ie.down_load_time)#records response time and prints to Log file
   sleep 5#Pause for five seconds
   $ie.send_keys('{PRINTSCREEN}')#I use an application that takes screenshots 
via the PrintScreen key and dumps the screenshot to a selected destination.
   #I use Wisdom-soft ScreenHunter 4.0 from www.download.com (free). There are 
others out there . . . 
   $logger.log("  Action: Navigated to Home Page.")#Prints to Log file

Cheers,

Mark
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to