Reputation: 35
For a JSON assertion in JMeter 4.0, the expected and actual values are the same. But, in the JSON Assertion Result, it says it doesn't match. This was even compared in Excel to check for any spaces or additional characters and was found to match. Not sure why the assertion fails here in JMeter.
E.g.:
Assertion failure message: Value expected to match regexp '2019-03-25T16:06:36.162+0000', but it did not match: '2019-03-25T16:06:36.162+0000'
Upvotes: 0
Views: 587
Reputation: 168082
If you don't use a Regular Expression for data validation and it is rather a normal String - just untick 'Match as regular expression` box
If 2019-03-25T16:06:36.162+0000
is a regular expression - it is malformed as you need to escape the +
sign with a backslash as +
is a meta-character which needs to be escaped:
According to JMeter Best Practices you should always be using the latest version of JMeter so consider upgrading to JMeter 5.1 (or whatever is the latest version available at JMeter Downloads page)
Upvotes: 2
Reputation: 91
Do you have the option 'Match as regular expression' checked? If so, then you would need to escape the regular expression special characters (. and +) and replace your assertion value with 2019-03-25T16:06:36\.162\+0000
Upvotes: 1