How-to test Robot Framework with RCC and Visual Studio Code on Windows using a local user
This article shows how to test a Robot Framework project on Windows using RCC and VS Code with the RobotCode extension.
LAST TESTED ON CHECKMK 2.4.0P9
Testing under a local user account is required because some browsers (e.g., Microsoft Edge) will not run correctly under the default Windows system account.
Background
Synthetic Monitoring integrates Robot Framework into Checkmk for monitoring browser-based tests. Before setting up Robotmk in Checkmk, it is important to validate that the robot project runs correctly on its own:
Dependencies can be installed successfully with RCC.
The robot can be executed manually from Visual Studio Code.
log.htmlis generated and viewable.
This same workflow can also be reused when testing customer-provided robot tests. It helps ensure the robot runs correctly in isolation before troubleshooting issues on the Checkmk agent side.
Step-by-step guide
Step 1: Prepare Windows environment
Set up a Windows test environment (for example, a Windows Server VM created with Vagrant).
Install VSCodium.
VSCodium is a community-driven, freely-licensed binary distribution of Microsoft’s editor VS Code.Install the RobotCode extension in VSCodium.
In Settings, enable Simple Browser to view log.html.
Step 2: Install RCC
Create a
binfolder in your user directory, e.g.: C:\Users\myuser\binDownload the latest RCC binary from Robocorp RCC
Due to their EULA, these binaries can only be used by individuals and not by companies.
Place the binary inside the
binfolder.Add the bin folder to the User PATH environment variable.
Step 3: Create robot project folder
In Documents, create a new folder (e.g.,
C:\Users\myuser\Documents\checkmk_ui_login)Inside the folder, add the following files:
robot.yamlconda.yamlregular_test.robot(sample test file)
Attachments (sample project files): checkmk_ui_login.7z
Note: In the search.robot sample test file, update the following to match your environment:
${URL}${USERNAME}${PASSWORD}
If these values are not updated, the robot test will fail during login.
Step 4: Initialize the environment
Open a Command Prompt in the project folder.
Run: rcc task shell
This prepares the Python environment and initializes the browser driver.
Step 5: Open and test with Visual Studio Code
Open a Command Prompt in the project folder and run "codium ."
In VSC:
Open the
regular_test.robotfile.Run the test directly using the RobotCode extension.
Step 6: Validate results
After execution, confirm that:
The test runs successfully.
log.htmlis generated.Open
log.htmlusing VSC Simple Browser.
Related articles
Robotmk Documentation on GitHub