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