I have a function that does several things. It has several statements.
I want to handle exception so that if any statement in the function fails I exit the function with "fail "return code.
I can do
rc = win_wait_info
on each statement in function, but this soln is very messy.
In Winrunner whats the best way to throw and catch exception raised by multiple statements?
This is a common scenario. How do others handle this problem?
The only soln i can think of is
write a function that win_wait_info_XXX
that calls win_wait_info with appropriate parameters and returns exception if unexpected result code is returned.
And then use win_wait_info_XXX in the scripts instead of win_wait_info.