0
votes

How to hardcode the value in JMeter? We need to hardcode field value for each request. Than after the response I need to crosscheck if the response are exactly matching the with the hard coded one. after that only we will be passing the test case. using Beanshell postprocessor

1
as off now I am just making request and getting the response and writing it to another CSV. But our ultimate goal is before writing we need to validate each field of that request . with the predefined value (that we need to hardcode). - Ghosh Banti

1 Answers

0
votes

If you want to match the response against "reference" value the best option is using JMeter Assertions, to wit Response Assertion.

If your assertion logic is more complex than equals/contains/matches which can be implemented using the Response Assertion - be aware that since JMeter 3.1 it's recommended to use JSR223 Elements and Groovy language for any form of scripting so my expectation is that you should go for JSR223 Assertion instead.