Forum Discussion

ResMed's avatar
13 years ago

How Do you use Dynamic URLs that have values embedded in them? (ie. /sitename/app/@dynamicvalue/assign)

Hello all,



We are using LoadComplete2.



We have Urls that contain Ids embedded in them, i.e.



http://servier/com/app/userId/assign,



if the client browser post this URL to the server, it includes the data to fill in a cookie,  and the cookie values are saved with the userId of the Url.



When I do a LoadComplete recording, that URL it become hard coded and all virtual users assign thier cookie content to that recorded userId.



The documentatioin on this site seems to assume the link would be  http://servier/com/app/assign?userId=@userId and userID could be turned into a variable.



But that is not how our application behaves.





Can anyone tell me the best way to attack this scenario?   I have to believe its fairly common.


8 Replies

  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi David,


    I recommend that you use the following approach:

    1. Create a data selector to extract the userId from the URL.

    2. Specify the needed variable that will store the extracted value. For this purpose, use the Save to Variable column of the Data Selectors tab.

    3. Replace the userId part in the URL with the following string @Var_name.


    For more information, please refer to the Example 1: Extracting PHP session ID section of the Data Selectors - Overview help topic.


    I hope, this information helps :)

  • I have a similar situation to that described above.



    But when I try the suggested solution, and validate my scenario, the @VarName (@BookRefNo) part of the URL is not being replaced...



    Field...

    Request

    Recorded Value...

    GET /_layouts/WordViewerFrame.aspx?id=http://acv-appres-01:8021/Intelledox/RES%20Documents/Editable/@BookRefNo/RichWebServiceTesting%209-2-2012%2014-16-22.docx&popout=1

    Simulated Value...

    HTTP/1.1 GET /_layouts/WordViewerFrame.aspx?id=http://acv-appres-01:8021/Intelledox/RES%20Documents/Editable/@BookRefNo/RichWebServiceTesting%209-2-2012%2014-16-22.docx&popout=1 HTTP/1.1



    Any idea what I may be doing wrong?



    Thanks, Jim
  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Jim,


    Please clarify a few moments:

    1. Which part have you replaced with the @BookRefNo variable? Post here the initial URL used in the request.

    2. Which regular expression have you used in the data selector?

    3. Post here a screenshot of the Data Selectors tab.


    Thanks.

  • Hi Irina,



    1) Initial URL is...



    GET /_layouts/WordViewerFrame.aspx?id=http://acv-appres-01:8021/Intelledox/RES%20Documents/Editable/AU12006252/RichWebServiceTesting%209-2-2012%2014-16-22.docx&popout=1 HTTP/1.1



    2) Reg exp is: /([AS][FKTU]\d\d\d\d\d\d\d\d)/



    3) Screenshot attached.



    Hope this is what you need.



    Thanks for quick response. Jim
  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Jim,


    I'm sorry, I misunderstood you. As far as I can see from the picture you posted here, you are trying to extract data from the header of the GET request. If I'm right, it's impossible to do that with the current version of LoadComplete. Now, LoadComplete lets you retrieve data only from the response bodies. For more information, see the Data Selectors - Overview help topic.


    As for retrieving variable parts from request headers and URLs, there is such a suggestion in our DB and your request has increased its rating. Thanks for your feedback.


  • Hi Everyone,





    We have recently created a patch for LoadComplete 2.10 - the patch improves the URL parameterization functionality the way it was requested in this thread.

    That is, now you can parameterize an arbitrary part of the URL string by putting a variable name (@varname) to the needed location.





    If you can benefit from this functionality, please feel free to request the patch from our Support Team. Make sure to mention this Forum thread in your submission.