Today we have a guest blog from Rajasankar, the QA Manager for the Network and Server Monitoring Software from AdventNet. I am reproducing it below. It elaborates the experience of a user who has automated over 2000 Test Cases.
| Quote: | ||||||
|
Building Maintainable Test Scripts for Functional Testing When I started Automation for OpManager, I am new to automation so, I've started reading about the automation concepts. When I tell someone that I am doing UI automation, the first question is "What you will do when the UI changes". I don't have an answer for that question. The material available is also not helpful. In one side, puritans advocating using a script based language for creating test cases, ie. doing the coding from the scratch. On the other side, tool vendors(including us) claiming that record and playback tools can automate with less effort. I thought, let's try to do automate and learn the things on the way. After the three months efforts, I've posted my feedback here. Now, I need to make the automation tests in a maintainable way. I continue read about automation. In a Google video, Cem Kaner, a software testing expert, giving a lecture about GUI regression testing. He asked one question that stirred my thought. In programming, if we need do same action repeatedly, we will write a function and call it wherever needed. If we need to change something, we will change in that function. Why we are not using it in automation? Then, he went about having a interpreter and using the excel sheets for defining actions. In QEngine, for DB check, I've defined custom functions, called those in the QEngine UI . Say, if Polled data table needs to be checked for entry of a monitor, define the queries as a function and call it wherever it is needed. I thought, why can't those functions be used for GUI actions. I've tried that in the Discovery module. Let me give an example, how it works. Usually the script for adding a credential looks like this,
If you use the functions, it will look like this,
You can also use CSV files as an input,
It works great. There is one more advantage of this approach. If you give the values from CSV files for input, you can do lot of testing. The monotonous tasks of doing a same thing repeatedly by manually will be removed . How about adding 1000 different credentials that includes all the special characters in OpManager? Now, comes the basic question, "What to do if the UI changes?". Well, if you use functions, you don't need to worry about that. Even if the UI is completely revamped, in very short time you can recreate the entire cases because you need to record the actions for one time in order to create the map file in QEngine.(I think this will be the same with most if not all of the tools). I am not claiming that this will resolve all the issues related with UI automation. However, one major part of the problem can be avoided in this way. Thanks to KPS for sharing his scripts. The same approach is used by him to test ZohoDB .
Rajasankar QA Manager OpManager, AdventNet |
Post Comment