You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Lionel Blanco <ml...@gmail.com> on 2020/08/09 01:37:20 UTC

Check (assert) dinamyc value of response.

Hello community.
I need to put a checker (assert), to a value of the response that will be
dynamic, so in each iteration the value will change.

At the moment I solved it with an assert of type "Json assertion" and I
indicated a regular expression, it works and does not fail, but I'm not
sure if it's ok.

How can I solve that? Thank you

Lionel

[image: 1.jpg]
[image: imagen.png]

Re: Check (assert) dinamyc value of response.

Posted by Antonio Gomes Rodrigues <ra...@gmail.com>.
Hi,

When you generate a random email, save it in a variable to use it later in
the assertion

Le lun. 10 août 2020 à 15:59, Lionel Blanco <ml...@gmail.com> a
écrit :

> Thanks for answering Felix.
> I am going to read the information that you indicate to me.
>
> The data is not in a .csv, I generate it randomly.
> They are fake emails that I randomly generate to make a registration,
> since I don't know what email it will generate, I don't know how to put an
> assert on it
> Look at my request code.
>
> [image: imagen.png]
>
> Thanks
>
>
>
> El lun., 10 ago. 2020 a las 10:50, Felix Schumacher (<
> felix.schumacher@internetallee.de>) escribió:
>
>>
>> Am 10.08.20 um 15:31 schrieb Lionel Blanco:
>>
>> Hi! ,
>>
>> Thanks for answering Felix.
>> My question is this; How do I check these values if in each iteration they change?
>>
>>
>> What type of assert do I use and how do I use it?
>>
>>
>> As I said before, it depends :)
>>
>> I often know upfront what values I expect for which users and can model
>> those expectations in a csv file. That csv file can then be used in the
>> test plan to give me each iteration the values I want to ask and the
>> answers I should check.
>>
>> Say you have two users userA and userB, that have different
>> email-addresses, that you want to check. You could write a csv file (name
>> it whatever you want) with the content
>>
>> user,email
>> userA,something@example.invalid
>> userB,different@some.example.invalid
>>
>> Insert a CSV Data Set Config (
>> https://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config)
>> and configure it according to your data and the elements documentation.
>>
>> Now you should be able to refer to the values of one row by the names of
>> the columns for each iteration (that is in the simplest case one iteration
>> of a thread group) with ${<name of column>}.
>>
>> In this setup you can use a Response Assertion (
>> https://jmeter.apache.org/usermanual/component_reference.html#Response_Assertion)
>> in which you refer to the variable you want (say ${email})
>>
>> If the values you want to assert are inside some data structure, you
>> should first extract them via a post processor. For JSON you could use
>> https://jmeter.apache.org/usermanual/component_reference.html#JSON_JMESPath_Extractor
>>
>> Regards
>>
>>  Felix
>>
>> This is my response code:
>>
>>
>> [image: imagen.png]
>>
>> Thanks
>>
>> Lionel
>>
>>
>>
>> El dom., 9 ago. 2020 a las 5:53, Felix Schumacher (<
>> felix.schumacher@internetallee.de>) escribió:
>>
>>> Hi Lionel,
>>>
>>> If it works, it is OK :)
>>>
>>> If you want to have a more flexible way of assertion, you can split the
>>> extraction from the assertion and use whatever assertion type, that you
>>> like.
>>>
>>> To be able to be more specific, you would have to say a bit more about
>>> your problem that you want to solve.
>>>
>>> Felix
>>> Am 09.08.20 um 03:37 schrieb Lionel Blanco:
>>>
>>> Hello community.
>>> I need to put a checker (assert), to a value of the response that will
>>> be dynamic, so in each iteration the value will change.
>>>
>>> At the moment I solved it with an assert of type "Json assertion" and I
>>> indicated a regular expression, it works and does not fail, but I'm not
>>> sure if it's ok.
>>>
>>> How can I solve that? Thank you
>>>
>>> Lionel
>>>
>>> [image: 1.jpg]
>>> [image: imagen.png]
>>>
>>>

Re: Check (assert) dinamyc value of response.

Posted by Felix Schumacher <fe...@internetallee.de>.
Hi Flavio,

in your first picture you are extracting the email into the variable
named "variable_email". Now you would like to assert that the content of
that variable is something you expect.

In the second picture you are showing the response assertion, where you
are asserting the value of the variable with the name "variable_email"
to contain the expected value of "${variable_email}".

This will always succeed, as JMeter will replace "${variable_email}"
with the content of the variable named "variable_email". But even if it
succeeds, it is probably not what you wanted.

In your previous mails, you showed, that you are constructing the email
via something like "abc_${__Random(1,99999,var)}@somwhere.invalid". You
might not know, that you have stored the generated random number in a
JMeter variable named "var" with that statement as well.

So a good candidate for the field "Patterns to test" in the response
assertion is "abc_${var}@somewhere.invalid".

To go a bit further, I would store the generated email address as whole
in some variable and use that variable to generate the post request and
use for the expected value in the assertion.

And after looking again in the documentation I see, that the built-in
JSON assertions could be used to combine the two steps of extracting and
asserting (as you did in your first post with the third party plugin)

Felix

Am 11.08.20 um 22:56 schrieb Lionel Blanco:
> Felix, that's how it works for me ...
> So is what you indicate?
>
>
> imagen.png
>
> imagen.png
>
> imagen.png
>
>
>
>
> El mar., 11 ago. 2020 a las 16:44, Felix Schumacher
> (<felix.schumacher@internetallee.de
> <ma...@internetallee.de>>) escribió:
>
>     You want to put the name of the variable into the field next to
>     'JMeter variable name to use' and in pattern to test the expected
>     value.
>
>     Felix
>
>
>     Am 11. August 2020 21:24:52 MESZ schrieb Lionel Blanco
>     <mlionelblanco@gmail.com <ma...@gmail.com>>:
>     >I extract the value:
>     >
>     >[image: Imagen 1.jpg]
>     >And I pass the variable:
>     >
>     >[image: imagen.png]
>     >
>     >
>     >Am I doing something?
>     >
>     >Thanks Felix
>     >
>     >El mar., 11 ago. 2020 a las 16:14, Felix Schumacher (<
>     >felix.schumacher@internetallee.de
>     <ma...@internetallee.de>>) escribió:
>     >
>     >>
>     >>
>     >> Am 11. August 2020 21:06:44 MESZ schrieb Lionel Blanco <
>     >> mlionelblanco@gmail.com <ma...@gmail.com>>:
>     >> >Flavio, hi.
>     >> >What type of assert do I have to use to pass the variable to
>     it and
>     >> >verify
>     >> >the value?
>     >> >I have tried Response assertions but it doesn't work.
>     >>
>     >> How did you use it?
>     >>
>     >> Felix
>     >>
>     >> >
>     >> >Regards
>     >> >Lionel
>     >> >
>     >> >El lun., 10 ago. 2020 a las 11:06, Flavio Cysne
>     >> >(<flaviocysne@gmail.com <ma...@gmail.com>>)
>     >> >escribió:
>     >> >
>     >> >> You could extract a variable that would contain the dynamic
>     value
>     >you
>     >> >want
>     >> >> to assert with and add it to (or compose in) the assertion
>     element
>     >> >like
>     >> >> this ${var_value_to_verify}, considering that you call the
>     >variable v
>     >> >> ar_value_to_verify.
>     >> >>
>     >> >> On Mon., Aug. 10, 2020, 9:59 a.m. Lionel Blanco,
>     >> ><mlionelblanco@gmail.com <ma...@gmail.com>>
>     >> >> wrote:
>     >> >>
>     >> >>> Thanks for answering Felix.
>     >> >>> I am going to read the information that you indicate to me.
>     >> >>>
>     >> >>> The data is not in a .csv, I generate it randomly.
>     >> >>> They are fake emails that I randomly generate to make a
>     >> >registration,
>     >> >>> since I don't know what email it will generate, I don't
>     know how
>     >to
>     >> >put an
>     >> >>> assert on it
>     >> >>> Look at my request code.
>     >> >>>
>     >> >>> [image: imagen.png]
>     >> >>>
>     >> >>> Thanks
>     >> >>>
>     >> >>>
>     >> >>>
>     >> >>> El lun., 10 ago. 2020 a las 10:50, Felix Schumacher (<
>     >> >>> felix.schumacher@internetallee.de
>     <ma...@internetallee.de>>) escribió:
>     >> >>>
>     >> >>>>
>     >> >>>> Am 10.08.20 um 15:31 schrieb Lionel Blanco:
>     >> >>>>
>     >> >>>> Hi! ,
>     >> >>>>
>     >> >>>> Thanks for answering Felix.
>     >> >>>> My question is this; How do I check these values if in each
>     >> >iteration they change?
>     >> >>>>
>     >> >>>>
>     >> >>>> What type of assert do I use and how do I use it?
>     >> >>>>
>     >> >>>>
>     >> >>>> As I said before, it depends :)
>     >> >>>>
>     >> >>>> I often know upfront what values I expect for which users and
>     >can
>     >> >model
>     >> >>>> those expectations in a csv file. That csv file can then
>     be used
>     >in
>     >> >the
>     >> >>>> test plan to give me each iteration the values I want to
>     ask and
>     >> >the
>     >> >>>> answers I should check.
>     >> >>>>
>     >> >>>> Say you have two users userA and userB, that have different
>     >> >>>> email-addresses, that you want to check. You could write a csv
>     >file
>     >> >(name
>     >> >>>> it whatever you want) with the content
>     >> >>>>
>     >> >>>> user,email
>     >> >>>> userA,something@example.invalid
>     >> >>>> userB,different@some.example.invalid
>     >> >>>>
>     >> >>>> Insert a CSV Data Set Config (
>     >> >>>>
>     >> >
>     >>
>     >https://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config
>     >> )
>     >> >>>> and configure it according to your data and the elements
>     >> >documentation.
>     >> >>>>
>     >> >>>> Now you should be able to refer to the values of one row
>     by the
>     >> >names of
>     >> >>>> the columns for each iteration (that is in the simplest
>     case one
>     >> >iteration
>     >> >>>> of a thread group) with ${<name of column>}.
>     >> >>>>
>     >> >>>> In this setup you can use a Response Assertion (
>     >> >>>>
>     >> >
>     >>
>     >https://jmeter.apache.org/usermanual/component_reference.html#Response_Assertion
>     >> )
>     >> >>>> in which you refer to the variable you want (say ${email})
>     >> >>>>
>     >> >>>> If the values you want to assert are inside some data
>     structure,
>     >> >you
>     >> >>>> should first extract them via a post processor. For JSON you
>     >could
>     >> >use
>     >> >>>>
>     >> >
>     >>
>     >https://jmeter.apache.org/usermanual/component_reference.html#JSON_JMESPath_Extractor
>     >> >>>>
>     >> >>>> Regards
>     >> >>>>
>     >> >>>>  Felix
>     >> >>>>
>     >> >>>> This is my response code:
>     >> >>>>
>     >> >>>>
>     >> >>>> [image: imagen.png]
>     >> >>>>
>     >> >>>> Thanks
>     >> >>>>
>     >> >>>> Lionel
>     >> >>>>
>     >> >>>>
>     >> >>>>
>     >> >>>> El dom., 9 ago. 2020 a las 5:53, Felix Schumacher (<
>     >> >>>> felix.schumacher@internetallee.de
>     <ma...@internetallee.de>>) escribió:
>     >> >>>>
>     >> >>>>> Hi Lionel,
>     >> >>>>>
>     >> >>>>> If it works, it is OK :)
>     >> >>>>>
>     >> >>>>> If you want to have a more flexible way of assertion, you can
>     >> >split the
>     >> >>>>> extraction from the assertion and use whatever assertion
>     type,
>     >> >that you
>     >> >>>>> like.
>     >> >>>>>
>     >> >>>>> To be able to be more specific, you would have to say a bit
>     >more
>     >> >about
>     >> >>>>> your problem that you want to solve.
>     >> >>>>>
>     >> >>>>> Felix
>     >> >>>>> Am 09.08.20 um 03:37 schrieb Lionel Blanco:
>     >> >>>>>
>     >> >>>>> Hello community.
>     >> >>>>> I need to put a checker (assert), to a value of the response
>     >that
>     >> >will
>     >> >>>>> be dynamic, so in each iteration the value will change.
>     >> >>>>>
>     >> >>>>> At the moment I solved it with an assert of type "Json
>     >assertion"
>     >> >and I
>     >> >>>>> indicated a regular expression, it works and does not
>     fail, but
>     >> >I'm not
>     >> >>>>> sure if it's ok.
>     >> >>>>>
>     >> >>>>> How can I solve that? Thank you
>     >> >>>>>
>     >> >>>>> Lionel
>     >> >>>>>
>     >> >>>>> [image: 1.jpg]
>     >> >>>>> [image: imagen.png]
>     >> >>>>>
>     >> >>>>>
>     >>
>     >>
>     ---------------------------------------------------------------------
>     >> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>     <ma...@jmeter.apache.org>
>     >> For additional commands, e-mail: user-help@jmeter.apache.org
>     <ma...@jmeter.apache.org>
>     >>
>     >>
>

