Anonymous
Anonymous

Reputation: 888

JMeter: Assertion Failure Message is displayed for Response Assertion

I am trying Response assertion for the first time, and below error is displayed:

Assertion error: false
Assertion failure: true
Assertion failure message: Test failed: text expected to contain /(?is)<title>Management Information System</title>/

message

What could be the reason for such error?

Upvotes: 1

Views: 16103

Answers (3)

ram
ram

Reputation: 1

In JMETER: There if you see 2 Response Assertion tab then remove one of those Response Assertion which is (Pattern to test) is OK Then try again it will work

Upvotes: 0

Dmitri T
Dmitri T

Reputation: 168072

First assumption: why do you need this (?is) bit? In "Contains" mode Response Assertion should work fine if you remove it.

As per How to Use JMeter Assertions in 3 Easy Steps guide

The Pattern can be either be:

a “string” for “Equals” or “Substring” clauses

a “Perl5-style” Regular Expression for “Contains” or “Matches” clauses

Second assumption: the assertion as per your picture is being applied to all requests, if you want it to be applicable only to one of them move it to be a child of that particular request.

Upvotes: 1

Adrian Panasiuk
Adrian Panasiuk

Reputation: 7343

The Assertion error: false line means that no internal jmeter error occurred.

The Assertion failure: true line means that the assertion condition you set to be checked was false.

The Test failed: text expected to contain /(?is)Management Information System/ line means that you set up the assertion to check if the target of the assertion (most likely the response body) matches to the regexp /(?is)Management Information System/ but it did not.

Upvotes: 3

Related Questions