Lessons from GUI Testing

11 01 2012

I recently started working on the GUI testing space again. This is an interesting space, with loads of commercial and open source tools being available. Although all the tools might have their own unique features which they bring to the fore; I realized that there are some basic fundamental steps, which need to be brought up to get things moving in the right direction. I have tried to put these steps as succinctly as possible in this post.

The initial step is to realize that although all GUI web based applications may vastly differ from each other, they have one common control which needs to be looked into – the ‘objects’ which create the page. Each web page (or for that matter GUI based application) would have these. Each tool has its own unique way of looking at and identifying these objects on the web page. The basic assumption being that the Dev’s have done a spot of good coding and provided meaningful and unique names to all the visible objects on a Web based application 🙂

Map these objects to the web applications page and half the work of automating the web based app is complete. The crucial part is that the automation engineer should realize that he has to use the names provided by him during this initial setup and mapping stage. We cannot rely on names provided by the Dev Team, as these may be generic and/or not properly worded; to provide the correct identification of the object on the web page.

So from my viewpoint, you need to start any GUI Automation by first mapping all the objects and providing proper names to these. With this work done, now arrange them into a proper flow, so that you create the required test scenario as has been provided by either the Business or the Customer. Having the initial mapping of the objects, is the biggest help that can be obtained. Will further post on the different tools and how to build this great library of objects with each tool.

My coding exercise!

3 03 2009

So I have embarked on a journey to find my coding skills and try to find where and how I lost them. The journey does not seem to be too long, as I can remember the last time I had coded something was around the time I left my last Organization. Coming into the new atmosphere, I think I somewhere along the line lost the charm to code and that took its toll on my coding skill and brought me to this space.

The exercise began with me trying to understand what was going on under the hood of something which we call the collection of logs from users and their analysis and loading into the databases. The data is then given to the strategic data services, who do the data mining and get to work on analysis of how to make things better for our customers so that their ROI goes up and becomes better.

My main duty was to take care of this pipeline (or various pipelines for the different ways in which we collect the logs) and make sure it keeps flowing and garning more data about the various activities going on, in this somehow I lost the interest to code and innovate on things… [i think the right word was inovation]

Batch Scripting

2 04 2006

Did you know what all you could do with DOS Batch files??!! Did you think all you could do was start another batch file, call a few commands to run in sequence!! Well! With DOS and batch commands you can do a lot more, right – you can even read and write to a file, and also it has a somewhat restricted sense of sub-routines in it. So, finally I was introduced to the world of DOS Batch Programming. I learned that Batch processing is a lot more than I would have ever thought it to be. Can you image my surprise when I learned that you can do file manipulations using DOS??? And to add to that, even binary files can be manipulated using the simplest batch commands of DOS?!! Ever heard of the command FOR in DOS! Well! If you add the /F switch with the same, you get a wonderful file handling capabilities for DOS. Read up more on the posts by Mic, an avid and resourceful DOS Batch person, who I think would be able to answer all DOS Batch related questions you post to Batch World group on Yahoo!: Batch World

Well! I have had a fine time trying to work out what all I could to with DOS to help in my Automation work; as currently what I have created is a PXE server which can boot a machine into DOS, from here I have to carry on and cal the Acronis Command Line tool to accomplish my work, but all has to be done using DOS commands only as the environment into which the system is booted into is PURE MS-DOS with a few network enhancements. I now had to work out a way by which I can get my system to work by calling the Acronis Command Line tool and install an image for the system which will be Windows platform and configuration as selected by the user, as this is a dynamic thing, I have had to do a lot of work to create dynamic fiels which would do my work and heer I learned about DOS and Batch File commands. Currently, I have managed to get a working script which will help me in installing images stored by me on a server and a user configuration in which user selects his choice of OS file system to install and execute his test framework on:
FOR /F %%y IN (c:\OSCount) DO CALL :READ %%y
SET /A countWr=%my_return% 1
ECHO %my_return%
> c:\OSCount echo %countWr%
ECHO %countWr%

SET /A v_sum=%1
SET /A count=1
FOR /F %%x IN (c:\MyFileA.txt) DO CALL :ABC %%x
ENDLOCAL & SET /A my_return=%v_sum%

IF %count%==%v_sum% ECHO This File %1
ENDLOCAL & SET /A count =1


The above script is reading a file (MyFileA.txt) and getting the line number to be read from another (OSCount) file, which is then incremented for the next execution (the file is written to, we can also append to the file by using double greater than symbol – >>). Also, the variables are being passed as parameters from one sub-routine to another and then returned. So, finally, when we reach the first sub-routine again, the OSCount file is contains an incremented new value and when we run it again, we can get the next line in the file MyFileA.txt.

Although with the above script you can find out many things you can do with DOS batch commands – read a particular line in a file, write or append a line to a file, and even sub-routines in DOS!!! I never knew these were there. The SETLOCAL – ENDLOCAL actually defines a sub-routine in DOS. For debugging DOS batch files, you just do an @ECHO ON at the beginning of the file and execute the script through the DOS command line and viola, you can actually pin-point where you are going wrong – which line or variable is returning what value and where and when.

So, folks all I can say is that get your Windows machines pumped up and start using the powerful features of DOS which you might have never know existed… (PS: I have not added the code sent by Mic here as the link should take you to that, which is more nicely structured and concise!! My code is just a bunch of statements more meant to give an idea of what all DOS is capable of doing…)

Work @ iGATE

18 06 2004

Another day goes by without too much activity on my part. I have been put into the group for creating the properties file for the new devices sent by the client. The software is being developed for Nokia Client and is called the NOBS – Nokia One Browser Server. This will be a box which will deliver the content to any phone from the content providers place. So anyone who connects via GPS to the content provider [Hutch, Airtel] would be able to view the web pages on his phone. WAP would not be a requirement for these pages, they would be ordinary HTML pages, which would be converted to the respective size and shape for the phone which calls for the request.
The properties page is basically a set of files which determine how the phone looks like and what content and in what manner [size, etc.] to send to this particular phone.

This seems like a not-too-technical and not-too-mind-intensive work and I for the present am not liking it…

Had a treat from Mr. Nitin Mathur as he keeps on saying that I am earning more than him, even when I have not started with the Macromedia job as yet. I really enjoy it when he says that, but I think he is just ribbing me into treating him, so it feels good when i make him pick the tab for the same… 🙂