Forum Discussion
There's no need... that's what a loop is for.
If you have your code structured like this (this is PseudoCode, not intended to be executed)
for all browsers in BrowserList { try { execute step 1 execute step 2 execute step 3 } catch execption { execute exception handling } finally { execute finalization for loop iteration } }
This will execute the loop for every browser. If an exception is thrown in the "try" code block, "catch" will handle it. "Finally" will execute for every iteration of the loop. Then, if there is still something to loop, it will go back to the beginning of the try section. No need for any "go to".
Now, this will work even for keyword test. Instead of the {}, the blocks are handled by "indentation". So, the try, catch and finally blocks will be all indented under the loop.
ah yeah, false thinking of my side ... the try catch block will immediately be on the "end" of the execution, when triggered.
thanks
Related Content
Recent Discussions
- 11 hours agoSvetaG