Friday, August 03, 2007

Flash demos

These are flash based demos for specific materials covered in the class:


Starting a test

Running a test

Creating a DSN

Test: Delete Record

Test: Delete Record from DB

Labels:

Saturday, July 28, 2007

QTP Tests

I have included in this post, links to QTP tests we have written in class.

Add Record 2

Verify Launch

Labels:

Saturday, April 28, 2007

IMPORTANT DOCUMENTS

The site has been re-shuffled, and I hope, simplified. Several small articles have been combined to create a more logical flow.


PROJECTS
Flight Reservation Project: Creating a project in Mercury Test Director to test the Flight Reservation Application.
PDF DOC

Expense Calculator Tests: A series of design steps that can be automated to test the Expense Calculator application
PDF DOC


EXPENSE CALCULATOR
REQUIREMENTS: The requirements for the Expense Calculator application.
PDF DOC
SCREEN SPECIFICATION: The screen specification document for the Expense Calculator application. This is a part of the requirements.
PDF DOC
SCHEMA: The database design schema for the Expense Calculator application
PDF
APPLICATION: The Expense Calculator application which is tested in this class is available at the link below.
ZIP
OBJECT REPOSITORY: Object Repository for the Expense Calculator application
TSR
GUI MAP: GUI Map for the Expense Calculator application
GUI


CLASS MATERIAL
The class material is available from the following link.
ZIP


QTP OBJECT REPOSITORIES
Object Repository for the Flight Reservation application
TSR
Object Repository for the Expense Calculator application
TSR

TESTS
An account management test for the expense calculator application
ZIP

Verifies the date entered by the Today's Date Button is the current system date
ZIP

Labels: , ,

Thursday, January 11, 2007

Best Practices in QTP

1. Use comments liberally. It is helpful in every section to identify what is being done and how you intend to do it. This makes it much easier for people to understand what the test intends to do.

2. Fname, Lname, Country, Gender are not good names for datatable columns. See http://prosoftqa.blogspot.com/2006/04/logical-names-updated-410.html for an article about naming.

3. FN, LN etc are not good variable names. Absolutely avoid the use of such variable names as i, j, k. The reasons for this should be obvious.

4. It is always a good idea to define your variables at the top of your test and specify what type of data you intend to store into them.
E.g.

Dim strCountry 'Stores the name of the country

5. The Msgbox function should absolutely never be in a test. An automated test is designed to run with unattended execution. Using this function pauses the test and waits for user interaction. If you want to preserve log messages during your test, try the Reporter.ReportEvent method.


6. Never use the Inputbox function in a test. Your data should always be either
a. Hard-coded - Simple but not flexible
b. Parameterized - Best option since your datatable is editable through any spreadsheet tool.


7. Always indent your code. The interpreter does not care if you don't indent but humans do. Don't forget that during the lifetime of your code, someone else may be charged with updating it. Without proper indentation, it is difficult to figure out what the code below is doing:


If blnTest=True Then
strMessage="Passed"
If numCount=2"
strMessage = strMessage & " again."
End If
Else
strName="Failed"
End If


The following is easier to read:


If blnTest=True Then
strMessage="Passed"
If numCount=2"
strMessage = strMessage & " again."
End If
Else
strName="Failed"
End If

Labels: ,

Saturday, December 23, 2006

Object Recognition in QTP

The problem of object recognition is a tricky one. Imagine receiving computer help over the phone when the caller tells you what to do to your machine by describing the objects they want you to interact with. For instance, if they want you to open the control panel (on a Windows XP machine), the steps involved might sound like
1. Click the button on your task bar, that has the word 'Start'
2. Click on the Control Panel list item in the displayed menu

In this instance, you are provided with enough description to uniquely identify an object you need to interact with. If you have two buttons, with the word start on it in your taskbar, then an additional piece of description must be provided such as

1. Click the leftmost button on your task bar, that has the word 'Start'

in order to still uniquely identify the object. This is what QTP does, it simply records a description of each object you interact with in your application into a file. The way it records the description is by noting enough properties of an object in order to uniquely identify such an object. Additionally, in order to find this object much easier in the future, it provides a logical name for the object. The logical name is simply an alias. This way, instead of saying

1. Click the leftmost button on your task bar, that has the word 'Start'

I can use a logical name such as btnStart.

There are three tools used by QTP for this operation and these include Object Spy, Object Identification and Object Repository. We will discuss these objects at length in later chapters. For now, it is more important to understand the concept that in order to teach QTP how to interact with your application, QTP must record descriptions of the objects you interact with and map these description to a logical name.

Labels: