0

Baseline: Currently, within a Java environment and Maven integration, we use Cucumber for our API testing procedures inside Junit Test.

This is also well implemented and accordingly everything works.

However, we would now like to measure the respective speed of the APIs and thus the response times.

Also a further planning regarding load and performance testing for the simulation of load and performance is planned.

Example for the current state:

Feature: Test 1

Scenario Outline: Test 1
Given Retrieving Ingresses of Google Environment
Then  response code should be <StatusCode>
Given  <MS_NameAuth> MicroService<MS_RouteAuth> with path<MS_PathAuth>
When  Template Request<RequestFileAuth>
When   User send POST REST request for Creating User<UserName>
Then  response code should be <StatusCode>
Then  save response fields Using JsonUtility
  | $.access_token | subjectToken |
Given  <MicroService> MicroService <MS_Route> with path <MS_Path>
When User send GET request with additional Path<Path>
Then response code should be <StatusCode>
Then Validate response with expected JSON <JsonToCompare> with ignored values

Questions:

  • Is there a direct way within a Junit test including Cucumber integration to do a direct measurement and simulation of load and performance?
  • Is there any way to include Jmeter in Cucumber?
  • Is there any other solution besides Jmeter that we could include as a step in Cucumber?
  • Is it possible to measure individual APIs, e.g. response times?
  • Would integration into a CI be possible?

What would be desirable:

A possibility of a solution that can be extended, at the beginning pure measurements of the response times of an API, but later also complex load and performance tests.

1 Answer 1

2
  • Is there a direct way within a Junit test including Cucumber integration to do a direct measurement and simulation of load and performance?

    There are microbenchmarking libraries like jmh which could be used for running specific Java methods in parallel

  • Is there any way to include Jmeter in Cucumber?

    It's possible to configure and run JMeter tests from Java code using JMeter API, see Five Ways To Launch a JMeter Test without Using the JMeter GUI article for more details. There is also Java DSL for JMeter, it doesn't support everything but it provides nice API for creating and running the tests, it might be sufficient for your needs

  • Is there any other solution besides Jmeter that we could include as a step in Cucumber?

    Depending on what you're trying to achieve you might want to consider running JUnit tests in Parallel, however it won't give you KPIs like concurrency, connect time, response time, etc. which could be provided by JMeter in case of using HTTP Request samplers so you might want to convert your tests to "pure" JMeter by running them via JMeter's HTTP(S) Test Script Recorder

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.