# File or directory to execute does not exist

**URL:** <https://forum.robotframework.org/t/file-or-directory-to-execute-does-not-exist/5801>\
**Category:** SSHLibrary\
**Created:** [8 June 2023 19:40 UTC](https://forum.robotframework.org/t/file-or-directory-to-execute-does-not-exist/5801 "2023-06-08T19:40:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gordongilbert](https://avatars.discourse-cdn.com/v4/letter/g/9de0a6/32.png) [@gordongilbert](https://forum.robotframework.org/u/gordongilbert)\
**Post date:** [8 June 2023 19:40 UTC](https://forum.robotframework.org/t/file-or-directory-to-execute-does-not-exist/5801/1 "2023-06-08T19:40:59Z")

</div>

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 \*\*\*  
${host} 192.168.120.141  
${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

---

<div class="post-metadata">

**Author:** ![HelioGuilherme66](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/helioguilherme66/32/34_2.png) [@HelioGuilherme66](https://forum.robotframework.org/u/HelioGuilherme66)\
**Post date:** [8 June 2023 19:56 UTC](https://forum.robotframework.org/t/file-or-directory-to-execute-does-not-exist/5801/2 "2023-06-08T19:56:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gordongilbert](https://avatars.discourse-cdn.com/v4/letter/g/9de0a6/32.png) [@gordongilbert](https://forum.robotframework.org/u/gordongilbert)\
**Post date:** [8 June 2023 20:41 UTC](https://forum.robotframework.org/t/file-or-directory-to-execute-does-not-exist/5801/3 "2023-06-08T20:41:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![HelioGuilherme66](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/helioguilherme66/32/34_2.png) [@HelioGuilherme66](https://forum.robotframework.org/u/HelioGuilherme66)\
**Post date:** [8 June 2023 20:45 UTC](https://forum.robotframework.org/t/file-or-directory-to-execute-does-not-exist/5801/4 "2023-06-08T20:45:37Z")

</div>

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

```python
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.

---

<div class="post-metadata">

**Author:** ![gordongilbert](https://avatars.discourse-cdn.com/v4/letter/g/9de0a6/32.png) [@gordongilbert](https://forum.robotframework.org/u/gordongilbert)\
**Post date:** [8 June 2023 22:13 UTC](https://forum.robotframework.org/t/file-or-directory-to-execute-does-not-exist/5801/5 "2023-06-08T22:13:34Z")

</div>

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

| Full Name: | RaspberryPi3B |
| --- | --- |
| Source: | C:\Development\robot-scripts\pythonProject\IOT\tests\RaspberryPi3B.robot |

---

<div class="post-metadata">

**Author:** ![HelioGuilherme66](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/helioguilherme66/32/34_2.png) [@HelioGuilherme66](https://forum.robotframework.org/u/HelioGuilherme66)\
**Post date:** [8 June 2023 23:01 UTC](https://forum.robotframework.org/t/file-or-directory-to-execute-does-not-exist/5801/6 "2023-06-08T23:01:37Z")

</div>

> [@gordongilbert](#):
>
> robot -d results --loglevel TRACE test\_ssh\_rf\_demo.robot

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

```python
robot -d results .\tests\test_ssh_rf_demo.robot

```

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [8 June 2023 23:46 UTC](https://forum.robotframework.org/t/file-or-directory-to-execute-does-not-exist/5801/7 "2023-06-08T23:46:06Z")

</div>

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,

Dave.

---

<div class="post-metadata">

**Author:** ![gordongilbert](https://avatars.discourse-cdn.com/v4/letter/g/9de0a6/32.png) [@gordongilbert](https://forum.robotframework.org/u/gordongilbert)\
**Post date:** [9 June 2023 00:12 UTC](https://forum.robotframework.org/t/file-or-directory-to-execute-does-not-exist/5801/8 "2023-06-09T00:12:39Z")

</div>

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!
