Forum Discussion
I believe what you are looking for is a data replacer. This link should be pretty helpful: https://support.smartbear.com/viewarticle/78486/
Hi,
Firstly I would like to thanks for your help but is is not the answer that I want. Maybe I don't make it clear enough and it makes you to be confused.
Allow me to specify again my case:
- I have an POST request which aims to authenticate user's login and password.
- This request body is the following one:
<root><type>SQL</type><p1>cpt_tm45</p1><p2>smart</p2><p3>0</p3><p5></p5><p6></p6><p7></p7><p8>00000000-0000-0000-0000-000000000000</p8><p9></p9></root>
- And as you can see, value in p1 represents user login and the one in p2 represents user password.
- Now, I have a csv file containing user login and password. Format of this file is:
cpt_tm46;smart
cpt_tm47;smart
=> So, I would like to have something like <root><type>SQL</type><p1>@username</p1><p2>@password</p2><p3>0</p3><p5></p5><p6></p6><p7></p7><p8>00000000-0000-0000-0000-000000000000</p8><p9></p9></root>
, and @username and @password are extracted from my csv file.
This will help me to have a request body like this:
<root><type>SQL</type><p1>cpt_tm46</p1><p2>smart</p2><p3>0</p3><p5></p5><p6></p6><p7></p7><p8>00000000-0000-0000-0000-000000000000</p8><p9></p9></root> if the first line is read
AND
<root><type>SQL</type><p1>cpt_tm47</p1><p2>smart</p2><p3>0</p3><p5></p5><p6></p6><p7></p7><p8>00000000-0000-0000-0000-000000000000</p8><p9></p9></root> if the second line is read
Could we do that with any feature of LoadComplete?
Regards.
- hienhoang889 years agoOccasional Contributor
Hi,
I still stuck with this issue. Here I was trying these following solutions that I could imagine but they doesn't work:
1 - I created the csv file which contains body request, which is ;
<root><type>SQL</type><p1>cpt_tm80</p1><p2>smart</p2><p3>0</p3><p5></p5><p6></p6><p7></p7><p8>00000000-0000-0000-0000-000000000000</p8><p9></p9></root>
<root><type>SQL</type><p1>cpt_tm81</p1><p2>smart</p2><p3>0</p3><p5></p5><p6></p6><p7></p7><p8>00000000-0000-0000-0000-000000000000</p8><p9></p9></root>
but in log, request body is encoded, so I abandoned this solution.
2 - I created a second csv file, which contains :
cpt_tm80;smart
cpt_tm81;smart
and in the request body, I edited it to obtain something like : <root><type>SQL</type><p1>@username</p1><p2>@password</p2><p3>0</p3><p5></p5><p6></p6><p7></p7><p8>00000000-0000-0000-0000-000000000000</p8><p9></p9></root>
but once again, it still fail.
Please note that in my case, I have many requests which are very similar to this one. It means I have many request for which the request body contains only one field which is represented in format XML with many values to be parameterized and I have no value.
If I can't do it, then it is very hard to convince my boss about the advantages that LoadComplete bring to us since with JMeter, we can do it easily.
Many thanks and regards
- baxatob9 years agoCommunity Hero
Hi,
As WesleyG said, you can use a Data Replacer.
In your case it should look like:
The data correlation rule is Get text between two values
- hienhoang889 years agoOccasional Contributor
Hi,
You save my day. So in summary, we have :
- data selectors to get element in response body to reuse it in upcoming request
- data replacers to "parameterize" value in request body. Depending on the kind of parameterization we want to do, there are corresponding option to select.
By the way, allow me to ask other questions :
1 - When I recorded, in my response header, there is one cookie call "ASPSESSIONIDAESDCAAD", but when check with Verify Scenario, other one comes with name "ASPSESSIONIDCEQDDABD".
=> How could we handle this case?
2 - Also after login, in response header of request login, it appears one cookie call "AGENTLESS". How could I parameterize this value since I have a csv file what looks like :
AGENTLESS
cpt%5ftm80
cpt%5ftm81
Related Content
- 8 years ago
- 7 years ago
- 4 years ago
- 8 years ago
Recent Discussions
- 3 years ago
- 3 years ago
- 4 years ago