Run given process from Terminal using Robot Framework – User friendly Tech help
Problem:- How to execute external files (say test.py) as process using robot framework?
n
nSolution:-
n
nApproach 1 :- Using Run Process keyword, under “Process” library
n
nStep1:- Include “Process” library in settings
n
n
n
Step2:- Use “Run Process” keyword as belown
Comment Using Run Process Keyword
${result} = Run Process python -c print 'Hello, world!'
Should Be Equal ${result.stdout} Hello, world!
Comment Using Run Keyword
${output} Run python ${EXECDIR}/Resources/Lib/data-generator/mqttgen.py 10 10 10
n
nApproach 2 :- Using “Run” keyword under “Operating System” library
n
nStep1:- Include “OperatingSystem” library in settings
nStep2:- Use “Run” process keyword.
n
nExample below we used our test data generator(third party .py file) to be triggered by Robot framework/