Monday, 12 September 2016

Parameterisation /Correlation /Synchronization

Parameterisation 

Using Parameterization we can execute one test plan for more than one user at the same time. This is a method of generalizing an action for many users.

Suppose, we have to do load test of a search engine, for that we record the search scenario. Now to do effective load test, we can't just playback the script for say 100 users. We should simulate 100 users that search for 100 different things. Here we need parameterization, wherein we can have a CSV file that contains 100 different items. Now instead of the static search item that we had recorded in our script we can include the search items from the CSV file dynamically.

                          We will use 'CSV Data Set Config'. to achieve this in JMeter


Correlation 


  • Correlation is an important aspect in creation of performance testing scripts. It fetches dynamic values from earlier responses and supplies those values to subsequent requests.
  • It’s a procedure to fetch a dynamic value from earlier responses and using that value in subsequent steps
  • Correlation in JMeter can be achieved using Regular Expression Extractor,HTTP URL Rewriting etc. post-processor. 

Suppose we have recorded a scenario in which 

User enters login details and click OK button
Home page opens and user take further actions 

      Now, if we just playback this script, the test will fail even for a single user. This is because of the authentication mechanism used. When we login to a website, session variables are dynamically created. These session variables are passed to the subsequent requests and help validation and authentication of the actions performed. So, one cannot just record and playback the requests having these variables. Here, we need to correlate the web requests with the dynamic variables. And for correlation,
 
    we need to use the "Regular Expression Extractor" which makes use of regular expressions.



Synchronization 


  • Coordinating  two or more activities, devices, or processes in time.
  • We need  Synchronization to avoid the condition like deadlock.
         We can achieve synchronization  by using 'Interthread commincation Preprocessor'and    'Synchroization Timer'


No comments:

Post a Comment