System command in k6 script


I just wanted to know if it was possible to execute shell command in a k6 script, for example there is a python script that i want to execute before because i need the data that he gives me.

Thanks for your your replies

You can’t execute shell commands from inside of a k6 script, for security reasons, and because we want k6 scripts to be reusable between the local, cloud, and future native distributed execution.

I’d suggest instead using a simple bash/powershell/etc. script that first calls the python script, saves its data in a .json file (which k6 can open()) or an environment variable, and then calls k6.