cancel
Showing results for 
Search instead for 
Did you mean: 

Ending a keyword execution at any point.

SOLVED
Highlighted
Occasional Contributor

Ending a keyword execution at any point.

A keyword is implemented with a VBS function.  That function calls other functions which creates a stack. I am wondering if it is possible to exit a keyword at any stack level without exiting functions previously called.



keyword sendReport



Function sendReport()



     Call minimize()



End Function



Function minimize()



     ----> It is possible to terminate the keyword execution here without making first Exit Function?



End Function
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Contributor

RE: Ending a keyword execution at any point.

Runner.Stop has parameter Stop Current Test Only.



If you have your keyword tests orginized within project and you run them successively (F5 - Run Project in menu), certain keyword tests can be skipped using Runner.Stop(true) or Stop Execution keyword statement with parameter set to true.



I don't know how to stop certain function (return to top caller?), but I think it's possible to use keyword tests as individual function wrappers and stop (skip) them instead.



Sorry if this is not helpful for you either.

View solution in original post

3 REPLIES 3
Highlighted
Contributor

RE: Ending a keyword execution at any point.

Hi Didac.



Try Runner.Stop() or Runner.Halt() commands.



This link might be helpful.



Regards,

Andrey.
Highlighted
Occasional Contributor

RE: Ending a keyword execution at any point.

Thanks, but this stops my whole test case execution. Sorry for my bad previously explanation, I only want to terminate the current keyword (or function) and proceed with the next keyword operation. 
Highlighted
Contributor

RE: Ending a keyword execution at any point.

Runner.Stop has parameter Stop Current Test Only.



If you have your keyword tests orginized within project and you run them successively (F5 - Run Project in menu), certain keyword tests can be skipped using Runner.Stop(true) or Stop Execution keyword statement with parameter set to true.



I don't know how to stop certain function (return to top caller?), but I think it's possible to use keyword tests as individual function wrappers and stop (skip) them instead.



Sorry if this is not helpful for you either.

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Script Wanted
A new challenge is here!

Create a function to drag one element to another for the TechCorner tag!

Will you dare to take the challenge?


Scripts created in July:
- Passing custom command-line arguments as a test parameter
Top Kudoed Authors