Re: Check (assert) dinamyc value of response.

Posted by Lionel Blanco <ml...@gmail.com>.
Felix, that's how it works for me ...
So is what you indicate?


[image: imagen.png]

[image: imagen.png]

[image: imagen.png]




El mar., 11 ago. 2020 a las 16:44, Felix Schumacher (<
felix.schumacher@internetallee.de>) escribió:

> You want to put the name of the variable into the field next to 'JMeter
> variable name to use' and in pattern to test the expected value.
>
> Felix
>
>
> Am 11. August 2020 21:24:52 MESZ schrieb Lionel Blanco <
> mlionelblanco@gmail.com>:
> >I extract the value:
> >
> >[image: Imagen 1.jpg]
> >And I pass the variable:
> >
> >[image: imagen.png]
> >
> >
> >Am I doing something?
> >
> >Thanks Felix
> >
> >El mar., 11 ago. 2020 a las 16:14, Felix Schumacher (<
> >felix.schumacher@internetallee.de>) escribió:
> >
> >>
> >>
> >> Am 11. August 2020 21:06:44 MESZ schrieb Lionel Blanco <
> >> mlionelblanco@gmail.com>:
> >> >Flavio, hi.
> >> >What type of assert do I have to use to pass the variable to it and
> >> >verify
> >> >the value?
> >> >I have tried Response assertions but it doesn't work.
> >>
> >> How did you use it?
> >>
> >> Felix
> >>
> >> >
> >> >Regards
> >> >Lionel
> >> >
> >> >El lun., 10 ago. 2020 a las 11:06, Flavio Cysne
> >> >(<fl...@gmail.com>)
> >> >escribió:
> >> >
> >> >> You could extract a variable that would contain the dynamic value
> >you
> >> >want
> >> >> to assert with and add it to (or compose in) the assertion element
> >> >like
> >> >> this ${var_value_to_verify}, considering that you call the
> >variable v
> >> >> ar_value_to_verify.
> >> >>
> >> >> On Mon., Aug. 10, 2020, 9:59 a.m. Lionel Blanco,
> >> ><ml...@gmail.com>
> >> >> wrote:
> >> >>
> >> >>> Thanks for answering Felix.
> >> >>> I am going to read the information that you indicate to me.
> >> >>>
> >> >>> The data is not in a .csv, I generate it randomly.
> >> >>> They are fake emails that I randomly generate to make a
> >> >registration,
> >> >>> since I don't know what email it will generate, I don't know how
> >to
> >> >put an
> >> >>> assert on it
> >> >>> Look at my request code.
> >> >>>
> >> >>> [image: imagen.png]
> >> >>>
> >> >>> Thanks
> >> >>>
> >> >>>
> >> >>>
> >> >>> El lun., 10 ago. 2020 a las 10:50, Felix Schumacher (<
> >> >>> felix.schumacher@internetallee.de>) escribió:
> >> >>>
> >> >>>>
> >> >>>> Am 10.08.20 um 15:31 schrieb Lionel Blanco:
> >> >>>>
> >> >>>> Hi! ,
> >> >>>>
> >> >>>> Thanks for answering Felix.
> >> >>>> My question is this; How do I check these values if in each
> >> >iteration they change?
> >> >>>>
> >> >>>>
> >> >>>> What type of assert do I use and how do I use it?
> >> >>>>
> >> >>>>
> >> >>>> As I said before, it depends :)
> >> >>>>
> >> >>>> I often know upfront what values I expect for which users and
> >can
> >> >model
> >> >>>> those expectations in a csv file. That csv file can then be used
> >in
> >> >the
> >> >>>> test plan to give me each iteration the values I want to ask and
> >> >the
> >> >>>> answers I should check.
> >> >>>>
> >> >>>> Say you have two users userA and userB, that have different
> >> >>>> email-addresses, that you want to check. You could write a csv
> >file
> >> >(name
> >> >>>> it whatever you want) with the content
> >> >>>>
> >> >>>> user,email
> >> >>>> userA,something@example.invalid
> >> >>>> userB,different@some.example.invalid
> >> >>>>
> >> >>>> Insert a CSV Data Set Config (
> >> >>>>
> >> >
> >>
> >
> https://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config
> >> )
> >> >>>> and configure it according to your data and the elements
> >> >documentation.
> >> >>>>
> >> >>>> Now you should be able to refer to the values of one row by the
> >> >names of
> >> >>>> the columns for each iteration (that is in the simplest case one
> >> >iteration
> >> >>>> of a thread group) with ${<name of column>}.
> >> >>>>
> >> >>>> In this setup you can use a Response Assertion (
> >> >>>>
> >> >
> >>
> >
> https://jmeter.apache.org/usermanual/component_reference.html#Response_Assertion
> >> )
> >> >>>> in which you refer to the variable you want (say ${email})
> >> >>>>
> >> >>>> If the values you want to assert are inside some data structure,
> >> >you
> >> >>>> should first extract them via a post processor. For JSON you
> >could
> >> >use
> >> >>>>
> >> >
> >>
> >
> https://jmeter.apache.org/usermanual/component_reference.html#JSON_JMESPath_Extractor
> >> >>>>
> >> >>>> Regards
> >> >>>>
> >> >>>>  Felix
> >> >>>>
> >> >>>> This is my response code:
> >> >>>>
> >> >>>>
> >> >>>> [image: imagen.png]
> >> >>>>
> >> >>>> Thanks
> >> >>>>
> >> >>>> Lionel
> >> >>>>
> >> >>>>
> >> >>>>
> >> >>>> El dom., 9 ago. 2020 a las 5:53, Felix Schumacher (<
> >> >>>> felix.schumacher@internetallee.de>) escribió:
> >> >>>>
> >> >>>>> Hi Lionel,
> >> >>>>>
> >> >>>>> If it works, it is OK :)
> >> >>>>>
> >> >>>>> If you want to have a more flexible way of assertion, you can
> >> >split the
> >> >>>>> extraction from the assertion and use whatever assertion type,
> >> >that you
> >> >>>>> like.
> >> >>>>>
> >> >>>>> To be able to be more specific, you would have to say a bit
> >more
> >> >about
> >> >>>>> your problem that you want to solve.
> >> >>>>>
> >> >>>>> Felix
> >> >>>>> Am 09.08.20 um 03:37 schrieb Lionel Blanco:
> >> >>>>>
> >> >>>>> Hello community.
> >> >>>>> I need to put a checker (assert), to a value of the response
> >that
> >> >will
> >> >>>>> be dynamic, so in each iteration the value will change.
> >> >>>>>
> >> >>>>> At the moment I solved it with an assert of type "Json
> >assertion"
> >> >and I
> >> >>>>> indicated a regular expression, it works and does not fail, but
> >> >I'm not
> >> >>>>> sure if it's ok.
> >> >>>>>
> >> >>>>> How can I solve that? Thank you
> >> >>>>>
> >> >>>>> Lionel
> >> >>>>>
> >> >>>>> [image: 1.jpg]
> >> >>>>> [image: imagen.png]
> >> >>>>>
> >> >>>>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> >> For additional commands, e-mail: user-help@jmeter.apache.org
> >>
> >>
>

