Error message running tests on my pycharm

Hi, i have tried several times to run tests on my pycharm IDE but i keep getting this error message
"robot : The term ‘robot’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:1 char:1

  • robot -d Results Tests/Login_test_scenarios.robot
  •   + CategoryInfo          : ObjectNotFound: (robot:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException"
    
    

what can i do?

1 Like

robot.exe is probably not in your PATH. The recommended way of running robot (and really any Python modules) is to use python -m robot, so in your case python -m robot -d Results Tests/Login_test_scenarios.robot.

1 Like

Thanks so much it helped a lot. i can now run my tests successfully. I really appreciate your help.
But just out of curiosity how can i add the robot.exe to my PATH?

Thanks so much it helped a lot. i can now run my tests successfully. I really appreciate your help.
But just out of curiosity how can i add the robot.exe to my PATH?

Setting you path to include robot.exe will depend on your OS (Windows?) and where python and robot are installed on you machine.

For example, on my mac the robot executable is here /Library/Frameworks/Python.framework/Versions/3.9/bin/robot

If you used pip to install robot framework it’ll probably be somewhere in the python directory, find that location and note it down.

Then search how to add to the path for your operating system and add the directory you just noted down from above.

Hope that helps,

Dave.

Thanks, this really helped.

Hi,

I have similar issue, I am trying to run the robot tests on my VScode IDE but i keep getting this error message( In windows).

robot : The term ‘robot’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • robot -d results tests/test.robot
  •   + CategoryInfo          : ObjectNotFound: (robot:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    
    

Can someone help.

Try adding “python -m” at the beginning of your terminal command.

For example

python -m robot -d results tests/test.robot

Let me know if this helps.

This is what I used for VSCODE.