Forum Discussion

sguda's avatar
sguda
Regular Contributor
14 years ago

Getting error while switching from keyword test to Load test.

Hi,



I am trying to develop Load test. The test is about filling different steps of application. Everytime the load test runs  2 fields, Last Name and SSN have to be unique on first step. For the functional key word testing I have included the logic to increment Last Name and SSN so that every time the test runs it creates new application.



Since it is not possible to incremnet the values in the load test, I have recorded the logIn and first step features as key word test and developed as Load test from the second step of application.



So in my keyword test I have key word test to execute and then the load test.

It is excuting the keyword test fine but while starting to execute the load test, it is giving me the error saying "unable to locate any feature matching scope" like in the snap shot I attached.



One thing I want to mention is after recording the key word test, on step 2 I started developing the load test, at that time it opened a blank page for me asking for test name and task name. I gave the names and closed the blank page browser and developed the load test on the browser I had it on screen from previous recording that is from step 2.





So please suggest me how to get rid of this error while playing back load test.



Or is there any other way i can increment the values for the two required fields in my load test instead of having keyword test for step 1 and load test for rest of the steps.




7 Replies

  • sguda's avatar
    sguda
    Regular Contributor
    Actually i recorded a load test without the keyword test and tried to execute it. i am still getting the same error.

    So looks like it is not running th load test at all on my machine.
  • sguda's avatar
    sguda
    Regular Contributor
    I have resolved this issue.



    I am attaching the zip file of my Load test developed and the logs.



    But now I am trying to acheive this in 2 ways to allow uniques values to those Last Name and SSN Fields.



    1. when I tested the firststep as Keyword test( where i increment the values everytime for Last Name and SSN to be unique) and then perform load test from second step. In this process, after executing the keyword test, it is keeping the step 2 of the browser application open and it starts running the load test but it is failing the test when I see the log.



    The keyword test is Test3, the load test it excutes aftre that is FAFSA_11_12.



    2.The second way is I  developed the load test (FAFSA_Ind1_11_12) and the task :FAFSA_Ind2_11_12. The test is running is fro 40 minutes.

    In my script (Inc_RunLoadTest, subroutine: Load_Test), I am using this logic to increment the unique values.

    The code i am using is :




    Sub Load_Test



    ' Get the scripting interface to the test

     




    'Set the task***************************************************************

     



    Set TaskVar = LoadTesting.HTTPTask("FAFSA_Ind2_11_12")



    'Set the Load test to be executed*******************************************

     



    Set LoadTest = LoadTesting.Tests.TestByName("FAFSA_Ind1_11_12")



    'Increment the Last Name****************************************************

     



    Project.Variables.G_LastName_Num = Project.Variables.G_LastName_Num + 1



    Project.Variables.G_LastName_Str = aqConvert.IntToStr(G_LastName_Num)



    Project.Variables.G_LastName = aqString.Concat(Project.Variables.G_LastName_Prefix,Project.Variables.G_LastName_Str)



    'Increment the SSN************************************************************

     




    Project.Variables.G_SSN_Num = Project.Variables.G_SSN_Num + 1



    Project.Variables.G_SSN_Suffix = aqString.Format("%04i",Project.Variables.G_SSN_Num)



    Project.Variables.G_SSN = aqString.Concat(Project.Variables.G_SSN_Prefix, Project.Variables.G_SSN_Suffix)


    '************************************************************************************************************

     





    Set request = TaskVar.Connection(16).Request(2)




    ' Set Cnt = request.ContentDisposition.Item()




    request.BodyVariables.Item("ctl00_ContentPlaceHolder1_grdFAFSA_ctl00_ctl06_RadTextBox1_text") = Project.Variables.G_LastName


    request.BodyVariables.Item("ctl00_ContentPlaceHolder1_grdFAFSA_ctl00_ctl22_RadMaskedTextBox1_text") = Project.Variables.G_SSN




    ' Set Cnt = request.ContentDisposition.Item("ctl00_ContentPlaceHolder1_grdFAFSA_ctl00_ctl06_RadTextBox1_text")


    ' Set Cnt = request.ContentDisposition.Item("ctl00_ContentPlaceHolder1_grdFAFSA_ctl00_ctl22_RadMaskedTextBox1_text")





    ' Run the test

     



    LoadTest.Execute

    End Sub





    This way the load test is executing. I see the script logic is incrementing the values. i am updating the values in request body of the request. But looks like it is not doing that, I saw the log that is warning or failing and not giving appropriate response times.



    Can anybody suggest what i am doing wrong or how i can acheive this.



    Or can i do this with parameterization.










  • rastech1's avatar
    rastech1
    Occasional Contributor
    Hi Sri Guda



    I also working on load test with scripting.



    As far as I understand you insert a variable via wizard , so what is the variable FAFSA_Ind2_11_12 ?



    Is it a database or something else like list. ? If so which type of database ?



    And I just wonder, by swithcing keyword test to load test you mean take a keyword record and convert it to script ?



    Doing this makes something like Alies.. Or you just write the script from strach.


  • sguda's avatar
    sguda
    Regular Contributor
    Hi Rasim,

    In my application, i have to login and fill in seven pages of application.

    But on first page the feilds Last Name and SSN have to be uniques everytime the load test runs.

    So acheive that since it is not possible to increment values of those fields like in functional test, i developed key word test for login ad filling in the first page, in which i included the script to increment valueas of those fields as you can see in my code.

    G_LastName and G_SSN. From second page onwards i recorded as load test.

    \

    But when i am executing the keyword test which has key word test for log in and first page of application and the load test for remaining pages , it is executing first part (i.e) keyword test firne but not licking up load test i developed for rest of pages of application.



    2nd method i followed is developed load test from login to all pages of application and trying to execute script to increment variables for those feilds in the request body of the task as you can see in the script, but looks like incrementing part is doing fine but not updating the variable of the request body, so it is failing



    In my script FAFSA_Ind2_11_12 is the task , FAFSA_Ind1_11_12 is the  test.



    Let me know if you have any ideas.\



    I need toi acheive this some how. Please help me in this if there is any other way to do this.
  • rastech1's avatar
    rastech1
    Occasional Contributor
    Sri Guda, can you zip all folders under your your problematic project suite and send me via rasim.avci@gmail.com so that I will investigate the issue, maybe I can find a solution. The zip file before your send in this form does not working, all files are missing.
  • Hello Sri,



    It is possible to make a Load Test use different parameter values for different Virtual Users without scripting. To learn how to do this, please check the Load Testing Variables help topic, and also the Incremental Variables help topic - looks like this is the type of a variable you will need to use.



    You can also learn more about load tests parameterization by reading the Handling Dynamic Parameters and Modifying Request Variables help topics.



    To see the functionality you need in action, you can watch the What’s New in TestComplete 8.10 webinar recording. The part where Load Testing improvements are discussed is about 30 minutes from the beginning.



    I hope this helps.
  • sguda's avatar
    sguda
    Regular Contributor
    Thanks Alex, i will try this and let you know if i have any more questions.