Forum Discussion
ok thanks for the reply.
This would be a rather hard task as our tests already exceed a couple hundreds and adding those try catch function to every single testcase might take a while ... I guess I will take this into account for creating the new tests and I'll see if we can manage the old tests somehow.
Whats the best way of getting to the next browser loop? make a Go to label which you jump to in the try catch? or are there any better attempts
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.
- Lagencie6 years agoFrequent Contributor
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
- 14 hours agoAivanitskiy
- 18 hours agonastester