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
 
 
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to