Check (assert) dinamyc value of response.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Check (assert) dinamyc value of response.

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

Reply | Threaded
Open this post in threaded view
|

Re: Check (assert) dinamyc value of response.

Felix Schumacher

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

Reply | Threaded
Open this post in threaded view
|

Re: Check (assert) dinamyc value of response.

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?

This is my response code: 

imagen.png

Thanks

Lionel


 

El dom., 9 ago. 2020 a las 5:53, Felix Schumacher (<[hidden email]>) 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

Reply | Threaded
Open this post in threaded view
|

Re: Check (assert) dinamyc value of response.

Felix Schumacher


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,[hidden email]
userB,[hidden email]

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 (<[hidden email]>) 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

Reply | Threaded
Open this post in threaded view
|

Re: Check (assert) dinamyc value of response.

Lionel Blanco
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.

imagen.png

Thanks



El lun., 10 ago. 2020 a las 10:50, Felix Schumacher (<[hidden email]>) 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,[hidden email]
userB,[hidden email]

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 (<[hidden email]>) 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

Reply | Threaded
Open this post in threaded view
|

Re: Check (assert) dinamyc value of response.

ra0077
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 <[hidden email]> 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.

imagen.png

Thanks



El lun., 10 ago. 2020 a las 10:50, Felix Schumacher (<[hidden email]>) 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,[hidden email]
userB,[hidden email]

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 (<[hidden email]>) 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

Reply | Threaded
Open this post in threaded view
|

Re: Check (assert) dinamyc value of response.

Flavio Cysne
In reply to this post by Lionel Blanco
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 var_value_to_verify.

On Mon., Aug. 10, 2020, 9:59 a.m. Lionel Blanco, <[hidden email]> 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.

imagen.png

Thanks



El lun., 10 ago. 2020 a las 10:50, Felix Schumacher (<[hidden email]>) 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,[hidden email]
userB,[hidden email]

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 (<[hidden email]>) 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

Reply | Threaded
Open this post in threaded view
|

JMeter cause Windows crash?

John Melom-2
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
Reply | Threaded
Open this post in threaded view
|

RE: JMeter cause Windows crash?

Herbener, Martin - Division of School Technology Planning and Project
 Management
In reply to this post by Flavio Cysne
Not a heavy jmeter user, but I've never seen anything like that and it seems unlikely.

Martin

-----Original Message-----
From: John Melom <[hidden email]>
Sent: Tuesday, August 11, 2020 10:31 AM
To: JMeter Users List <[hidden email]>
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: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Check (assert) dinamyc value of response.

Lionel Blanco
In reply to this post by Flavio Cysne
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 (<[hidden email]>) 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 var_value_to_verify.

On Mon., Aug. 10, 2020, 9:59 a.m. Lionel Blanco, <[hidden email]> 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.

imagen.png

Thanks



El lun., 10 ago. 2020 a las 10:50, Felix Schumacher (<[hidden email]>) 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,[hidden email]
userB,[hidden email]

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 (<[hidden email]>) 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

Reply | Threaded
Open this post in threaded view
|

Re: Check (assert) dinamyc value of response.

Felix Schumacher


Am 11. August 2020 21:06:44 MESZ schrieb Lionel Blanco <[hidden email]>:
>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
>(<[hidden email]>)
>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,
><[hidden email]>
>> 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 (<
>>> [hidden email]>) 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,[hidden email]
>>>> userB,[hidden email]
>>>>
>>>> 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 (<
>>>> [hidden email]>) 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: JMeter cause Windows crash?

Felix Schumacher
In reply to this post by Flavio Cysne
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 <[hidden email]>:

>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
Reply | Threaded
Open this post in threaded view
|

Re: Check (assert) dinamyc value of response.

Lionel Blanco
In reply to this post by Felix Schumacher
I extract the value:

Imagen 1.jpg
And I pass the variable:

imagen.png


Am I doing something?

Thanks Felix

El mar., 11 ago. 2020 a las 16:14, Felix Schumacher (<[hidden email]>) escribió:


Am 11. August 2020 21:06:44 MESZ schrieb Lionel Blanco <[hidden email]>:
>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
>(<[hidden email]>)
>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,
><[hidden email]>
>> 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 (<
>>> [hidden email]>) 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,[hidden email]
>>>> userB,[hidden email]
>>>>
>>>> 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 (<
>>>> [hidden email]>) 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Check (assert) dinamyc value of response.

Felix Schumacher
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 <[hidden email]>:

>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 (<
>[hidden email]>) escribió:
>
>>
>>
>> Am 11. August 2020 21:06:44 MESZ schrieb Lionel Blanco <
>> [hidden email]>:
>> >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
>> >(<[hidden email]>)
>> >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,
>> ><[hidden email]>
>> >> 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 (<
>> >>> [hidden email]>) 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,[hidden email]
>> >>>> userB,[hidden email]
>> >>>>
>> >>>> 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 (<
>> >>>> [hidden email]>) 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: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
Reply | Threaded
Open this post in threaded view
|

Re: Check (assert) dinamyc value of response.

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 (<[hidden email]>) 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 <[hidden email]>:
>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 (<
>[hidden email]>) escribió:
>
>>
>>
>> Am 11. August 2020 21:06:44 MESZ schrieb Lionel Blanco <
>> [hidden email]>:
>> >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
>> >(<[hidden email]>)
>> >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,
>> ><[hidden email]>
>> >> 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 (<
>> >>> [hidden email]>) 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,[hidden email]
>> >>>> userB,[hidden email]
>> >>>>
>> >>>> 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 (<
>> >>>> [hidden email]>) 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: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
Reply | Threaded
Open this post in threaded view
|

Re: Check (assert) dinamyc value of response.

Felix Schumacher

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 [hidden email]. 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 [hidden email].

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 (<[hidden email]>) 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 <[hidden email]>:
>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 (<
>[hidden email]>) escribió:
>
>>
>>
>> Am 11. August 2020 21:06:44 MESZ schrieb Lionel Blanco <
>> [hidden email]>:
>> >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
>> >(<[hidden email]>)
>> >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,
>> ><[hidden email]>
>> >> 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 (<
>> >>> [hidden email]>) 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,[hidden email]
>> >>>> userB,[hidden email]
>> >>>>
>> >>>> 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 (<
>> >>>> [hidden email]>) 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: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>