'robot is not recognized as an internal or external command'

Viewed 3602

Problem: I am trying to running my Dummy.robot test script in the terminal via cmd line: robot -d results tests/dummy.robot. However, it is returning the error 'robot' is not recognized as an internal or external command. I sensed that perhaps the robotframework was not properly installed or in the correct directory because the keywords "Open Browser" (see below) was already detected as invalid syntax prior to running.

Troubleshooting Methods:

  1. Checked that both robotframework and robotframework-seleniumlibarary were installed
  2. Installed intellibot on PyCharm and restarted IDE
  3. Made sure I provided the correct path to the script within my project directory as shown below.
  4. Checked that Python 39 and Python39/Scripts was added to my PATH although I am not sure if this is relevant because it just allows me to use pip for installing robotframework later.
  5. Selected the interpreter for this "dummy" project from where that python.exe is located.

Source Screenshots:

File Structure

image

Run Config & Updated File Structure (3/8/21)

enter image description here

Source Code

image

Terminal

image

RF Library Location enter image description here

3 Answers

I think, going by your terminal pic, it looks like you have a virtual environment: (base). As @TodorMinakov suggested, fire the command pip list in your terminal path (same path as shown in the pic). If Robot Framework libs exist there, then it should be fine. Then try the command python -m robot -d results tests/dummy.robot But if libs are not in the folder, then you have to do pip install for them from Terminal for right installation (which means, your installed libs are in your native directory while you are working in virtual env).

Since you are working with Pycharm IDE, it is better if you could use its terminal instead of using a command line tool such as bash or command prompt. Try this too.

To check if the libs installed are in System Python, you have to go to your folder site packages (eg: C://Python39/Lib/site-packages), you would find all the natively installed libraries here. In case of virtual environment, you have to check in your present directory (where the code exists). There should be a folder by the name venv (or 'base'), which will comprise of the python paths eg: (venv/Lib/site-packages)

I have experienced the same issue and it was a pip versioning issue. It got resolved after installing the upgraded pip version and then reinstalling the robot framework and Appium library. Thanks

  1. Use the terminal in Admin mode.
  2. pip uninstall robotframework
  3. upgrade pip
  4. again pip install robotframework
Related