budmuns
budmuns

Reputation: 25

Python code is not executing in Robot Framework?

Robot Framework File

Run Process | python | C:/file/set_rec.py
Open Browser | website.com/
Run some Kewords...

Python file

import sys

sys.setrecursionlimit(5000)

At first my ride code was just:

Open Browser | website.com/
Run some Keywords...

but after the test throw me the error massage: Python maximum recursion depth exceeded I found a solution at stackoverflow how to include .py in Robotframwork but I get the same error massage.

Upvotes: 0

Views: 324

Answers (1)

Todor Minakov
Todor Minakov

Reputation: 20067

Run Process will execute an external process & then close it - that setrecursionlimit() will change it for that python.exe (only), and not affect the process your robot framework runs in.

I'd suggest looking into what's hitting the recursion limit in the first place & fixing it, that's probably a symptom of some more serious issue.
And if you do want to increase it for the python process the framework is running in, you could try with Evaluate (disclaimer - I personally don't know will this work):

Evaluate    sys.setrecursionlimit(5000)

Upvotes: 1

Related Questions