Support for python code directly

Hi,

Is it possible to have a robotframework version that can support python code directly?

I find it a little bit limiting and cumbersome being force to build custom libraries for specialized algorithms.

Even the keywords IF, ELSE, FOR, etc are akward for me.

Why not supporting python code directly?

Thanks

Hi Harmin,

Welcome to the Robot Framework community,

Robot Framework does indeed support python, actually most Robot Framework library keywords are written in python.

You can also easily write your own custom keywords in python too, the documentation for this is here

Have a look through that section of the documentation, and if you still have questions, ask and we’ll try to help,

Dave.

Robot framework is sort of a DSL and from the start i guess it point was that it would allow non-programmers to implement tests so expecting “why i can’t write this in python” is sort of not what the project was initially written.

However, a lot of new language constructs has been added during the development to make RF’s own language more “programming language alike”.

That said, strength of RF is its test reporting, ecosystem of libraries, ability to extend / write keywords with pretty much any language.

Ok, you had a question of sorts.

I find it a little bit limiting and cumbersome being force to build custom libraries for specialized algorithms.

If you have “specialized algorithms”, you would probably need to write code to handle those in any test runner/test framework ? As @damies13, you can implement such testing code in python, and with remote libraries, in any langugage that can do networking (http) ..

Also, evaluate keyword will allow you to run singleline python code ..

If you just need something where you write everything in python, why not pytest ?

Also, could you describe what you are trying to do here ? Im quite sure there’s someone here who could help you out to streamline that in concrete concepts.

For example, i’ve done full on hardware verification in python where the external python library holds the state of hardware within the object thats implemented in the library and then support keywords that peek & poke into the said hardware while getting a nice RF report and driving the whole test from RF..