Can I run python script with test using k6 tool?

1.4k Views Asked by At

I have a script in python with 1 test in it. The test calls other functions from different class in the project which generate differeydata each time to be send through the post request in the test. I want to run this test using the k6 tool, for 5 users for example. Is it possible? Or only Javascript

1

There are 1 best solutions below

0
On

As of current version 0.42.0 it doesn't seem to be possible. If your machine has an SSH server running you can go for xk6-ssh extension to connect to the machine where your python script lives and run it.

Alternatively you can come up with your own k6 extension allowing execution of local commands.

However I don't think it's a viable approach because you're unlikely to get good results and metrics.

Maybe it worth considering migrating to Locust tool which is Python-based so you can write a Locustfile around your Python script logic and it will be executed with the given number of virtual users.

Check out What Is Locust Load Testing? for more information if needed.