Forum Discussion

bjohnson_1's avatar
bjohnson_1
Occasional Contributor
13 years ago

Session ID Extraction

I am scripting a load test within Test Complete. I recorded the test successfully, but there is a form of sessionID in the URL's. I need to extract the SessionID from the first response and use it in subsequent request transactions. From what I have gathered so far, I would do this via Data Selectors.



Here is the line I get in the response:

/test.com/(S(if5w4bzl15fhmzs3mxr0gp4p))/test.aspx



The session id used is everything between (S( and )). What would the expression look like for me to extract that value?



Then the subsequent request I will need to replace that values looks something like this:

GET /test.com/(S(if5w4bzl15fhmzs3mxr0gp4p))/test.aspx HTTP/1.1



How do I now specify what is to be replaced in the next request?





Thanks

3 Replies

  • Hi Brent,



    Then the subsequent request I will need to replace that values looks something like this:

    GET /test.com/(S(if5w4bzl15fhmzs3mxr0gp4p))/test.aspx HTTP/1.1


    As far as I know, the fact that such URLs appear means that the ASP.NET Cookieless feature is used. TestComplete doesn't have a special feature that handles parameters passed in such a way. I have registered a suggestion to implement support for such parameters in our DB.



    As for now, you can try creating a custom script that will modify the request's header in the needed way. To learn how to create such scripts, please refer to the Modifying Traffic in Scripts help topic.
  • bjohnson_1's avatar
    bjohnson_1
    Occasional Contributor
    Does Load Complete have this functionality already built in to deal with ASP.NET cookieless sessions?
  • Hi Brent,



    No, it doesn't. Please note that the development of the HTTP load testing functionality in TestComplete is frozen (for additional information, see this thread), so the suggestion is going to be considered as an improvement idea for LoadComplete.