Repository navigation
[BUG] Several paths for *.robot files causes error #646
Description
##################### Steps to reproduce ##################
- Execute the attached setup.bat to create a minimal RobotCode project.
- Open the generated folder in VS Code.
- Open the Testing view.
Expected behavior
Both test roots are discovered and tests can be executed.
Actual behavior
Discovery works correctly.
robotcode discover all
returns:
Path1 & Path2
├─ Path1
└─ Path2
However execution fails:
- If a test from Path1 is started:
Suite 'Path2' contains no tests or tasks. - If a test from Path2 is started:
Suite 'Path1' contains no tests or tasks.
The problem occurs when multiple entries are configured in:
paths = [
"Tests/path1",
"Tests/path2",
]
With only a single path configured, test execution works correctly.
##################### setup.bat ########################
echo Creating virtual environment...
if not exist ".venv" (
python -m venv .venv
)
echo Creating .robot.toml...
if not exist ".robot.toml" (
(
echo output-dir = "results"
echo.
echo paths = [
echo "Tests/path1",
echo "Tests/path2",
echo ]
) > .robot.toml
)
echo Creating test directories...
if not exist "Tests" mkdir Tests
if not exist "Tests\path1" mkdir Tests\path1
if not exist "Tests\path2" mkdir Tests\path2
echo Creating suite1.robot...
if not exist "Tests\path1\suite1.robot" (
(
echo *** Settings ***
echo.
echo.
echo *** Test Cases ***
echo Suite 1 test 1
echo Log Suite 1 test 1
echo.
echo Suite 1 test 2
echo Log Suite 1 test 2
) > Tests\path1\suite1.robot
)
echo Creating suite2.robot...
if not exist "Tests\path2\suite2.robot" (
(
echo *** Settings ***
echo.
echo.
echo *** Test Cases ***
echo Suite 2 test 1
echo Log Suite 2 test 1
echo.
echo Suite 2 test 2
echo Log Suite 2 test 2
) > Tests\path2\suite2.robot
)
echo Creating VS Code settings...
if not exist ".vscode" (
mkdir .vscode
)
if not exist ".vscode\settings.json" (
(
echo {
echo "python.defaultInterpreterPath": "${workspaceFolder}/.venv/Scripts/python.exe"
echo }
) > .vscode\settings.json
)
echo Activating virtual environment...
call .venv\Scripts\activate.bat
echo Updating pip...
python -m pip install --upgrade pip
echo Installing Robot Framework...
pip install robotframework==7.0
echo Installing RobotCode...
pip install robotcode==0.87.0
pip install robotcode-runner==0.87.0
echo Installing VS Code extensions...
code --install-extension ms-python.python --force
code --install-extension d-biehl.robotcode --force
echo.
echo ==========================================
echo Setup complete.
echo ==========================================
echo.
echo Next steps:
echo.
echo code .
echo.
echo Open the Testing view and run one of the tests.
echo.
echo Expected behaviour:
echo Discovery works:
echo Path1 ^& Path2
echo.
echo Running a test fails:
echo Suite 'Path1' contains no tests or tasks.
echo or
echo Suite 'Path2' contains no tests or tasks.
echo.
echo Verify discovery with:
echo.
echo robotcode discover all
echo.
pause
Activity
Lakitna commentedon Aug 20, 2026
You didn't use a code block for the code here. Because of this, any significant whitespace has disappeared. You can create a code block like this:
Details: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax
Please provide the code again, but this time using a code block :)
AlexanderFerderer commentedon Aug 24, 2026
Steps to reproduce
Execute the attached setup.bat to create a minimal RobotCode project.
Open the generated folder in VS Code.
Open the Testing view.
Expected behavior
Both test roots are discovered and tests can be executed.
Actual behavior
Discovery works correctly.
robotcode discover all
returns:
Path1 & Path2
├─ Path1
└─ Path2
However execution fails:
If a test from Path1 is started:
Suite 'Path2' contains no tests or tasks.
If a test from Path2 is started:
Suite 'Path1' contains no tests or tasks.
The problem occurs when multiple entries are configured in:
paths = [
"Tests/path1",
"Tests/path2",
]
With only a single path configured, test execution works correctly.
setup.bat
Lakitna commentedon Sep 1, 2026
Robot framework is a whitespace sensitive language. Your script contains none of the required indentation whitespace. This causes your generated files to have syntax errors.
RobotCode parses your files, so when it encounters these kinds of syntax errors, it can't continue.
d-biehl commentedon Sep 3, 2026
see here: #348 and here robotframework/robotframework#4289
this is a robot problem, maybe you can report it there?
the simplest solution for this is:
And sorry for the late reply. I was on vacation first and then spent a few more days in the hospital. I only got back today and need some time to recover.