itsme017
itsme017

Reputation: 87

What types of assertions should I set to know if my script is working?

New to performance testing and using JMeter,

I’ve made a script for performance testing a CRM application and testing the ui when it encounters multiple API calls concurrently.

My question is, are there any best practices for types of assertions I should be setting to make sure everything is working fine in my script?

For example something’s I have done is checking for response codes in one request that check a 303,307,200 response code to make sure it’s returning what it’s suppose to.

Including data(bytes) sent etc

Basically I’m trying to see other use cases for what else assertions can do.

My biggest thing is seeing that it’s returning the correct body response and does it in the correct order but I’m trying to see is this “really” the correct workflow? I’m just trying to prove how I know the test is doing what it’s suppose to be doing and being new to performance testing makes me unsure.

Upvotes: 0

Views: 40

Answers (1)

Ivan G
Ivan G

Reputation: 2872

As per JMeter Best Practices you should use as little assertions as possible so from performance testing point of view you should not use assertions as they have their cost and it means that in case of higher loads you will need to switch to distributed testing sooner

From functional testing perspective you can test that:

  • response contains anticipated data
  • response does not contain errors/exceptions
  • response status code
  • response message
  • response size
  • response time
  • in case of testing APIs you can check whether this or that attribute is present and additionally compare its value with the anticipated

More information: How to Use JMeter Assertions in Three Easy Steps

Upvotes: 0

Related Questions