Library of :FOR loop

Hi,

What is the library in which :FOR loop code is defined?
Or if someone can help me where the implementation of :FOR loop is, it will be great.

Thanks,
Rahul

it is not a library it just a supported syntax
https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#for-loops

Isnt there any under laying python code which handles the FOR statement?
So just for my clarity, how are these FOR statements get executed in Robot?

Hi

Yes there is Python code to support FOR loops, but the question is actually pretty complex. I would start reading how Robot Framework parses test data robot.api package — Robot Framework 4.1.1.dev1 documentation and continue from there until you find out the correct place.

1 Like

Thank you.

Isn’t

:FOR
\ Kw1
\ Kw2

already depreciated?

FOR
Kw1
Kw2
END

Being the latest syntax.

Secondly, if you want to do more complex iterations, my recommendation would be to send the data to your Python library and calculate there.

Library ./mylibs/myLibrary.py

.
.
.

${result}= My Python Iterator ${mycomplex_data}