Start Testing

Close form

Please keep me informed about Radview news and offers

Please complete all fields.

Thank you for
downloading WebLOAD

Check Your Inbox For WebLOAD!
A mail is on its way to you
with the download link, as well
as installation instructions.

Request a Quote

Close form

Please keep me informed about Radview news and offers

Please complete all fields.

Thanks for your
interest in WebLOAD!

We will get back to you shortly.
Meanwhile, we invite you to
learn more about performance
testing on our RadView Blog

Free

Close form

Please keep me informed about Radview news and offers

Please complete all fields.

Thank you for
downloading WebLOAD

Check Your Inbox For WebLOAD!
A mail is on its way to you
with the download link, as well
as installation instructions.

Standard

Close form

Please keep me informed about Radview news and offers

Please complete all fields.

Thanks for your
interest in WebLOAD!

We will get back to you shortly.
Meanwhile, we invite you to
learn more about performance
testing on our RadView Blog

Premium

Close form

Please keep me informed about Radview news and offers

Please complete all fields.

Thanks for your
interest in WebLOAD!

We will get back to you shortly.
Meanwhile, we invite you to
learn more about performance
testing on our RadView Blog

How to Automate Load Testing for DevOps using the WebLOAD API

Webload-APIAutomating load testing and integrating it with other processes is becoming more and more common. WebLOAD lets you automate load tests and build continuous integration processes with tools like Jenkins and Bamboo, but in some cases, you may need additional flexibility to accommodate other environments or needs.

WebLOAD resolves this with an open API, which lets you execute sessions, prepare reports, access data, etc.

 

The WebLOAD Open API

The API provides a dynamic explanation and is accessible via the WebLOAD Dashboard, using the link:

https://{server_address}:8080/api-docs/docs.html

Of course, replace ‘{server_address}’ with your server name.

WebLOAD-API

 

Click any of  the links to view the relevant API for running sessions, preparing reports, getting results, etc.

 

WebLOAD-API2

Each API can be created easily using the UI, as seen below:

 

WebLOAD-API3

Use Case Example

Assume you run a Load Testing session, access to data and create a report using automation only. The session runs in a context of a UNIX script, but it can be converted to other programming languages based on your needs.

Start a new session from a template ‘my.tpl’ and store the results in ‘out.ls’
curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' -d 'template=my.tpl&lsName=out.ls&responseTimeout=60' 'https://localhost:8080/api/session'

Sample response:

{

  "code": "STARTED",

  "response": "New Session started.session/23",

  "sessionid": "23"

}

 

Check the status of the session by extracting the session-id from the above, for example using:
sid = `sed -n 's/.*"sessionid": "\([0-9]*\).*/\1/p'`
Get the session details:
curl 'https://localhost:8080/api/session/${sid}'

Which will become in your script:

curl 'https://localhost:8080/api/session/23'

Sample response:

{

  "sessionId": 23,

  "reportResolution": 20,

  "startTime": 1494856676000,

  "endTime": 1494856776000,

  "path": "c:\\temp\\out.ls.ls",

  "returnCode": "Test passed",

  "failedReason": "Test passed",

  "text": "out.ls"

}
Get data for the session — for example, get the load-size.

The ‘target’ will be ‘Total.Performance Measurements.Load Size’:

curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' -d 'target=Total.Performance%20Measurements.Load%20Size&sessionid=23' 'https://localhost:8080/api/render'

Sample response:

[

  {

    "target": "Load Size",

    "datapoints": [

      [

        5,   //load size

        1494856696000 //timestamp

      ],

      [

        10,

        1494856716000

      ],

    ….
Generate an Analytics report using the Summary Portfolio for the session:
Curl 'https://localhost:8080/api/analytics?sessionid=23&portfolio=Summary%20Portfolio&format=PDF&name=Report'