Passing false positive API functional test

book

Article ID: 224873

calendar_today

Updated On:

Products

BlazeMeter

Issue/Introduction

Sometimes you want a test to pass even though one of the API calls fails, e.g. with a 'Bad Gateway' error. The assertion has been setup properly to catch the error but still the test fails. How to overcome this.

 

 

 

Cause

An API Functional test results in a JMeter script to be created. It is contained in the Artifacts.zip that is downloadable from your test result. If you open it and verify the assertion you see:

https://api-broadcom-ca.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=MjdkkW/7KgE0Qji4ZvMT2Q==

As you can see, the Ignore Status field is not checked. Here is what JMeter says about that field:

https://api-broadcom-ca.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=a7OeQMVvq+g6dIlJta6Gag==

It would have to be enabled in order for the sampler to be marked as successful if the assertion passes (which it did).

 

Environment

BLAZEMETER FUNCTIONAL TESTING

Resolution

There is no option that lets you enable the "ignore status" field in the API Functional GUI. The only way to achieve it would be to switch to the editor"

(</> instead of UI) and modify the generated Taurus yml: in the assert

https://api-broadcom-ca.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=5Zy7xy4d37jK1P3q2O5woA==

you would need to add the 'assume-success: true' attribute as described in this article.