Re: Check (assert) dinamyc value of response.

Posted by Felix Schumacher <fe...@internetallee.de>.
You want to put the name of the variable into the field next to 'JMeter variable name to use' and in pattern to test the expected value.

Felix


Am 11. August 2020 21:24:52 MESZ schrieb Lionel Blanco <ml...@gmail.com>:
>I extract the value:
>
>[image: Imagen 1.jpg]
>And I pass the variable:
>
>[image: imagen.png]
>
>
>Am I doing something?
>
>Thanks Felix
>
>El mar., 11 ago. 2020 a las 16:14, Felix Schumacher (<
>felix.schumacher@internetallee.de>) escribió:
>
>>
>>
>> Am 11. August 2020 21:06:44 MESZ schrieb Lionel Blanco <
>> mlionelblanco@gmail.com>:
>> >Flavio, hi.
>> >What type of assert do I have to use to pass the variable to it and
>> >verify
>> >the value?
>> >I have tried Response assertions but it doesn't work.
>>
>> How did you use it?
>>
>> Felix
>>
>> >
>> >Regards
>> >Lionel
>> >
>> >El lun., 10 ago. 2020 a las 11:06, Flavio Cysne
>> >(<fl...@gmail.com>)
>> >escribió:
>> >
>> >> You could extract a variable that would contain the dynamic value
>you
>> >want
>> >> to assert with and add it to (or compose in) the assertion element
>> >like
>> >> this ${var_value_to_verify}, considering that you call the
>variable v
>> >> ar_value_to_verify.
>> >>
>> >> On Mon., Aug. 10, 2020, 9:59 a.m. Lionel Blanco,
>> ><ml...@gmail.com>
>> >> wrote:
>> >>
>> >>> Thanks for answering Felix.
>> >>> I am going to read the information that you indicate to me.
>> >>>
>> >>> The data is not in a .csv, I generate it randomly.
>> >>> They are fake emails that I randomly generate to make a
>> >registration,
>> >>> since I don't know what email it will generate, I don't know how
>to
>> >put an
>> >>> assert on it
>> >>> Look at my request code.
>> >>>
>> >>> [image: imagen.png]
>> >>>
>> >>> Thanks
>> >>>
>> >>>
>> >>>
>> >>> El lun., 10 ago. 2020 a las 10:50, Felix Schumacher (<
>> >>> felix.schumacher@internetallee.de>) escribió:
>> >>>
>> >>>>
>> >>>> Am 10.08.20 um 15:31 schrieb Lionel Blanco:
>> >>>>
>> >>>> Hi! ,
>> >>>>
>> >>>> Thanks for answering Felix.
>> >>>> My question is this; How do I check these values if in each
>> >iteration they change?
>> >>>>
>> >>>>
>> >>>> What type of assert do I use and how do I use it?
>> >>>>
>> >>>>
>> >>>> As I said before, it depends :)
>> >>>>
>> >>>> I often know upfront what values I expect for which users and
>can
>> >model
>> >>>> those expectations in a csv file. That csv file can then be used
>in
>> >the
>> >>>> test plan to give me each iteration the values I want to ask and
>> >the
>> >>>> answers I should check.
>> >>>>
>> >>>> Say you have two users userA and userB, that have different
>> >>>> email-addresses, that you want to check. You could write a csv
>file
>> >(name
>> >>>> it whatever you want) with the content
>> >>>>
>> >>>> user,email
>> >>>> userA,something@example.invalid
>> >>>> userB,different@some.example.invalid
>> >>>>
>> >>>> Insert a CSV Data Set Config (
>> >>>>
>> >
>>
>https://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config
>> )
>> >>>> and configure it according to your data and the elements
>> >documentation.
>> >>>>
>> >>>> Now you should be able to refer to the values of one row by the
>> >names of
>> >>>> the columns for each iteration (that is in the simplest case one
>> >iteration
>> >>>> of a thread group) with ${<name of column>}.
>> >>>>
>> >>>> In this setup you can use a Response Assertion (
>> >>>>
>> >
>>
>https://jmeter.apache.org/usermanual/component_reference.html#Response_Assertion
>> )
>> >>>> in which you refer to the variable you want (say ${email})
>> >>>>
>> >>>> If the values you want to assert are inside some data structure,
>> >you
>> >>>> should first extract them via a post processor. For JSON you
>could
>> >use
>> >>>>
>> >
>>
>https://jmeter.apache.org/usermanual/component_reference.html#JSON_JMESPath_Extractor
>> >>>>
>> >>>> Regards
>> >>>>
>> >>>>  Felix
>> >>>>
>> >>>> This is my response code:
>> >>>>
>> >>>>
>> >>>> [image: imagen.png]
>> >>>>
>> >>>> Thanks
>> >>>>
>> >>>> Lionel
>> >>>>
>> >>>>
>> >>>>
>> >>>> El dom., 9 ago. 2020 a las 5:53, Felix Schumacher (<
>> >>>> felix.schumacher@internetallee.de>) escribió:
>> >>>>
>> >>>>> Hi Lionel,
>> >>>>>
>> >>>>> If it works, it is OK :)
>> >>>>>
>> >>>>> If you want to have a more flexible way of assertion, you can
>> >split the
>> >>>>> extraction from the assertion and use whatever assertion type,
>> >that you
>> >>>>> like.
>> >>>>>
>> >>>>> To be able to be more specific, you would have to say a bit
>more
>> >about
>> >>>>> your problem that you want to solve.
>> >>>>>
>> >>>>> Felix
>> >>>>> Am 09.08.20 um 03:37 schrieb Lionel Blanco:
>> >>>>>
>> >>>>> Hello community.
>> >>>>> I need to put a checker (assert), to a value of the response
>that
>> >will
>> >>>>> be dynamic, so in each iteration the value will change.
>> >>>>>
>> >>>>> At the moment I solved it with an assert of type "Json
>assertion"
>> >and I
>> >>>>> indicated a regular expression, it works and does not fail, but
>> >I'm not
>> >>>>> sure if it's ok.
>> >>>>>
>> >>>>> How can I solve that? Thank you
>> >>>>>
>> >>>>> Lionel
>> >>>>>
>> >>>>> [image: 1.jpg]
>> >>>>> [image: imagen.png]
>> >>>>>
>> >>>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>> For additional commands, e-mail: user-help@jmeter.apache.org
>>
>>

