Maximum limit of started keywords exceeded

Hello,
I have a requirement which has a process to be executed in recursive way, the Keyword is invoked/called multiple times in same robot.
Previously I was executing 1 transaction/data calling keyword recursively which was working fine and getting completed, but recently I have started getting error “Maximum limit of started keywords exceeded” for the same data/transaction.

I checked the context.py which has threshold value of 42, Is there a possibility to increase this limit.

As far as i know, only with “patching” the robot code…

Could you maybe do EXECUTION_CONTEXTS.current._started_keywords_threshold as a workaround? Would maybe even work if you inline evaluate this in the tests which require a high amount of started keywords. Might have weird side effects though.

Hello,
Thanks for reply
The issue was resolved by increasing _started_keywords_threshold limit in: context.py at below location
“C:\Python\Lib\site-packages\robot\running\context.py”

I increased limit to 10000 and it is working as expected

1 Like

@dpatil12

Just be aware that after an update of Robot Framework (like now with the 3.2.2) you have to monkey patch it again.

Cheers

1 Like

Thanks Bro.

Hi all!
Was facing this issue too, as I want to use recursion to go through over all tabs on my application to check basic stuff. The web app has over 60 tabs in many levels…
To avoid forgetting to apply this brute force change after upgrading RF, I’ve added this command to my entrypoint.sh file (I’m running the tests in Docker).
sed -i 's/_started_keywords_threshold =.*/_started_keywords_threshold = 100/' env/lib/python3.8/site-packages/robot/running/context.py

Hope this helps!

Notice that the limit is nowadays 100. The reason to have a limit is to avoid infinite recursion crashing execution so that log/report cannot be created.

1 Like