Forum Discussion

pandap's avatar
pandap
Contributor
11 years ago

Help with Performance Test using Strategy Script

Hi,

As part of the performance test we need to send thousands of requests every hour which are not evenly spread, so every second the count of request will change. To do this I am planning to use strategy script and get the request count for each second using data source. Is this possible and if yes please share how to loop through the data source in the strategy script.

Any information will be great help.

Thanks

2 Replies

  • Hi All,

    I had created two Data Source Steps, One getting the thread count and other one getting getting values for the request. I am storing the thread count into a variable using following code under event LoadTestRunListener.afterTestStep

    GetThreadValue = testRunner.testCase.getTestStepByName( "ThreadCount_DS" )
    def newValue = GetThreadValue.getPropertyValue("Thread_Count1")
    loadTestRunner.loadTest.testCase.testSuite.setPropertyValue( "MyValue", newValue )

    and then getting the value in script strategy using following code:

    def newValue = loadTestRunner.loadTest.testCase.testSuite.getPropertyValue("MyValue")
    return newValue

    When I execute the LoadTest I am seeing the thread count is changing but the issue I am facing is after 15 - 20 seconds the thread are not getting created and the test hangs I have to manually end the test. I have 60 records in the Thread Count Table and the Load Test set for 60 Seconds Limit, so expectation is it should run with variable thread counts for complete 60 seconds.

    Anybody encountered similar issue.

    Prashanth