Re: Check (assert) dinamyc value of response.

Posted by Lionel Blanco <ml...@gmail.com>.
I extract the value:

[image: Imagen 1.jpg]
And I pass the variable:

[image: imagen.png]


Am I doing something?

Thanks Felix

El mar., 11 ago. 2020 a las 16:14, Felix Schumacher (<
felix.schumacher@internetallee.de>) escribió:

>
>
> Am 11. August 2020 21:06:44 MESZ schrieb Lionel Blanco <
> mlionelblanco@gmail.com>:
> >Flavio, hi.
> >What type of assert do I have to use to pass the variable to it and
> >verify
> >the value?
> >I have tried Response assertions but it doesn't work.
>
> How did you use it?
>
> Felix
>
> >
> >Regards
> >Lionel
> >
> >El lun., 10 ago. 2020 a las 11:06, Flavio Cysne
> >(<fl...@gmail.com>)
> >escribió:
> >
> >> You could extract a variable that would contain the dynamic value you
> >want
> >> to assert with and add it to (or compose in) the assertion element
> >like
> >> this ${var_value_to_verify}, considering that you call the variable v
> >> ar_value_to_verify.
> >>
> >> On Mon., Aug. 10, 2020, 9:59 a.m. Lionel Blanco,
> ><ml...@gmail.com>
> >> wrote:
> >>
> >>> Thanks for answering Felix.
> >>> I am going to read the information that you indicate to me.
> >>>
> >>> The data is not in a .csv, I generate it randomly.
> >>> They are fake emails that I randomly generate to make a
> >registration,
> >>> since I don't know what email it will generate, I don't know how to
> >put an
> >>> assert on it
> >>> Look at my request code.
> >>>
> >>> [image: imagen.png]
> >>>
> >>> Thanks
> >>>
> >>>
> >>>
> >>> El lun., 10 ago. 2020 a las 10:50, Felix Schumacher (<
> >>> felix.schumacher@internetallee.de>) escribió:
> >>>
> >>>>
> >>>> Am 10.08.20 um 15:31 schrieb Lionel Blanco:
> >>>>
> >>>> Hi! ,
> >>>>
> >>>> Thanks for answering Felix.
> >>>> My question is this; How do I check these values if in each
> >iteration they change?
> >>>>
> >>>>
> >>>> What type of assert do I use and how do I use it?
> >>>>
> >>>>
> >>>> As I said before, it depends :)
> >>>>
> >>>> I often know upfront what values I expect for which users and can
> >model
> >>>> those expectations in a csv file. That csv file can then be used in
> >the
> >>>> test plan to give me each iteration the values I want to ask and
> >the
> >>>> answers I should check.
> >>>>
> >>>> Say you have two users userA and userB, that have different
> >>>> email-addresses, that you want to check. You could write a csv file
> >(name
> >>>> it whatever you want) with the content
> >>>>
> >>>> user,email
> >>>> userA,something@example.invalid
> >>>> userB,different@some.example.invalid
> >>>>
> >>>> Insert a CSV Data Set Config (
> >>>>
> >
> https://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config
> )
> >>>> and configure it according to your data and the elements
> >documentation.
> >>>>
> >>>> Now you should be able to refer to the values of one row by the
> >names of
> >>>> the columns for each iteration (that is in the simplest case one
> >iteration
> >>>> of a thread group) with ${<name of column>}.
> >>>>
> >>>> In this setup you can use a Response Assertion (
> >>>>
> >
> https://jmeter.apache.org/usermanual/component_reference.html#Response_Assertion
> )
> >>>> in which you refer to the variable you want (say ${email})
> >>>>
> >>>> If the values you want to assert are inside some data structure,
> >you
> >>>> should first extract them via a post processor. For JSON you could
> >use
> >>>>
> >
> https://jmeter.apache.org/usermanual/component_reference.html#JSON_JMESPath_Extractor
> >>>>
> >>>> Regards
> >>>>
> >>>>  Felix
> >>>>
> >>>> This is my response code:
> >>>>
> >>>>
> >>>> [image: imagen.png]
> >>>>
> >>>> Thanks
> >>>>
> >>>> Lionel
> >>>>
> >>>>
> >>>>
> >>>> El dom., 9 ago. 2020 a las 5:53, Felix Schumacher (<
> >>>> felix.schumacher@internetallee.de>) escribió:
> >>>>
> >>>>> Hi Lionel,
> >>>>>
> >>>>> If it works, it is OK :)
> >>>>>
> >>>>> If you want to have a more flexible way of assertion, you can
> >split the
> >>>>> extraction from the assertion and use whatever assertion type,
> >that you
> >>>>> like.
> >>>>>
> >>>>> To be able to be more specific, you would have to say a bit more
> >about
> >>>>> your problem that you want to solve.
> >>>>>
> >>>>> Felix
> >>>>> Am 09.08.20 um 03:37 schrieb Lionel Blanco:
> >>>>>
> >>>>> Hello community.
> >>>>> I need to put a checker (assert), to a value of the response that
> >will
> >>>>> be dynamic, so in each iteration the value will change.
> >>>>>
> >>>>> At the moment I solved it with an assert of type "Json assertion"
> >and I
> >>>>> indicated a regular expression, it works and does not fail, but
> >I'm not
> >>>>> sure if it's ok.
> >>>>>
> >>>>> How can I solve that? Thank you
> >>>>>
> >>>>> Lionel
> >>>>>
> >>>>> [image: 1.jpg]
> >>>>> [image: imagen.png]
> >>>>>
> >>>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Re: Check (assert) dinamyc value of response.

