jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From umesh prajapati <praumes...@gmail.com>
Subject Re: Assertion During Load Test
Date Sun, 23 Jun 2013 02:32:21 GMT
Hi sebb,

I solved the issue ...i had a space at the end of each hash string :)


On Sat, Jun 22, 2013 at 4:40 PM, umesh prajapati <praumesh86@gmail.com>wrote:

> hi sebb,
>
> I think i got all figured out now...but the assertion is not coming true
>
> I get this error
> Assertion error: false
> Assertion failure: true
> Assertion failure message: Test failed: text expected to equal /
> ****** received  : 45f104f488d47bcd28ac84bcf905ec6c[[[ ]]]
>
> ****** comparison: 45f104f488d47bcd28ac84bcf905ec6c[[[ ]]]
> so these are hash string and even they are equal its not asserting true.
>
> I tried all of them contain, matches, equal and they all give assetsion
> false
>
>
> On Sat, Jun 22, 2013 at 11:06 AM, umesh prajapati <praumesh86@gmail.com>wrote:
>
>>
>> I think a better way to ask would be. How can I save the response (save
>> response as MD5 hash) into one single file during the first test for all
>> the users. For example save response to file called outputResult.txt.
>>
>> Inside outputResult.txt file it will contain
>> abdcdefg
>> adf12abd
>> saacaw2
>>
>> During second test
>> So now I can use CSV to read each hash and add response assertions to
>> make sure the response matches. for example:
>> In CSV mention the filename: output.txt
>>                           variablename:data
>>
>> and In response assertion:
>>
>>                             pattern to test:${data}
>>
>>
>> On Sat, Jun 22, 2013 at 10:11 AM, umesh prajapati <praumesh86@gmail.com>wrote:
>>
>>> sorry, I mean It created total of 10 files for 5 users.
>>>
>>>
>>> On Sat, Jun 22, 2013 at 10:07 AM, umesh prajapati <praumesh86@gmail.com>wrote:
>>>
>>>> Thank you again, yes you are right, the response body is now the hash.
>>>> But I am not being able to figue out how I can assert them.
>>>> Lets take an example:
>>>> I run the test for 5 users with 5 seconds interval
>>>> I have the option checked "save as MD5 hash" on http sampler GUI
>>>> I have save response to file ( where I mentioned to save file in
>>>> "c:\Output\result")
>>>>
>>>> After I run this test, I see that it creates 10 files for each users
>>>> and the file contains hash(because response body is now the hash)
>>>> result1.unknown
>>>> result2.json
>>>> result3.unknown
>>>> result4.json
>>>> .....
>>>> result10.json
>>>>
>>>> Now when I do my load test for same 5 users with no interval
>>>> I add response assertion
>>>> After I add response assertion, I am not being able to figure out how
>>>> can i assert the response I am getting during load test with previous
>>>> response. Since it is creating multiple files.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Sat, Jun 22, 2013 at 9:47 AM, sebb <sebbaz@gmail.com> wrote:
>>>>
>>>>> On 22 June 2013 17:04, umesh prajapati <praumesh86@gmail.com> wrote:
>>>>> > Thank you again, ok I have checked the "save response as MD5 hash?
>>>>> >
>>>>> > After that i ran the test plan once
>>>>> >
>>>>> > Now I am trying to add response assertion to check that the response
>>>>> > returned during the first run and the second run matches. But when
I
>>>>> add
>>>>> > "response assertion", I dont see an option to check the hash.
>>>>> >
>>>>> > I see : apply to:
>>>>> >            response field to Test:
>>>>> >            pattern matching rules:
>>>>> >            pattern to test:
>>>>>
>>>>> The response body is now the hash; you need to match that. Since it is
>>>>> fixed, you can use string matching.
>>>>>
>>>>> >
>>>>> >
>>>>> >
>>>>> >
>>>>> > On Sat, Jun 22, 2013 at 8:48 AM, sebb <sebbaz@gmail.com> wrote:
>>>>> >
>>>>> >> On 22 June 2013 16:39, umesh prajapati <praumesh86@gmail.com>
>>>>> wrote:
>>>>> >> > Thank you very much for a quick response. Ok , i am trying
to
>>>>> follow the
>>>>> >> > 2nd step that you have mentioned which is add save response
as
>>>>> MD5 hash?
>>>>> >> > But I am being unable to find that option.
>>>>> >> >
>>>>> >> > Like you have mentioned. I have to run the test once to
be able
>>>>> to get
>>>>> >> that
>>>>> >> > option. So I ran the test once. and I right click on Http
Sampler
>>>>> and
>>>>> >> > clicked ADD and I checked on all of them but was unable
to locate
>>>>> save
>>>>> >> > response as MD5 hash.
>>>>> >>
>>>>> >> Bottom right of HTTP Sampler GUI.
>>>>> >>
>>>>> >> > I do see MD5Hex Assertion under Assertion. I am not sure
if this
>>>>> is the
>>>>> >> one
>>>>> >> > your talking about.
>>>>> >>
>>>>> >> Yes, for one of the possible options.
>>>>> >>
>>>>> >> >
>>>>> >> >
>>>>> >> > On Sat, Jun 22, 2013 at 8:22 AM, sebb <sebbaz@gmail.com>
wrote:
>>>>> >> >
>>>>> >> >> On 22 June 2013 16:02, umesh prajapati <praumesh86@gmail.com>
>>>>> wrote:
>>>>> >> >> > I would really appreciate if i could get some
help on
>>>>> assertion.
>>>>> >> >> >
>>>>> >> >> > For example:
>>>>> >> >> > I have 100 users to test.
>>>>> >> >> > I run the test for 100 user in 5 seconds interval
and save the
>>>>> >> >> > response in to a file.
>>>>> >> >> >
>>>>> >> >> > Now, I would like to do a load test with the same
100 users
>>>>> without 5
>>>>> >> >> > seconds interval
>>>>> >> >> > How can I use assertion or how can i assert that
the response
>>>>> I am
>>>>> >> >> > getting now during the load test matches or contains
the same
>>>>> data
>>>>> >> >> > before.(that was saved to a file)
>>>>> >> >>
>>>>> >> >> That's not possible currently in JMeter.
>>>>> >> >>
>>>>> >> >> Why not save the response files in two separate directories
and
>>>>> the
>>>>> >> >> use a standard compare tool?
>>>>> >> >>
>>>>> >> >> Alternatively, if you are looking for an *exact* match,
you
>>>>> could use
>>>>> >> >> the "Save response as MD5 hash?" option in the HTTP
Sampler, and
>>>>> add
>>>>> >> >> an assertion to check that the response body is as
expected. You
>>>>> would
>>>>> >> >> have to run the test once to get the hashes, and then
add a
>>>>> Response
>>>>> >> >> Assertion to check the hash. You could then re-run
with different
>>>>> >> >> settings for delays etc.
>>>>> >> >>
>>>>> >> >> If you want to still store the result, you could replace
the
>>>>> Response
>>>>> >> >> Assertion with MD5 Assertion; of course then you need
to uncheck
>>>>> the
>>>>> >> >> "Save response as MD5 hash?" option as you want the
hash of the
>>>>> sample
>>>>> >> >> response not the hash of the hash created by the sampler.
If you
>>>>> see
>>>>> >> >> what I mean.
>>>>> >> >>
>>>>> >> >> > Another thing that I noticed was, when I use save
response to
>>>>> a file.
>>>>> >> >> > It saves each user response to separate file.
Is there a way
>>>>> that I
>>>>> >> >> > can save all the user response to one single file
>>>>> >> >>
>>>>> >> >> You can configure Listeners to save the response data;
it's not
>>>>> the
>>>>> >> >> default because of the likely size and resources needed
to do so.
>>>>> >> >>
>>>>> >> >> > and later when I run
>>>>> >> >> > the load test assert the response with that single
file.
>>>>> >> >>
>>>>> >> >> No.
>>>>> >> >>
>>>>> >> >> But you could configure a listener to save as XML and
only
>>>>> enable the
>>>>> >> >> response data.
>>>>> >> >> Then compare output from test runs.
>>>>> >> >>
>>>>> >> >>
>>>>> ---------------------------------------------------------------------
>>>>> >> >> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>>>>> >> >> For additional commands, e-mail: user-help@jmeter.apache.org
>>>>> >> >>
>>>>> >> >>
>>>>> >>
>>>>> >>
>>>>> ---------------------------------------------------------------------
>>>>> >> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>>>>> >> For additional commands, e-mail: user-help@jmeter.apache.org
>>>>> >>
>>>>> >>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>>>>> For additional commands, e-mail: user-help@jmeter.apache.org
>>>>>
>>>>>
>>>>
>>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message