Alla is a developer for Broadcom's Taurus and has 2 years of experience with Python.

Become a JMeter and Continuous Testing Pro

Start Learning
Slack

Test Your Website Performance NOW! |

arrowPlease enter a URL with http(s)
Aug 03 2021

How to Run a K6 Load Test in BlazeMeter with Taurus

BlazeMeter allows users to run K6-based test suites through Taurus. By tracking their test results in BlazeMeter, K6 users can identify regressions and new problems, so they can resolve performance bottlenecks before releasing a new version into production. This blog post will explain how to easily run your K6 test in BlazeMeter with just a few steps.

Getting Started with K6 and BlazeMeter

K6 is one of many open-source load testing tools that is supported as an executor in BlazeMeter, through Taurus. The Open Source test automation framework Taurus consumes configuration files written in JSON or YAML, and it can reference K6 scripts written in JavaScript. The K6 test creation is quite similar to creating a Taurus Test, so if this is your first time executing a K6 script with BlazeMeter, I recommend reading that article for more information, too.

 

1. Create your K6 configuration script.



This is ours, k6_example.js. It is just a simple example of the K6 file structure that demonstrates how to open a web page. You will replace this file with one of your existing K6 scripts.

 

import http from 'k6/http';
import { sleep } from 'k6';

export default function () {
  http.get('https://blazedemo.com/');
  sleep(1);
}

 

2. Write your Taurus test in a text editor. You can learn more about Taurus testing here, or you can just use this example script with the simplest configuration as a template:

 

execution:
- executor: k6
  concurrency: 100
  hold-for: 1m
  scenario: simple

scenarios:
  simple: 
    script: k6_example.js


 

Make sure to set the executor name to ‘K6’. Here I set the number of concurrent users to 100 and the test will run for one minute. You can set those two parameters to any numbers of your choice. And don’t forget to put your K6 script name (here k6_example.js) into the scenario section of the file. 

 

3. Save this code in a YAML file, here we will save it as ‘k6_example.yml’.

 

4. Make sure you have both files - the Taurus test and the K6 script. These two files are necessary for the performance test run.

 

5. Log on to https://a.blazemeter.com. You can create a free account if you don’t have one.

 

6. Create a new Performance Test by clicking on “Performance” -> Create Test -> Performance Test.

 

 

7. Upload both files. For more details, please see the guide Creating a Taurus Test.

 

8. After the files are uploaded, the ‘Scenario Definition’ section should look like this:

 

 

9. Click 'Run Test' on the left side and wait for it to finish.

 

10. After the test is done, you will see results in the table form similar to the following screenshot:

 

 

And that’s it! Get started with BlazeMeter today by clicking here.

 

   
arrowPlease enter a URL with http(s)

You might also find these useful:

Interested in writing for our Blog?Send us a pitch!