Automated Testing is a good concept. Most of the testers go for manual testing in spite of huge cost benefits by automated testing. The following reason is cited for not using automated testing,

Quote:
Changes in Web Interface/User Interface will make the test automation not feasible.


There are ways, we can overcome these issues in test automation. In this post, I am going to discuss one of the methods to do the test automation.

Quote:
Create scripts using defined functions instead of recording every script.


I've described what is going to be discussed in the above line. Let me elaborate this for easy understanding.

The script for login to the OpManager web interface recorded by QEngine will look like this,

Code:

launchApplication("about:blank")
changeURL("http://opman-winxp/",5)
setWindow( "AdventNet OpManager",1)
setText("userName","admin",1)
setText("password","admin",1)
clickImage("http://opman-winxp/webclient/common/images/Login_submitBut.gif",6)


Instead of recording the above steps every time or copying this to the every script, lets define the function for this,

Code:

def login(usename,password):
launchApplication("about:blank")
changeURL("http://opman-winxp/",5)
setWindow( "AdventNet OpManager",1)
setText("userName",usename,1)
setText("password",password,1)
clickImage("http://opman-winxp/webclient/common/images/Login_submitBut.gif",6)


Call the login function wherever is needed,
Code:

login(admin,admin)


It is pretty easy to use and simple too. Assume that the name of the image is changed. Just change the name of the image in the login function.
i.e.,
Code:

def login(usename,password):
launchApplication("about:blank")
changeURL("http://opman-winxp/",5)
setWindow( "AdventNet OpManager",1)
setText("userName",usename,1)
setText("password",password,1)
clickImage("http://opman-winxp/webclient/common/images/Login.gif",6)


There is no need to change in the scripts. So for so good. Now, you've got an idea of how to do this. Let's see the other two scenarios

1. User Interface changes here and there
2. A complete revamp of the User Interface.

Both the cases can be handled using the functions. For the second case, you may need to put an little extra effort to create the functions. One time recording is required to create these functions. Remember to use the SuiteLevelMap in QEngine to use these functions.

Send your feedback to rajasankar at adventnet dot com.

No one has commented yet! Be the first one to comment!

Post Comment

38.107.179.226 (38.107.179.226)