[Wtr-general] Call A Method

chitta chitta.ranjan at globallogic.com
Thu Mar 22 00:06:16 EDT 2007


HI,
 
In my script i used 
 
if ie.contains_text("Choose Plan")
      p 'Choose plan page is opening "pass"'
      excel.Range("d3")['Value'] = urlverificationactualpass;
      excel.Range("e3")['Value'] = pass;
    else
      p 'Choose plan page is not opening "fail"'
      excel.Range("d3")['Value'] = urlverificationactualfail;
      excel.Range("e3")['Value'] = fail;
      
    end
 
 
 
in all my 51 test cases, where the   urlverificationactualpass,
urlverificationactualfail, pass, fail all are the veriables & used to read a
perticular cell from one excell sheet, and write it to another excell sheet
depending upon the test pass or fail.
 
Now i want to write a method for this so that i don't need to write it again
& again, only i have to call the method ...is this possible??
 
 
def checkcondition(checktext, cell1, cell2, messagepass, messagefail,
passcheck, failcheck,excel)
if ie.contains_text("#{checktext}")
p 'messagepass'
excel.Range("#{cell1}")['Value'] = "#{passcheck}";
excel.Range("#{cell2}")['Value'] = "#{pass}";
else
p 'messagefail'
excel.Range("#{cell1}")['Value'] = "#{failcheck}";
excel.Range("#{cell2}")['Value'] = "#{fail}";
end
end
 
checkcondition("Choose Plan", "d3", "e3", "Choose plan page is opening
pass", "Choose plan page is not opening fail", "urlverificationactualpass",
"urlverificationactualfail")
 
 
Any Body can help me
 
Regards
 
Chitta Ranjan
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070322/f3517e09/attachment.html 


More information about the Wtr-general mailing list