I was trying different script examples from the Grafana k6 docs pages in k6 Studio. For whatever reason, these two scripts do not complete the Validator process.
Steps to reproduce (using k6 Studio v1.0.2 on Windows 11 Pro):
- Script .JS files listed below saved to local file system.
- Within k6 Studio, click Validate script, click Open external script and select the script.
- These scripts display in the UI under the Script section and are well-formed.
- Click Validate script
Expected results: Validation completes; toast message “Script execution finished” displays; UI is displaying details on request/response data, log data and check results.
Actual results: There is a continuous spinner next to Running and the process never completes; had to click Stop run.
The problem must have something to do with these scripts using the jslib Httpx instead of the native k6 http, because the k6-studio.log file has these entries:
[2025-03-21 01:47:28.238] [error] Unhandled rejection Error: Error invoking remote method 'script:run': Error: http import line not found in script
[2025-03-21 02:00:30.614] [error] Unhandled rejection Error: Error invoking remote method 'script:run': Error: http import line not found in script
[2025-03-21 02:05:18.353] [error] Unhandled rejection Error: Error invoking remote method 'script:run': Error: http import line not found in script
Scripts to reproduce. These will execute properly with the latest k6 binary.
- Httpx library example
- API CRUD Operations, httpx and k6chaijs example