File or directory to execute does not exist

When I try the following edited for my host, username and password saved as test_ssh_rf_demo.robot I get “[ ERROR ] Parsing ‘test_ssh_rf_demo.robot’ failed: File or directory to execute does not exist”.

It is being run on a Windows 11 PC with PyCharm IDE and the target is my Raspberry Pi 3B. SSH is setup on the 3B and it is updated.

*** Settings ***
Documentation Robot Framework test script
Library SSHLibrary
*** Variables ***
${username} root
${password} ${EMPTY}
${alias} remote_host_1
*** Test Cases ***
Test SSH Connection
Open Connection ${host} alias=${alias}
Login ${username} ${password} delay=1
Execute Command hostname
Close All Connections

It is difficult to understand at what step the error happens.

Are you running robot from the command line?

You can use the option --loglevel TRACE to see where the error exists.

Still learning so not sure where in the command to place that
PS C:\Development\robot-scripts\pythonProject\IOT> robot -d results test_ssh_rf_demo.robot

Options are always passed before the test suites. In your case would be:

robot -d results --loglevel TRACE test_ssh_rf_demo.robot

Then in the resulting log,html you will have the log level selector on the top right.

Ran it
PS C:\Development\robot-scripts\pythonProject\IOT> robot -d results --loglevel TRACE test_ssh_rf_demo.robot
[ ERROR ] Parsing ‘test_ssh_rf_demo.robot’ failed: File or directory to execute does not exist.

Try --help for usage information.
PS C:\Development\robot-scripts\pythonProject\IOT>

But the only log in the results folder is an old one for RaspberryPi3B Log

You may be missing the directory where the test suite is, if like the old test report. So this may be the correct command:

robot -d results .\tests\test_ssh_rf_demo.robot
1 Like

Hi Gordon,

To elaborate on what @HelioGuilherme66 said, robot is complaining it can’t find a file or folder called test_ssh_rf_demo.robot in the current directory (C:\Development\robot-scripts\pythonProject\IOT ?)

  • Is test_ssh_rf_demo.robot in that directory?
  • in the C:\Development\robot-scripts\pythonProject\IOT\tests directory like RaspberryPi3B.robot
  • in another directory?

Hope that helps,


Looks like it was a path issue

**PS C:\Development\robot-scripts\pythonProject\IOT> robot -d results .\tests\test_ssh_rf_demo.robot **
Test Ssh Rf Demo :: Robot Framework test script
Test SSH Connection | PASS |
Test Ssh Rf Demo :: Robot Framework test script | PASS |
1 test, 1 passed, 0 failed
Output: C:\Development\robot-scripts\pythonProject\IOT\results\output.xml
Log: C:\Development\robot-scripts\pythonProject\IOT\results\log.html
Report: C:\Development\robot-scripts\pythonProject\IOT\results\report.html
PS C:\Development\robot-scripts\pythonProject\IOT>

Thank you for the help!