Posted by Felix Schumacher <fe...@internetallee.de>.

Am 11. August 2020 21:06:44 MESZ schrieb Lionel Blanco <ml...@gmail.com>:
>Flavio, hi.
>What type of assert do I have to use to pass the variable to it and
>verify
>the value?
>I have tried Response assertions but it doesn't work.

How did you use it? 

Felix 

>
>Regards
>Lionel
>
>El lun., 10 ago. 2020 a las 11:06, Flavio Cysne
>(<fl...@gmail.com>)
>escribió:
>
>> You could extract a variable that would contain the dynamic value you
>want
>> to assert with and add it to (or compose in) the assertion element
>like
>> this ${var_value_to_verify}, considering that you call the variable v
>> ar_value_to_verify.
>>
>> On Mon., Aug. 10, 2020, 9:59 a.m. Lionel Blanco,
><ml...@gmail.com>
>> wrote:
>>
>>> Thanks for answering Felix.
>>> I am going to read the information that you indicate to me.
>>>
>>> The data is not in a .csv, I generate it randomly.
>>> They are fake emails that I randomly generate to make a
>registration,
>>> since I don't know what email it will generate, I don't know how to
>put an
>>> assert on it
>>> Look at my request code.
>>>
>>> [image: imagen.png]
>>>
>>> Thanks
>>>
>>>
>>>
>>> El lun., 10 ago. 2020 a las 10:50, Felix Schumacher (<
>>> felix.schumacher@internetallee.de>) escribió:
>>>
>>>>
>>>> Am 10.08.20 um 15:31 schrieb Lionel Blanco:
>>>>
>>>> Hi! ,
>>>>
>>>> Thanks for answering Felix.
>>>> My question is this; How do I check these values if in each
>iteration they change?
>>>>
>>>>
>>>> What type of assert do I use and how do I use it?
>>>>
>>>>
>>>> As I said before, it depends :)
>>>>
>>>> I often know upfront what values I expect for which users and can
>model
>>>> those expectations in a csv file. That csv file can then be used in
>the
>>>> test plan to give me each iteration the values I want to ask and
>the
>>>> answers I should check.
>>>>
>>>> Say you have two users userA and userB, that have different
>>>> email-addresses, that you want to check. You could write a csv file
>(name
>>>> it whatever you want) with the content
>>>>
>>>> user,email
>>>> userA,something@example.invalid
>>>> userB,different@some.example.invalid
>>>>
>>>> Insert a CSV Data Set Config (
>>>>
>https://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config)
>>>> and configure it according to your data and the elements
>documentation.
>>>>
>>>> Now you should be able to refer to the values of one row by the
>names of
>>>> the columns for each iteration (that is in the simplest case one
>iteration
>>>> of a thread group) with ${<name of column>}.
>>>>
>>>> In this setup you can use a Response Assertion (
>>>>
>https://jmeter.apache.org/usermanual/component_reference.html#Response_Assertion)
>>>> in which you refer to the variable you want (say ${email})
>>>>
>>>> If the values you want to assert are inside some data structure,
>you
>>>> should first extract them via a post processor. For JSON you could
>use
>>>>
>https://jmeter.apache.org/usermanual/component_reference.html#JSON_JMESPath_Extractor
>>>>
>>>> Regards
>>>>
>>>>  Felix
>>>>
>>>> This is my response code:
>>>>
>>>>
>>>> [image: imagen.png]
>>>>
>>>> Thanks
>>>>
>>>> Lionel
>>>>
>>>>
>>>>
>>>> El dom., 9 ago. 2020 a las 5:53, Felix Schumacher (<
>>>> felix.schumacher@internetallee.de>) escribió:
>>>>
>>>>> Hi Lionel,
>>>>>
>>>>> If it works, it is OK :)
>>>>>
>>>>> If you want to have a more flexible way of assertion, you can
>split the
>>>>> extraction from the assertion and use whatever assertion type,
>that you
>>>>> like.
>>>>>
>>>>> To be able to be more specific, you would have to say a bit more
>about
>>>>> your problem that you want to solve.
>>>>>
>>>>> Felix
>>>>> Am 09.08.20 um 03:37 schrieb Lionel Blanco:
>>>>>
>>>>> Hello community.
>>>>> I need to put a checker (assert), to a value of the response that
>will
>>>>> be dynamic, so in each iteration the value will change.
>>>>>
>>>>> At the moment I solved it with an assert of type "Json assertion"
>and I
>>>>> indicated a regular expression, it works and does not fail, but
>I'm not
>>>>> sure if it's ok.
>>>>>
>>>>> How can I solve that? Thank you
>>>>>
>>>>> Lionel
>>>>>
>>>>> [image: 1.jpg]
>>>>> [image: imagen.png]
>>>>>
>>>>>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: Check (assert) dinamyc value of response.

Posted by Lionel Blanco <ml...@gmail.com>.
Flavio, hi.
What type of assert do I have to use to pass the variable to it and verify
the value?
I have tried Response assertions but it doesn't work.

Regards
Lionel

El lun., 10 ago. 2020 a las 11:06, Flavio Cysne (<fl...@gmail.com>)
escribió:

> You could extract a variable that would contain the dynamic value you want
> to assert with and add it to (or compose in) the assertion element like
> this ${var_value_to_verify}, considering that you call the variable v
> ar_value_to_verify.
>
> On Mon., Aug. 10, 2020, 9:59 a.m. Lionel Blanco, <ml...@gmail.com>
> wrote:
>
>> Thanks for answering Felix.
>> I am going to read the information that you indicate to me.
>>
>> The data is not in a .csv, I generate it randomly.
>> They are fake emails that I randomly generate to make a registration,
>> since I don't know what email it will generate, I don't know how to put an
>> assert on it
>> Look at my request code.
>>
>> [image: imagen.png]
>>
>> Thanks
>>
>>
>>
>> El lun., 10 ago. 2020 a las 10:50, Felix Schumacher (<
>> felix.schumacher@internetallee.de>) escribió:
>>
>>>
>>> Am 10.08.20 um 15:31 schrieb Lionel Blanco:
>>>
>>> Hi! ,
>>>
>>> Thanks for answering Felix.
>>> My question is this; How do I check these values if in each iteration they change?
>>>
>>>
>>> What type of assert do I use and how do I use it?
>>>
>>>
>>> As I said before, it depends :)
>>>
>>> I often know upfront what values I expect for which users and can model
>>> those expectations in a csv file. That csv file can then be used in the
>>> test plan to give me each iteration the values I want to ask and the
>>> answers I should check.
>>>
>>> Say you have two users userA and userB, that have different
>>> email-addresses, that you want to check. You could write a csv file (name
>>> it whatever you want) with the content
>>>
>>> user,email
>>> userA,something@example.invalid
>>> userB,different@some.example.invalid
>>>
>>> Insert a CSV Data Set Config (
>>> https://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config)
>>> and configure it according to your data and the elements documentation.
>>>
>>> Now you should be able to refer to the values of one row by the names of
>>> the columns for each iteration (that is in the simplest case one iteration
>>> of a thread group) with ${<name of column>}.
>>>
>>> In this setup you can use a Response Assertion (
>>> https://jmeter.apache.org/usermanual/component_reference.html#Response_Assertion)
>>> in which you refer to the variable you want (say ${email})
>>>
>>> If the values you want to assert are inside some data structure, you
>>> should first extract them via a post processor. For JSON you could use
>>> https://jmeter.apache.org/usermanual/component_reference.html#JSON_JMESPath_Extractor
>>>
>>> Regards
>>>
>>>  Felix
>>>
>>> This is my response code:
>>>
>>>
>>> [image: imagen.png]
>>>
>>> Thanks
>>>
>>> Lionel
>>>
>>>
>>>
>>> El dom., 9 ago. 2020 a las 5:53, Felix Schumacher (<
>>> felix.schumacher@internetallee.de>) escribió:
>>>
>>>> Hi Lionel,
>>>>
>>>> If it works, it is OK :)
>>>>
>>>> If you want to have a more flexible way of assertion, you can split the
>>>> extraction from the assertion and use whatever assertion type, that you
>>>> like.
>>>>
>>>> To be able to be more specific, you would have to say a bit more about
>>>> your problem that you want to solve.
>>>>
>>>> Felix
>>>> Am 09.08.20 um 03:37 schrieb Lionel Blanco:
>>>>
>>>> Hello community.
>>>> I need to put a checker (assert), to a value of the response that will
>>>> be dynamic, so in each iteration the value will change.
>>>>
>>>> At the moment I solved it with an assert of type "Json assertion" and I
>>>> indicated a regular expression, it works and does not fail, but I'm not
>>>> sure if it's ok.
>>>>
>>>> How can I solve that? Thank you
>>>>
>>>> Lionel
>>>>
>>>> [image: 1.jpg]
>>>> [image: imagen.png]
>>>>
>>>>

JMeter cause Windows crash?

Posted by John Melom <jr...@comcast.net>.
Has anyone seen a JMeter run cause the JMeter Windows host system to crash?  When we do a JMeter run, our Windows system is crashing at random times into the run.  The script is not doing anything sophisticated.  It is just sending https requests and following redirects.  No parsing, no CSV input.

Monitoring with JConsole shows that JMeter is not pushing its JVM heap size limits.

Our system admin looked at the crashes and says they are forced crashes, so it must be JMeter forcing it.  This doesn’t make sense to me.

Thanks,

Joh Melom




-- 
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

Re: JMeter cause Windows crash?

Posted by Felix Schumacher <fe...@internetallee.de>.
Please don't hijack threads. That happens, when you reply to a mail and change the subject to a completely new one.

Always start a new thread (question) by sending a new mail.

To answer your question, no, I haven't seen jmeter so such a thing. Maybe your Java installation ist broken (or your os)

Felix 

Am 11. August 2020 16:31:24 MESZ schrieb John Melom <jr...@comcast.net>:
>Has anyone seen a JMeter run cause the JMeter Windows host system to
>crash?  When we do a JMeter run, our Windows system is crashing at
>random times into the run.  The script is not doing anything
>sophisticated.  It is just sending https requests and following
>redirects.  No parsing, no CSV input.
>
>Monitoring with JConsole shows that JMeter is not pushing its JVM heap
>size limits.
>
>Our system admin looked at the crashes and says they are forced
>crashes, so it must be JMeter forcing it.  This doesn’t make sense to
>me.
>
>Thanks,
>
>Joh Melom
>
>
>
>
>--
>This email has been checked for viruses by Avast antivirus software.
>https://www.avast.com/antivirus

RE: JMeter cause Windows crash?

Posted by "Herbener, Martin - Division of School Technology Planning and Project Management" <ma...@education.ky.gov>.
Not a heavy jmeter user, but I've never seen anything like that and it seems unlikely.

Martin

-----Original Message-----
From: John Melom <jr...@comcast.net> 
Sent: Tuesday, August 11, 2020 10:31 AM
To: JMeter Users List <us...@jmeter.apache.org>
Subject: JMeter cause Windows crash?

CAUTION:  This email originated from outside of the Kentucky Department of Education, Kentucky K-12 schools, or Kentucky State Government. Do not click links, open attachments or forward unless you recognize the sender and know the content is safe.


Has anyone seen a JMeter run cause the JMeter Windows host system to crash?  When we do a JMeter run, our Windows system is crashing at random times into the run.  The script is not doing anything sophisticated.  It is just sending https requests and following redirects.  No parsing, no CSV input.

Monitoring with JConsole shows that JMeter is not pushing its JVM heap size limits.

Our system admin looked at the crashes and says they are forced crashes, so it must be JMeter forcing it.  This doesn’t make sense to me.

Thanks,

Joh Melom




--
This email has been checked for viruses by Avast antivirus software.
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.avast.com%2Fantivirus&amp;data=02%7C01%7Cmartin.herbener%40education.ky.gov%7C1c8ffbacf6574c47f8e808d83e033e1c%7C9360c11f90e64706ad0025fcdc9e2ed1%7C0%7C0%7C637327531227985312&amp;sdata=j%2BEX4YADC0PEW%2BTiBW4fzQPnh68g0x145jbq6e6tuIo%3D&amp;reserved=0

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org

Re: Check (assert) dinamyc value of response.

Posted by Flavio Cysne <fl...@gmail.com>.
You could extract a variable that would contain the dynamic value you want
to assert with and add it to (or compose in) the assertion element like
this ${var_value_to_verify}, considering that you call the variable v
ar_value_to_verify.

On Mon., Aug. 10, 2020, 9:59 a.m. Lionel Blanco, <ml...@gmail.com>
wrote:

> Thanks for answering Felix.
> I am going to read the information that you indicate to me.
>
> The data is not in a .csv, I generate it randomly.
> They are fake emails that I randomly generate to make a registration,
> since I don't know what email it will generate, I don't know how to put an
> assert on it
> Look at my request code.
>
> [image: imagen.png]
>
> Thanks
>
>
>
> El lun., 10 ago. 2020 a las 10:50, Felix Schumacher (<
> felix.schumacher@internetallee.de>) escribió:
>
>>
>> Am 10.08.20 um 15:31 schrieb Lionel Blanco:
>>
>> Hi! ,
>>
>> Thanks for answering Felix.
>> My question is this; How do I check these values if in each iteration they change?
>>
>>
>> What type of assert do I use and how do I use it?
>>
>>
>> As I said before, it depends :)
>>
>> I often know upfront what values I expect for which users and can model
>> those expectations in a csv file. That csv file can then be used in the
>> test plan to give me each iteration the values I want to ask and the
>> answers I should check.
>>
>> Say you have two users userA and userB, that have different
>> email-addresses, that you want to check. You could write a csv file (name
>> it whatever you want) with the content
>>
>> user,email
>> userA,something@example.invalid
>> userB,different@some.example.invalid
>>
>> Insert a CSV Data Set Config (
>> https://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config)
>> and configure it according to your data and the elements documentation.
>>
>> Now you should be able to refer to the values of one row by the names of
>> the columns for each iteration (that is in the simplest case one iteration
>> of a thread group) with ${<name of column>}.
>>
>> In this setup you can use a Response Assertion (
>> https://jmeter.apache.org/usermanual/component_reference.html#Response_Assertion)
>> in which you refer to the variable you want (say ${email})
>>
>> If the values you want to assert are inside some data structure, you
>> should first extract them via a post processor. For JSON you could use
>> https://jmeter.apache.org/usermanual/component_reference.html#JSON_JMESPath_Extractor
>>
>> Regards
>>
>>  Felix
>>
>> This is my response code:
>>
>>
>> [image: imagen.png]
>>
>> Thanks
>>
>> Lionel
>>
>>
>>
>> El dom., 9 ago. 2020 a las 5:53, Felix Schumacher (<
>> felix.schumacher@internetallee.de>) escribió:
>>
>>> Hi Lionel,
>>>
>>> If it works, it is OK :)
>>>
>>> If you want to have a more flexible way of assertion, you can split the
>>> extraction from the assertion and use whatever assertion type, that you
>>> like.
>>>
>>> To be able to be more specific, you would have to say a bit more about
>>> your problem that you want to solve.
>>>
>>> Felix
>>> Am 09.08.20 um 03:37 schrieb Lionel Blanco:
>>>
>>> Hello community.
>>> I need to put a checker (assert), to a value of the response that will
>>> be dynamic, so in each iteration the value will change.
>>>
>>> At the moment I solved it with an assert of type "Json assertion" and I
>>> indicated a regular expression, it works and does not fail, but I'm not
>>> sure if it's ok.
>>>
>>> How can I solve that? Thank you
>>>
>>> Lionel
>>>
>>> [image: 1.jpg]
>>> [image: imagen.png]
>>>
>>>

Re: Check (assert) dinamyc value of response.

Posted by Lionel Blanco <ml...@gmail.com>.
 Thanks for answering Felix.
I am going to read the information that you indicate to me.

The data is not in a .csv, I generate it randomly.
They are fake emails that I randomly generate to make a registration, since
I don't know what email it will generate, I don't know how to put an assert
on it
Look at my request code.

[image: imagen.png]

Thanks



El lun., 10 ago. 2020 a las 10:50, Felix Schumacher (<
felix.schumacher@internetallee.de>) escribió:

>
> Am 10.08.20 um 15:31 schrieb Lionel Blanco:
>
> Hi! ,
>
> Thanks for answering Felix.
> My question is this; How do I check these values if in each iteration they change?
>
>
> What type of assert do I use and how do I use it?
>
>
> As I said before, it depends :)
>
> I often know upfront what values I expect for which users and can model
> those expectations in a csv file. That csv file can then be used in the
> test plan to give me each iteration the values I want to ask and the
> answers I should check.
>
> Say you have two users userA and userB, that have different
> email-addresses, that you want to check. You could write a csv file (name
> it whatever you want) with the content
>
> user,email
> userA,something@example.invalid
> userB,different@some.example.invalid
>
> Insert a CSV Data Set Config (
> https://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config)
> and configure it according to your data and the elements documentation.
>
> Now you should be able to refer to the values of one row by the names of
> the columns for each iteration (that is in the simplest case one iteration
> of a thread group) with ${<name of column>}.
>
> In this setup you can use a Response Assertion (
> https://jmeter.apache.org/usermanual/component_reference.html#Response_Assertion)
> in which you refer to the variable you want (say ${email})
>
> If the values you want to assert are inside some data structure, you
> should first extract them via a post processor. For JSON you could use
> https://jmeter.apache.org/usermanual/component_reference.html#JSON_JMESPath_Extractor
>
> Regards
>
>  Felix
>
> This is my response code:
>
>
> [image: imagen.png]
>
> Thanks
>
> Lionel
>
>
>
> El dom., 9 ago. 2020 a las 5:53, Felix Schumacher (<
> felix.schumacher@internetallee.de>) escribió:
>
>> Hi Lionel,
>>
>> If it works, it is OK :)
>>
>> If you want to have a more flexible way of assertion, you can split the
>> extraction from the assertion and use whatever assertion type, that you
>> like.
>>
>> To be able to be more specific, you would have to say a bit more about
>> your problem that you want to solve.
>>
>> Felix
>> Am 09.08.20 um 03:37 schrieb Lionel Blanco:
>>
>> Hello community.
>> I need to put a checker (assert), to a value of the response that will be
>> dynamic, so in each iteration the value will change.
>>
>> At the moment I solved it with an assert of type "Json assertion" and I
>> indicated a regular expression, it works and does not fail, but I'm not
>> sure if it's ok.
>>
>> How can I solve that? Thank you
>>
>> Lionel
>>
>> [image: 1.jpg]
>> [image: imagen.png]
>>
>>

Re: Check (assert) dinamyc value of response.

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 10.08.20 um 15:31 schrieb Lionel Blanco:
> Hi! ,
> Thanks for answering Felix. My question is this; How do I check these
> values if in each iteration they change?
> What type of assert do I use and how do I use it?

As I said before, it depends :)

