SCRIPTING 01: DATE THEM BEFORE COMMITTING
On this post, I am going to start a series of posts that will talk about date and relationships. NO! I am just kidding. They are going to be about scripting techniques. On these posts I will state some of the best practices that will help you to be the best scripter. These best practices may apply to other automation areas. But the focus for these best practices is for performance testing automation.
These recommendations will give several advantages. Some of those advantages are:
- Faster scripting times.
- Ensure that the amount of re work done is minimum.
- Clean and efficient code for the scripts.
- Ensure that the code is flawless.
- Minimize errors happening on execution.
These practices have allowed me to brag zero execution errors with my clients. Well, I get zero errors from the scripts and the test. Other errors come from the tested solution. Most of the clients don’t believe me. But I have actually won bets on this!
FIRST STEPS FIRST
I am going to give you these recommendations in order (more or less). From the first ones, to the last ones. Some of the ones in the middle can change in order. But the ones on the ends, firsts and last ones, must be respected!
The first recommendation that I will give you must be done right after you receive the test case(s) that you will script. Here you must make sure that you receive a test case optimized for Performance. I already talked a lot about those.
This first step must be done before you open any scripting tool. You don’t need it for now. This is because the first thing that you are going to do is to just follow the steps. To get familiar with that process before you script anything.
It is a lot like the first time(s) you go out with a girl. You must come to know her a little before you start to do any serious business with her. Way before you bring her to your parents’s house.
Just a note before I move on. I am an hombre (not a bad one, at least not too much). And I haven’t dated any other hombres (nothing against it, just not my thing). So the examples about dating the script is going to be a girl. I am trying to be socially correct. But I write from my own personal experience. As usual all of the stories are true stories.
GO OUT ON A FIRST DATE
Here you will try to hold your test case’s hand. Walk with it for the first time. See if you can go at its pace at first and make sure that it is valid.
This way you will confirm if the test case is up to date. Because they are always up to date, right? (Ha!)
Wrong! Often, while you are following them, they will specify some steps and you will be like WTF. “What is the button that I must press? I don’t see any button”. There you can report the test case as outdated. Ask the test lead or someone in charge of it to update it . Most probably, you don’t know how to use the system. And even if you did know, the test case should be clear and up to date. I mentioned this before.
You will have saved time detecting this first hand. You will not have even opened the scripting tool. Not even scripted a thing!
It is important to do this first. It is like the first date I mentioned. You wouldn’t bring home a blind date. What if she is mean? Or ugly? Or looks like you picked her at the corner of a sketchy neighborhood? Your mom may unleash the chancla power on you two. She will unleash it on you for sure.
Because of this, go out on your own with the girl first. You must check her to make sure she is compatible with you. Maybe she has bad breath. It could be that she doesn’t understand your jokes. She may not even like them! Or in a worst case scenario, she may not even like tacos! Dios Mio!
GET FAMILIAR WITH EACH OTHER
There is a second advantage to this step in the best practice. You will get at ease with the business process. Come on, you can do it. Touch it for a bit. Before you jump into recording.
Execute it manually just because. Get familiar with its flow. See where it receives data. Find the different values that you must enter. Identify the points that will be measuring response times. Understand why they are important. Report the transactions that you consider that should not be recorded. Claim to track the timers that you see that are missing and seem to be important. Tell on the ones that should not be there because they do not have post back times.
By doing this you will decrease the number of failed attempts to record. I am sure you know what I am talking about. When I was a junior scripter I didn’t follow this recommendation. I would just open the unknown test case and the scripting tool at the same time. Then I would try to record the script right away. Just to have to start all over again several times because I missed a click. I would mess up because I was not familiar with the steps at all. There was so much time lost starting all over again several times.
It is the same with the date. First you confirm that the señorita is good. Now you have to find her perks and details. Maybe she doesn’t like olives and you like them so that will work. Maybe she likes to use heels on Sundays. This makes her taller than you. Then you will use your platform shoes on Sundays. You will also find out what types of tacos she likes. It is not a matter of if she likes tacos. She must like them, otherwise we wouldn’t have made it to this point in the dating game.
BE A REAL RELATIONSHIP
There is another benefit to this best practice. You will act more natural the more you execute it. You will be more like a pro real user. Regardless of having no idea of what the steps are doing, like we mentioned before
This natural flow brings scripting advantages. Once you are scripting you will sprint through the process. The steps are going to be easier. Instead of you having to stop for hours trying to find a parameter, you will wait a realistic amount of time. This way you will record wait times that are closer to the ones that a real user would do, instead of the waiting times of someone ignorant.
If you dash like a real user, you will record real wait times. This is good if your project depends on them for accurate wait times. Now you will get pretty good ones.
In the same way, when you go often out with the señorita, you will find out her likes. You two will be normal with her. You will know right away what places she likes. Decide instantly on a restaurant to go to dinner. Instead of you two wasting time in the classic conversation that everybody knows:
Me: Hey Maria where do you want to go to eat?
Novia: Anywhere you want mi amor.
Me: Lets go to Taco Pelota!
Novia: Aye no, I don’t like it there.
Me: Well then, where would you like?
Novia: Anywhere you want mi amor.
Very well amigos. Now you know the advantages of dating your test case first. To know it before you commit to anything serious. Like opening the scripting tool and start recording. Don’t do it, if you don’t know if it is going to work between the you two.
Get to know the test case like any señorita that you just met. Go out first. You must check if she is good and/or pretty. Then get to know her with all of her peculiarities. Get some practice so you get used to each other. Only then you can take her home to introduce her to your madre. I mean, so that you can record the steps in the scripting tool!
We will continue this series on the next post. For now, vamonos!