Now-a-days users don’t want to sit with the slowly performing applications when they are doing online-booking, purchasing products etc. To provide the speedy applications to the users, performance testing is essential. In this article, we will have a look at how to do performance testing of a Salesforce application using LoadRunner– a commercial performance testing tool by Hewlett-Packard.
LoadRunner is the performance testing tool that helps to capture the system performance. It can act as a real user and it applies the user load on server to get the system responsiveness. Also, it supports more number of protocols and scripting languages.
LoadRunner has three components and details below
- VuGen – Helps to create the performance test script based on client and server communication. It has record and replay options.
- Controller – It is used to run and manage the performance tests.
- Analysis – It provides the detailed results of test including different types of graphs.
Scenario Used for Sales Force Application Scripting:
- Log into the Salesforce application
- Click Lead tab to create a Lead
- Fill in the fields for lead creation
- Click the Save button to save the lead
- Click the Convert button
- Again, click Convert button to convert the lead
- Verifies the Lead has converted by checking the Account and Contacts page
Performance Test Script Preparation:
Using VuGen, we can record and prepare the test script by doing the business actions. Once VuGen is opened, we can create a new script by clicking the Add New script icon. Here, the Web-HTTP/HTML protocol is selected for recording.
Click the Start Recording button to record the Salesforce business action. Enter the Salesforce Login URL in URL Address box and click start recording. Once we start the recording, it will capture all the data used in the browser
After completing all the steps mentioned in the business scenario, we can click the stop recording button and the LoadRunner finalizes the recording process and tests script is generated using C language
We have the recorded script here and the script is recorded for single user behaviour. We need to make sure that the script will work for multiple users to simulate a real-time user by doing below customization,
Parameterization (helps to simulate different user inputs):
Done the parameterization for Contact Name with different Values as below:
- First created the ‘.dat’ file. In the file, we can insert multiple values (Every time will create new contact for new user).
- Then, created a new variable called P_ContactName with Parameter type as ‘File’
- Replaced the Contact Name with created Parameter Name
Similarly, we have done the Parameterization for Username, Password, and Account Name.
Correlation (To Handle the dynamic data which is returned by server):
After recording, the script correlation was done for the dynamic value ‘RecordID’ as below:
- Used Code Generation Log for checking where exactly the ‘RecordID’ is present
- Selected the Left boundary and right boundary for the first occurrence(ordinals) for RecordID
- In ‘Response Body’ found the RecordID value
- Created the Correlation function (web_reg_save_param) to get the dynamic value for ‘RecordID’. Correlation function is below
- Replaced the dynamic value of ‘RecordID’ with created Correlation value C_RecordID.
- In the same way, done the correlation for other values like Confirmation IDs and replaced with the correlated value.
Performance Script Validation:
A verification point in the form of text check is inserted before closing the transaction to confirm that the server is responding with the correct response. In case the response is not as expected, the text check will fail, and that will fail the whole transaction also.
In the same way, keep the text check for every page to verify all the pages loaded accessing in the application and validate the same by running multiple iterations.
By using controller, we can setup the performance test scenario to run the performance test. Once the customization of the script is complete, we need to upload the script into the controller. Here we Configured the settings in controller to run the test for 10 mins with 2 users. After the test scenario is ready, we can click the run button (highlighted) below and it completes the test after 10 mins.
After execution of the test, the Controller combines all the monitoring logs and it makes them available in analysis component. In Analysis, we can get the performance test results for the test ran. Below result shows the Response Time for each transaction.Also, the LoadRunner provides different types of graphs to find the performance issues. Below is the Hits/Second and throughput graph.
Hits Per Second Graph: No of requests made to the server
Throughput: No of responses received from the client server
Note: Hits per second graph and Throughput graph values should be directly proportional.
Using LoadRunner, we can measure systems’ end-to-end performance and can identify the performance issues before the application goes to production/end-user. It provides very detailed test results and helps analyze the performance issues.