Forum Discussion

axedesign's avatar
axedesign
New Contributor
10 years ago

Why data modifiers is not modifing parameters in reqest

I'm new to LoadComplete. I'm fighting with load test preparation and I've stuck with data modifiers. I read the documentation and tried figure it out but I need someone to help me to show where I'm making mistake.

 

I have request-response-request chain:

 

Reponse:

<?xml version="1.0" encoding="UTF-8"?>
<serviceResponse returnLength="2">
<output name="mainCaseId"><variable type="String"><![CDATA[76209]]></variable> </output>
<output name="error"><variable /> </output>
</serviceResponse>

 

I did a correlation in Parameters tab and assigned value 76209 to a variable vMainCaseId.

 

Now I want to populate value 76209 into succeeding request (below)

Request:

GET /portal/jsp/callService.do?serviceRef=1.dcc8b725-7894-44c7-af42-a61875970bf3&snapshotId=2064.e66d1293-fdd9-438c-bea1-784d9f58f778&input=%3Cinput%20name=%22elementValue%22%3E%3Cvariable%20name=%22mainCaseId%22%3E99999%3C/variable%3E%3C/input%3E HTTP/1.1

 

I need to put 76209 instead of 99999 (highlighted)

 

I tried Data Modifiers tab:

%3E(\d{3,})%3C --> vMainCaseId

mainCaseId%22%3E\K(\d{3,}) --> vMainCaseId

 

and few more but no luck. 

 

How should it be done corectly?

 

How can I debug what and see what values are actualy catched into variables?

 

Thanks in advance for any hints.

 

/Olaf

 

3 Replies

    • axedesign's avatar
      axedesign
      New Contributor

      Hi Ryan,

       

      Thanks for feedback.

      I did try both methods you offer and put variable into the request but no luck at all.

       

      Documentation about parametrisation of URLs says that:

       "Variables followed by characters other than the separators /, ? and &. Semicolons (;) are not separators"

      and the problem here is that the value I want to replace is not followed by any of above separators.

       

      GET /portal/jsp/callService.do?serviceRef=1.dcc8b725-7894-44c7-af42-a61875970bf3&snapshotId=2064.e66d1293-fdd9-438c-bea1-784d9f58f778&input=%3Cinput%20name=%22elementValue%22%3E%3Cvariable%20name=%22mainCaseId%22%3E99999%3C/variable%3E%3C/input%3E HTTP/1.1

       

       

       

      Any clue?

       

      Thanks,

      Olaf

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi Olaf,

     

    First (this will be referenced below), decoded value for the request is:

    GET /portal/jsp/callService.do?serviceRef=1.dcc8b725-7894-44c7-af42-a61875970bf3&snapshotId=2064.e66d1293-fdd9-438c-bea1-784d9f58f778&input=<input name="elementValue"><variable name="mainCaseId">99999</variable></input> HTTP/1.1

     

     

    I would try the following:

    -- It is my guess that you are using Data Selector to get the value of mainCaseId into the vMainCaseId variable;

    -- Assume, that the regexp for this Data Selector is '<!\[CDATA\[(\d{3,})\]\]>';

    -- Now, try to put something like this into the Subexpression field for this DataSelector:

    <input name="elementValue"><variable name="mainCaseId">$1</variable></input>

    I.e., you will assign to the vMainCaseId variable not just case id, but the whole value of the 'input' URL parameter;

    -- And finally, assign the following for the subsequent request:

    GET /portal/jsp/callService.do?serviceRef=1.dcc8b725-7894-44c7-af42-a61875970bf3&snapshotId=2064.e66d1293-fdd9-438c-bea1-784d9f58f778&input=@vMainCaseId HTTP/1.1

     

    Does this work?