AJAX TruClient - Issue in Multiple Iteration

Hi Team,


When I am trying to iterate "Action" part more than one time, application session is getting expired.


I have put login part of application in "Init" Section and logout part in "End" section.


After last step of action part, we are getting blank page in browser.


Please find the attached screenshot for reference.





  • Verified Answer

    This is because Simulate New User on each iteration feature is turned on (in the Run Time Settings) by default.

    Either uncheck it or move the login/logout logic to be part of the Action action.

  • Hi Rosenthal,


    Thanks for a quick response. Its working now.




  • Hi, I am bumping into a similar problem with TruClient Ajax where the session ID of the logged in user is also lost due to private browsing, however the solution provided to untick the option in runtime settings: "Simulate a new user on each iteration" does not resolve my particular problem.


    i am using HP Loadrunner 11.52 and I have recorded a session through the HP TeamSite web application which is a content management suite based upon ExtJS JavaScript framework, Ajax calls, and other J2EE backend.


    What I see happening is that the script logs in the user into the UI, then the user wants to click on a portlet link, but the portlet link has a login dialog due to the fact that the private browsing removed the session id.


    How can I script the session id into the TruClient script. Can someone point me to a resource that explains specifically how to develop this javascript into the script?


  • Hi,

    Can you share the script? which version are you using?

    If you can elaborate more on the BP it would be great.

  • The test suite I am trying to build is attached.


    With BP you mean business plan or business case?


    The customer has an objective of having 25 concurrent users kick off this workflow at some stage in 2014. We are testing internally in HP the scalability of the workflow scripts. The workflow uses a combination of Perl and Java scripts to do backend processing of incoming content in the form of XML. The content management tool includes a session based UI. Session is being checked during the life cycle of a content item which includes several approval steps in the workflow.


    Let me know where you want me to elaborate more on.

  • Hi,

    1. BP - Business Process

    2. Which LR version are you using?

    3. It is TC IE script but you mentioned private browsing (which exists only in TC FF).

    4. The script is empty...


  • 1.  The business process can be illustrated by this example:

    I am working in the marketing department and I want our client care representative to say to our customers: "Thanks for calling our help line, what can I assist you with today?". This has to be translated in 10 languages. Once I have updated the content item in the HP TeamSite web application's web form, I publish this content item. HP TeamSite copies the content update onto new or existing language versions of the content and updates the status of each of these items in the user interface's widget to show all stakeholders the updated status. The translator then takes on translation for each of the languages and approves. Then, a validator validates the work and passes the workflow job onto a final business approver. After the approver finalizes the work, the asset is being copied across to be picked up by an application that renders the phrases into the interview scripts that the client care rep uses in a phone conversation with the customer.


    This is one of the use cases of this business process.


    2.  I am using LR11.52 to support performance analysis of the workflows


    3.  I tried to use several protocols in my efforts and i have been moved into the direction of TruClient Ajax by HP Loadrunner experts in a Lync forum. I am really a novice, but I find that the recoding of the BP has gone allright end-to-end apart from the loss of the session ID in step 20. I think I do not want private browsing to take out my session cookie, but the TruClient seems to be fit-for-purpose to my objectives apart from this feature.

    4. I am trying again with the attachment loader. If it fails again, I will email you the zip file instead, is that ok?

  • Hi, I got over this issue just now, it was a product training issue. I learned that adding a javascript evaluation step before the failing step and adding the required cookies got me further in the test replay. This message helped me:




    I set these cookies and I was able to continue the journey to develop the test


    document.cookie = 'JSESSIONID=97CC004632E930D926C9ECCE2E07D157; path=/;  domain='
    document.cookie = 'iw_user=Administrator; path=/;  domain='
    document.cookie = 'iw_domain=WIN8KTS732; path=/;  domain='
    document.cookie = 'IWAUTH=52616e646f6d49561e14f912701a744e798d9e21f64719cb3836a94daebf891c5e4c2e81704c70fa541e573c34d0f48ab7c46a157d45f51b5d6340e523e487d1f11eda8af8dafd90; path=/;  domain='

  • After I finished the first step of a full replay with 1 user session, I have now parameterized the user. Unfortunately, the cookie handling pops up again as a challenge here. Could you give me some further advice/tutorial/training with this step:


    In the Evaluate Javascript code step before the web application rerenders the UI, I have this now:


    document.cookie = 'JSESSIONID=7D5B9DC81498CDF9991DBD2DFD9A85A3; path=/;  domain=' ;

    document.cookie = 'JSESSIONID=7D5B9DC81498CDF9991DBD2DFD9A85A3; path=/;  domain=' ; document.cookie = 'iw_domain=WIN8KTS732; path=/;  domain=' ;

    if (LR.getParam("GetUserName", "Administrator")) {  document.cookie = 'iw_user=Administrator; path=/;  domain=' ;  document.cookie = 'IWAUTH=52616e646f6d49561e14f912701a744e798d9e21f64719cb3836a94daebf891c2e8e18a7f0350bdf1cd93a76b008d90a44f961ea8a0f3eddba0f64c6c45302b9; path=/;  domain=' ; } else if (LR.getParam("GetUserName", "contributor")) {  document.cookie = 'iw_user=contributor; path=/;  domain=' ;  document.cookie = 'IWAUTH=52616e646f6d49561e14f912701a744ee287f540dd4e85ee124dfc4cbe8abb826235d91b6cf5ec66f535cd2a4a795beb7b0be062bcc07f9e1bbaa36278430838; path=/;  domain=' ; } else if (LR.getParam("GetUserName", "translator")) {  document.cookie = 'iw_user=translator; path=/;  domain=' ;  document.cookie = 'IWAUTH=52616e646f6d49561e14f912701a744ea9bb5bf04d1d53bb33fe212ce85e48f5511efb6b18305090834cdd6b30403f24c3418321512bdaf3; path=/;  domain=' ; } else if (LR.getParam("GetUserName", "validator")) {  document.cookie = 'iw_user=validator; path=/;  domain=' ;  document.cookie = 'IWAUTH=52616e646f6d49561e14f912701a744e5f355457bb4cc22360042dad56cec3f2c54ee98ae564f257fae4bea99c1562f582f04c1ee974321d; path=/;  domain=' ; } else if (LR.getParam("GetUserName", "publisher")) {  document.cookie = 'iw_user=publisher; path=/;  domain=' ;  document.cookie = 'IWAUTH=52616e646f6d49561e14f912701a744e6198f34689088d45f41799f9edb79d9b5ce8626d076f587be1164e241d286623a9ccebada8f7090f; path=/;  domain=' ; } //fallback to administrator if nothing else works else { }



    When I replay, the administrator username seems to be parsed.


    I did a search on the forums and in the truclient pdfs on how to put a if else block like this in place, and how to call the parameters, but I am sure I am doing something silly here still


    Can you verify something obvious I am doing wrong ?