Robot Framework - "No keyword with name 'Run Process' found" while Process library included

Viewed 3021

I'm trying to understand how Robot Framework is working. So I did a little test using both those files:

• hello.py

print('Hello')

• TC_Hello.robot

*** Settings ***
  Library  Process

*** Test Cases ***
Example of running a python script
  ${result}=  Run Process  python  D:\\RobotFrameworkTest\\Hello\\hello.py
  Should be equal as strings  ${result.stdout}  Hello

But I get the error No keyword with name 'Run Process' found for some reasons. So I checked SO and people seem to forget to include the library which is not my case.

Can anyone help me?

-- EDIT

I've tried running the robot file with another syntax which seem to run successfully for some reasons :

*** Settings ***
| Library | Process

*** Test Cases ***
| Example of running a python script
| | ${result}= | run process | python | D:\\RobotFrameworkTest\\Hello\\hello.py
| | Should be equal as strings | ${result.stdout} | Hello

BUT my employer don't like this syntax soooo...

2 Answers

-- RESOLVED

So I noticed I put a tab right before the Library Process in the settings section. Therefore, Process was never included and the error was triggered.

This is working :

*** Settings ***
Library  Process # No tab at the beginning here

*** Test Cases ***
Example of running a python script
  ${result}=  Run Process  python  D:\\RobotFrameworkTest\\Hello\\hello.py
  Should be equal as strings  ${result.stdout}  Hello

I feel dumb rn. Thanks for your help anyway.

Try the below sample code once, have "hello.py" in the test case path. If it is in test case path,you no need to give full path. It's working fine.

Only change is file is place in testcase path.

Version: Robot Framework 3.1.2 (Python 3.8.0 on win32)

*** Settings ***
Library           Process

*** Test Cases ***
Example of running a python script
    [Tags]    Test
    ${result}=    Run Process     python     hello.py
    Log    all output: ${result.stdout} 
    Should be equal as strings  ${result.stdout}  Hello

enter image description here

Related