Forum Discussion

sarya's avatar
sarya
Frequent Contributor
15 years ago

Lots of errors on load test run - Connections and requests simulated partially

Hi,



I am doing a load test on the server .I am doing it through the script.As of now,trying it for 20 users but eventually will increase it to 250 users.Here is the script. : The results show a lot of connections and requests that are simulated partially . I came across a script on falafel blog regarding "Changing viewstate " through script and passing it in response. So can that be a problem if it is not being updated for all the users ? Do I need to bring up the viewstate change script in my load test. I did not really get it like how to change the viewstate ,my code is in javascript.Can somebody tel me how to change the viewstate through script for the code below?




function SignInSignOut()


SignInSignOut()

{

var VirtualUsers, TestInst, i, TaskVar, request,Load;


VirtualUsers = new Array();


Logins = new Array();



// Creates a new load test



TestInst = LoadTesting.CreateTestInstance("TestInstance2");



for(i = 1; i<=7; i++)


(i = 1; i<=7; i++)

{



// Obtains the task



TaskVar = LoadTesting.HTTPTask("Task7");



// Creates a virtual user and specifies the task and test for it



VirtualUsers = LoadTesting.CreateVirtualUser("VirtualUser" + aqConvert.VarToStr(i));


VirtualUsers.Task = TaskVar;


VirtualUsers.TestInstance = TestInst;



// Modifies the request variable



request = TaskVar.Connection(3).Request(3);


Logins = aqString.Concat("Load",i);


request.BodyVariables.Item("username") = Logins;


request.BodyVariables.Item("password") = "password";



Log.Message( VirtualUsers.Task.Connection(3).Request(3).BodyVariables.Item("username") );


.Message( VirtualUsers.Task.Connection(3).Request(3).BodyVariables.Item("username") );

}



// Runs the task



TestInst.Run("Task7");


}



Thanks,

Sumedha


3 Replies

  • Hello Sumedha,




    You do not need to handle the Viewstate value in your script. Latest versions of TestComplete do this automatically - you just need to enable Viewstate value handling in the LoadTesting project item properties. For details, see the "LoadTesting Project Item Editor" help topic.




    To help you with the partially simulated connections problem, I need to see the recorded task and results of its execution. Please zip the entire project suite folder and send me the archive using the following web page:


  • sarya's avatar
    sarya
    Frequent Contributor
    Hi,



    Can you please tell me if I can change the viewstate in the script (shown above in the post) and try to run to see if the partially simulated connections errors get reduced.Also can I use the same task in the script for all the users or do I need to create a copy. I read the help files to see how to allocate task but it would be helpful if you can provide me some help as in how to use viewstate for my script or do I need to create indivdual task copies for each of the user.

    I am trying to get error free load test since months but still no luck.Please help me fast.



    Thanks,

    Sumedha
  • Hello Sumedha,




    Yes, you can handle the Viewstate value in your script. You can find a sample script here:





    However, I would not advise doing this - TestComplete can handle the value itself.

    If you want to check whether the value is processed correctly by TestComplete, you can implement the OnLoadTestingResponse event handler:

    - in the handler's code, save the actual server response to a text file;

    - after the test is executed, you can compare the Viewstate values returned in server responses against the values sent in the appropriate requests (see Load Testing results, the sent values are in the request headers).




    >>> Also can I use the same task in the script for all the users or do I need to create a copy.

    Yes, you can do this - even when using the same task for all users, TestComplete handles the Viewstate value individually for each user.