Challenge
Not all users respond to an application at the same pace. How can a test case emulate a realistic variation in user aptitude and response?
Solution
“Computer Think Time” is the amount of time taken between executions of steps in a Scenario. In many cases, it may be acceptable to set a global Think Time which uniformly pauses between steps, regardless of user. However, in the real world, users vary in their speed and aptitude. Therefore, to test an application in a way that replicates real user deviation, there needs to be a way to vary Think Time by user.
In ScenarioBuilder this can be accomplished quite easily.
Let’s assume our Scenario logs into an application with various user accounts. User accounts and passwords can be stored in a CSV file and attached to a Scenario to be retrieved randomly. Additionally, other user specific values can be stored in this same file. In this case, we’ll add a third column called “TT” to set a Think Time for each user (in ScenarioBuilder Think Time is stored in milliseconds, so a one second Think Time would be 1000 milliseconds). Our CSV file looks like this;
Now, in ScenarioBuilder we’ll attach the CSV file at the Scenario level and set the “Variable Access Type” to “Random”;
We’ll build a Scenario in which users log into the application and perform data entry. In our example, we’ll use two Components, one that contains the login steps and one that contains the data entry steps. Our Scenario looks like this;
Now let’s set the Think Time for the Components. Notice at the Scenario level we have a “Computer Think Time” of 1000. This value can be overridden at the Component level. When we open up our “Log In” Component we see this;
If we uncheck “Use Scenario Think Time” we reveal the “Computer Think Time for Component” property. Now we can enter our “TT” variable into the property field;
We’ll do the same for the “Fill Form” Component. So, each iteration of our Scenario will log in a random user from the CSV file, and that user will perform data entry. The Think Time for each iteration will be dictated by each user’s “TT” value, as set in the CSV file. Let’s take a look at two consecutive Execution Reports to see the variation in performance;
1. User aong, Think Time value = 500
2. User csheen; Think Time value =3000
Well, these two users happen to represent the extreme cases from our file. User aong sails through the application at a lightning quick ½ second per step, whereas user csheen stumbles through at a lethargic 3 seconds per step.
Think Time variations can add the human element to your test cases!
Comments
0 comments
Please sign in to leave a comment.