I often know upfront what values I expect for which users and can model
those expectations in a csv file. That csv file can then be used in the
test plan to give me each iteration the values I want to ask and the
answers I should check.

Say you have two users userA and userB, that have different
email-addresses, that you want to check. You could write a csv file
(name it whatever you want) with the content

user,email
userA,something@example.invalid
userB,different@some.example.invalid

Insert a CSV Data Set Config
(https://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config)
and configure it according to your data and the elements documentation.

Now you should be able to refer to the values of one row by the names of
the columns for each iteration (that is in the simplest case one
iteration of a thread group) with ${<name of column>}.

In this setup you can use a Response Assertion
(https://jmeter.apache.org/usermanual/component_reference.html#Response_Assertion)
in which you refer to the variable you want (say ${email})

If the values you want to assert are inside some data structure, you
should first extract them via a post processor. For JSON you could use
https://jmeter.apache.org/usermanual/component_reference.html#JSON_JMESPath_Extractor

Regards

 Felix

> This is my response code:
> imagen.png
>
> Thanks
>
> Lionel
>  
>
> El dom., 9 ago. 2020 a las 5:53, Felix Schumacher
> (<felix.schumacher@internetallee.de
> <ma...@internetallee.de>>) escribió:
>
>     Hi Lionel,
>
>     If it works, it is OK :)
>
>     If you want to have a more flexible way of assertion, you can
>     split the extraction from the assertion and use whatever assertion
>     type, that you like.
>
>     To be able to be more specific, you would have to say a bit more
>     about your problem that you want to solve.
>
>     Felix
>
>     Am 09.08.20 um 03:37 schrieb Lionel Blanco:
>>     Hello community.
>>     I need to put a checker (assert), to a value of the response that
>>     will be dynamic, so in each iteration the value will change.
>>
>>     At the moment I solved it with an assert of type "Json assertion"
>>     and I indicated a regular expression, it works and does not fail,
>>     but I'm not sure if it's ok.
>>
>>     How can I solve that? Thank you
>>
>>     Lionel
>>
>>     1.jpg
>>     imagen.png
>>

Re: Check (assert) dinamyc value of response.

Posted by Lionel Blanco <ml...@gmail.com>.
Hi! ,

Thanks for answering Felix.
My question is this; How do I check these values if in each iteration
they change?

What type of assert do I use and how do I use it?

This is my response code:

[image: imagen.png]

Thanks

Lionel





El dom., 9 ago. 2020 a las 5:53, Felix Schumacher (<
felix.schumacher@internetallee.de>) escribió:

> Hi Lionel,
>
> If it works, it is OK :)
>
> If you want to have a more flexible way of assertion, you can split the
> extraction from the assertion and use whatever assertion type, that you
> like.
>
> To be able to be more specific, you would have to say a bit more about
> your problem that you want to solve.
>
> Felix
> Am 09.08.20 um 03:37 schrieb Lionel Blanco:
>
> Hello community.
> I need to put a checker (assert), to a value of the response that will be
> dynamic, so in each iteration the value will change.
>
> At the moment I solved it with an assert of type "Json assertion" and I
> indicated a regular expression, it works and does not fail, but I'm not
> sure if it's ok.
>
> How can I solve that? Thank you
>
> Lionel
>
> [image: 1.jpg]
> [image: imagen.png]
>
>

Re: Check (assert) dinamyc value of response.

Posted by Felix Schumacher <fe...@internetallee.de>.
Hi Lionel,

If it works, it is OK :)

If you want to have a more flexible way of assertion, you can split the
extraction from the assertion and use whatever assertion type, that you
like.

To be able to be more specific, you would have to say a bit more about
your problem that you want to solve.

Felix

Am 09.08.20 um 03:37 schrieb Lionel Blanco:
> Hello community.
> I need to put a checker (assert), to a value of the response that will
> be dynamic, so in each iteration the value will change.
>
> At the moment I solved it with an assert of type "Json assertion" and
> I indicated a regular expression, it works and does not fail, but I'm
> not sure if it's ok.
>
> How can I solve that? Thank you
>
> Lionel
>
> 1.jpg
> imagen.png
>