How did you checkout/clone/pull the repository to your hard disk? Are you using git submodules? Where are the .git folders located?
RobotCode attempts to detect a project’s root folder based on several criteria, which is independent of the workspace opened in VSCode. The detection prioritizes what it finds first:
- A
robot.tomlfile - A
pyproject.tomlfile - Version control markers (like
.gitor.hgfolders)
If none of these are found, the current folder becomes the project folder. Note that the .git folder is where git stores repository information.
I suspect you have .git folders in both your FW-TEST-RESOURCES folder and your git folder. This creates a conflict where:
- RobotCode Runner uses
FW-TEST-RESOURCESas the root folder for test execution - The language server component uses the
gitfolder’s.gitdirectory (since that’s what’s opened in VSCode)
Two possible solutions:
Option 1: Open FW-TEST-RESOURCES directly in VSCode instead of the git folder. However, this means you won’t have access to your framework files in the workspace.
Option 2: Create or modify a launch.json configuration:
If you already have a launch.json, remove all RobotCode-related configurations, then add:
{
"name": "RobotCode: Default",
"type": "robotcode",
"request": "launch",
"presentation": {
"hidden": true
},
"purpose": "default",
"robotCodeArgs": [
"--no-vcs"
]
}
- The
"purpose": "default"setting makes this the default configuration for running tests with RobotCode (can be extended/overridden by other configs) - The
--no-vcsflag disables.gitdirectory detection for the RobotCode runner (this doesn’t affect the language server or discovery features, which use VSCode’sworkspaceFolder)
Additional recommendation:
After implementing the above changes, consider creating a robot.toml configuration file in your project root:
paths = ["FW-TEST-RESOURCES/test_cases"]