Tuesday, August 19, 2008

Expense Calculator Tests

The Expense Calculator Tests from the class are available at
http://genixcorp.com/testing/expcalc/ExpTests.zip

Sunday, August 17, 2008

Flight Reservation Tests

Below are the classroom assignments for the Flight Reservation application.

1. The tests can be found at
[DOC] http://www.genixcorp.com/testing/tests/tests.doc
[PDF] http://www.genixcorp.com/testing/tests/tests.pdf

You can create your object repository or use the one at

The Object Repository can be downloaded from
http://www.genixcorp.com/testing/tests/FlightReservation.tsr


We solved 3 of the tests in class and these can be found at:

[Verify Launch] http://www.genixcorp.com/testing/tests/Verify%20Launch.zip
[Verify Legal] http://www.genixcorp.com/testing/tests/Verify%20Legal.zip
[Book Flight] http://www.genixcorp.com/testing/tests/Book%20Flight.zip


Please remember that these are zip files and ou will need to unzip them in order to use the test properly. If your object repository is not in c:\My Tests folder, you will need to point the test to the location of your object repository so that it can run properly.

Wednesday, July 23, 2008

Assignment 1

Due: 7/25/08

a. Declare variables for the following items
b. Assign appropriate values to the declared variables

[Note: You can use SCITE a VBScript editor as your IDE> The application is free and can be downloaded here: http://users.hfx.eastlink.ca/~gisdev/scite-1.75-setup-1.exe]

1. The title of the last book you read
2. Your name
3. Tomorrow's date
4. Whether it will be sunny tomorrow
5. The number of TV channels you receive
6. The number of people on the planet
7. The cost of a gallon of gas

Labels:

Monday, May 12, 2008

QTP Tests

The zip file below contains some tests we worked on in class. The following items are included:

Test: Check Dimensions
Test: Delete Record
Object Repository
Function Library
Recovery Scenario File

[ZIP]

Labels:

Sunday, April 20, 2008

READINGS

[required] Overview of Testing - An indepth overview of the process of software testing.
PDF

[optional] Expense Calculator Requirements - The requirements for the Expense Calculator application.
PDF DOC


Thursday, March 13, 2008

Assignment 4

DUE: 3/23
This is a comprehensive exercise covering everything we have done in the VBSCript portion of the class.


DECLARATION
-----------
Declare a variable or constants and assign appropriate values for the following:

a. The title of the window
b. Your name
c. Tomorrow's date
d. Whether it will snow tomorrow
e. The number of TV channels you recieve


NUMERIC
-------
1. Accept a number, print it in reverse

E.g. If you accept 274, print
The reverse of 274 is 472


2. Accept two numbers and print:
a. All the even numbers between them
b. All the odd numbers between them
c. All the prime numbers between them

3. Accept two numbers and sum all the numbers between them:

E.g. If you accept 2 and 5 print:
Input values: 2 and 5
Sum (excluding boundaries): 7
Sum (including boundaries): 14


DATE
----
1. Accept a date in mm/dd/yyyy format and
a. Display a message whether the date is valid or not
b. Display the date in parts as:
Month: January
Day: 14
Year: 2008

2. Accept a date and print whether the date is in the past, present or future.


3. Accept a date and print:
a. Day Before: mm/dd/yy
b. Day After: mm/dd/yy


4. Print yesterday's date


STRINGS
------
1. Accept a word as input and display all the vowels in it.

E.g. if the word is PROFESSIONAL, display:
A : 1
E : 1
I : 1
O : 2
U : 0

2. Accept FirstName, MiddleName and lastName from a user and write code to display this as:
a. LastName, FirstName MiddleInitial.
b. LastName, FirstName
c. FirstInitial. LastName


FUNCTIONS
---------

1. Write a function that takes a String formatted as currency and returns the value as a number.
E.g.
If you pass the value $1,234,567.70 it returns 1234567.70
If you pass the value 34,567.70 it returns 34567.70


2. Write a function named IsPrime that accepts a number and returns True if the number is prime and False if the number is not.

Thursday, February 28, 2008

Table of Contents

The contents within this blog will be described within this tablef contents to make it easier to access material.

VBScript Examples: Loops

The following example loops though an input vlue and prints a triangle based on the number entered

rows = InputBox("enter rows")
x = 1
map = ""
While x <= Cint(rows)
y = 1
While y <= x
map = map & "*"
y = y + 1
Wend
map = map & vbcrlf
x = x + 1
Wend
Msgbox map

Monday, December 31, 2007

Flight Reservation Tests

Please find attached some of the flight reservation tests. There are currently six tests and I will add the rest over the next few days. Some of the details needed ae:

Labels:

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:

Wednesday, June 20, 2007

Demos

Please click below for a rather excellent WinRunner flash based demo.

WINRUNNER DEMO

Labels:

Sunday, May 13, 2007

Presentations

Introduction to Testing - A general introduction to the concepts of Quality Assurance.
PPT PDF

Test Director - A Test Director, a test management tool that is available as a plugin for Mercury's Quality Center product.
PPT PDF

QTP - An introduction to Mercury QuickTest Professional test automation tool.
PPT PDF

LoadRunner - An introduction to LoadRunner Performance testing tool.
PPT PDF

VBScript - Description of the VBScript language which is the scripting language used by QTP.
PPT | PDF

Friday, May 11, 2007

Examples of Requirements Specification

Here are some examples of requirements documents. You will find the varied styles in use for the creation of these documents.

Hisorical Extracts

Prot LIMS

DNA

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: , ,

Sunday, April 22, 2007

Testing Resources

I had always planned to include a list of links relevant to QA here. I've finally found the time to include them. I suggest creating these as bookmarks as you will find them very useful.

Questions
http://genixpress.com/answers
http://geekinterview.com
http://allinterview.com


Reference
http://wikipedia.org
http://google.com

Blogs
http://prosoftqa.blogspot.com
http://cerosh.blogster.com

Articles
http://genixpress.com/gp/preview/wiss-preview.pdf
http://www.odo.lv/index.php?list=winrunner/home_en
http://wilsonmar.com


Tutorials
http://www.w3schools.com


Software Downloads & Demos
http://mercury.com
http://adobe.com - You will need Acrobat Reader to view some of the documents on this site.

Screencasts & Webinars
http://www.mercury.com/us/company/events/webinars/archive.html#quality-center

Tuesday, March 06, 2007

Flight Reservation Application

WinRunner GUI Map

QTP Object Repository

Monday, February 12, 2007

Exercises: Scripting

STRING MANIPULATION
===================
1. Write code that accepts a string as input and does the following
* Display the size of the string
* Display the string in reverse

2. Print the following string on 2 lines using one Msgbox function: "Hello" "World"
This should be printed as:

Hello
World

but done using 1 Msgbox function

3. Write code that takes the value 2000111.4 and displays it as $2,000,111.40

4. Write code that takes the value $1,234,567.70 and displays it as $1234567.70

5. Write code that accepts a number and displays whether the number is a prime number or not

6. Create a script that prompts a user for a word and then the script does the following:

a. Displays the string entered
b. Print out the length of the string
c. Print out the string in reverse



DATE MANIPULATION
=================
1. Write code that accepts a date in MM/DD/YY format and then prints the date in Mon, DD, YYYY format.
e.g. 03/01/04 and display Mar, 01 2004

2. Write code that displays the time in HH:MM AM format e.g. 02:35 PM

3. Create a script that will print out the day value e.g. Sunday/Monday

3. Write code that displays the time in long format e.g. Two thirty-five PM.



FILE I/O
========
1. Create a script that will accept an input and write it into a file named mydata.txt

2. Create a script that will accept a file name and print "Exists" if the file exists and "Doesn't Exist" if it doesn't.






MORE EXERCISES
==============
1. Create a simple loop that will print "Hello" 5 times




2. Write code that prints out all the even numbers between 2 and 8 and displays them at a single time using the following format:

2 - 4 - 6 - 8!

Labels:

Friday, February 02, 2007

Exercises: VBScript

EXERCISES
=========

1. Write the item below as a comment using the 2 forms of comments that are available in VBScript

This is a comment



2. Fix the following line of code of code using any of the 2 comment keywords. When you are done, the code should run properly and print 'Hello World' 2 time

Declaring variables
Dim strMessage
Dim numLoop
strMessage = "Hello World" Assigning a value to my variable

For numLoop = 0 To 1 Step 1
Printing a message
Msgbox strMessage This will display the message
Next

The end of the code


3. We used the InputBox function to ask the user for input. Complete the following script so that when I run it, it will ask me for a number and then it will double the number and display it to me.

Option Explicit
Dim numValue
numValue = InputBox("Please enter a number")



4. Create a script that accepts any numerical input and then displays a message if the number is a prime number or not.
[Note: A prime number is a number that is a non-negative and that is only divisible by one and itself]

Labels:

Thursday, February 01, 2007

Exercises: TSL

1. Modify the following code using comment and inserting missing symbols so that it would run properly

------ code start
Declaring a variable
static numCount This variable will hold the number of times I execut the test
// Assigning a value to this variable
numCount = 3;
/* Print the variable */
print("Value of numCount:" + numCount);

------ code ends


2) Indicate which of the following are incorrect And what (if anything is wrong)

int intNumberofDays

static numBankBalance
numBankBalance = "Hello";

public numLoopCounter
numLoopCounter = 14

Static strData;

static if = 0;

public +2;
+2 = "Hello";

Static list+names;
list+names = "John, James, Victor";

static a;
static b = "Hello";
a = b + "2";


3. Complete the following if statement to display "More than 10" if the input value is more than 10.

static numInput;
numInput = 7;

# Please create the appropriate if statement


4. Create an if statement to display "5 or more" if the input value is 5 or greater and "Less than 5" if it is not

static numInput;
numInput = 7;

# Please create the appropriate if statement


5) Create an if statement structure to display
* "Even" if a number is even
* "Odd" if the number is odd
* "Zero" if the number is 0
* "Negative" if the number is less than zero.

Please note that all these are mutually exclusive i.e. a number can either be even, odd, zero or negative.


6. Fix the errors in the following TSL code to make it function properly

Declare a variable
static numData
numData = 7; This is an assignment statement
//Print the value
print("numData");


7. Write TSL code that prints out all the even number between 1 and 10 in the following form

1, 3, 5, 7, 9
Note: PLease use only 1 pause statement.

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:

Tuesday, December 05, 2006

Flight Reservation Application Files

Click on the links below for material useful for testing the Flight Reservation application.

Object repository

Database Schema


Additional Useful details:

Username: any name

Password: mercury

Database Location: C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight32.mdb



TEST 1: Insert New Order

Wednesday, August 09, 2006

Active X controls: A closer look

Active X controls are a programming technology that allow developers create objects within a programming language that can now be used in a different programming language. The ActiveX object created is often referred to as a component, because it often has to included inside another application to be used.

I'll use an example to illustrate this.
Let's say I'm writing an application in Visual Basic, and the application needs to accept input from users. One of the fields that a user has to enter is a field that they can store their social security number in. Ideally, such a field should only accept input in the following form

###-##-####
where # stands for a number

The problem here is I need to write code to prevent someone from being able to enter:

hel-12-3456

as their social security number. Lets say I know how to write such code in C++ but not in Visual Basic, what I will need to do is go into C++ and create an object that will only accept valid social security numbers. Next, I will return to Visual Basic and embed this object in my application.

The process of doing this is known as OLE (object linking and embedding) and the resulting object that I created is called an ActiveX control or ActiveX component.

To test an ActiveX component, you must warn QTP (and WinRunner) that the application you are testing contains objects that may have been created in a different language. In the case of this example, in addition to inclduing the Visual Basic add-in, we must also include the ActiveX add-in so that the testing tool will know how to interact with our ActiveX object (i.e. the object used to input social security numbers).


For further reading, see:

http://en.wikipedia.org/wiki/ActiveX
http://en.wikipedia.org/wiki/ActiveX_control

Friday, June 30, 2006

More about Object Repository Files [ADVANCED]

To be able to mimic what was done by a user, QTP learns the object the user interacts with by recording enough properties of the object to be able to uniquely identify the object. This, as you know, in QTP is the object repository. The object repository is simply a file that has to be stored on the system. QTP uses two file types for doing this. A TSR file and and MTR file.

TSR file
This is the file type QTP uses to store an object repository when you choose 'Shared' mode in Test->Settings->Resources. The TSR file must then be referenced by any test that wants to use the objects within that repository.
What we do is learn all the objects within an application and store it inside a single file, therefore anytime you want to test that object, you simply have to load the correct TSR file.

How to create a TSR file
There are two forms for doing this.
1. Create a new test, open the Object Repository by clicking Tools->Object Repository. From the tools use 'Add New Object' to add the objects you want. Then click 'Export' and choose a filename.tsr to save the object repository as.
2. Create a new test, open the Resources tab at Test->Settings->Resources. Type in the name of the tsr file you want to create. It will prompt you that you are creating a new file, say yes. Open the Object Repository by clicking Tools->Object Repository. From the tools use 'Add New Object' to add the objects you want. Then click 'Save'.
Note: In 1, you export, in 2, you save

MTR file
A second, but much lesser used for is the 'Per Action' object repository. In this form, you do not worry at all about your object repository. Sounds too good to be true, and it is. The problem with this form is that if anything changes in the application, you have to go back and re-record ALL the actions that use the changed object. This form is almost only used when testing a mature application, i.e. one in which you know (with great certainty) that the GUI objects will not change.

Tuesday, June 20, 2006

Test Planning (draft)

The following document identifies some useful steps an process that must be implemented during the test planning phase.

Identify System environment
- Networks: What network type are you using, WAN, LAN, VPN? What are the limitations?
- Platforms: What operating systems does the AUT support. Can it only work on certain versions of an OS e.g Windows 2000 but not Windows 98 etc
- Languages: What human languages does the application support. Just English? Or more?

Define your Testing Environment

- Database server: What databases are in use in the AUT?
- Database structure: Identify your database schema that will be used to retrieve data from the database.
- Database access: What are the available usernames for each database instance? What is your database downtime schedule to avoid scheduling tests at those times?

Management Priorities
- What are you testing for? Performance? Functionality? Backward compatibility?
- What is the proposed release date of the application?

Testing resources
- PCs available
- Time
- Skills testers have
- Determine what and how you want to test

Identify the risks
- Failures that cause the most damage

Prioritize the testing tasks
- Which application modules will be tested first

Define test subjects
- Divide your application into modules or functions
- Build a test plan tree

Define tests
- Step- Description- Expected Results

Design test steps
- Break down each step; points you want to check

Testing Concepts

Logical Name Mapping
This is the conception of describing the objects in the application into a relevant source file and assigning this object a logical name. The logical name is an alias you will use in your script to refer to this object during test execution. It is best when logical names and short, simple and descriptive of the objects they represent. The process with which logical names are captured vary by the automated tool in use.


Data Parameterization
parameterization is used in testing to make test scripts easily configurable. When tests are recorded, the values entered into the test are literal values. Often times, to provide some variance of execution for the test it is necessary to modify the values used in the test.

Checkpoints
Checkpoints are used to ensure that when execution gets to a specific point during the execution of an application. The value found in the application, (or related resource eg database, XML etc) is the value expected at that point. As an example, if you log into your Yahoo account, you will expect to find mail address to you.

Output values
These provide a way for a testing tool to retrieve values from within an application being executed. Output values return specific information from the AUT or related resource such as a database to the application.

Synchronization
This is used whenever events take an indefinite period of time to complete. Synchronization is simply a mechanism used to tell the testing tool to wait for a signal before continuing its operation. Alternately you can specify a maximum amount of time you are willing to wait for the previous operation to complete before you mark the test as failed.


Scripting
All automated testing tools support the use of a script language. In fact,when you record the steps you perform, they simply translate this into the script language that is supported by the tool. Luckily, it is easy to pick up script languages and we can use the logic within these powerful tools to increase the power of our testing tool.

Thursday, June 15, 2006

QTP Steps

This document is created to provide a simple guide on steps for performing certain operations in QTP, this does not provide a discussion of 'why', it simply shows 'how'


CREATING AN OBJECT REPOSITORY


[Method 1]
1. Open a new test
2. Open the object repository by clicking 'Tools->Object Repository'
3. Click the 'Add New Object' button
4. Click the object in your application that you want to introduce into the object repository
[Repeat 4 for all the objects you want to store. Note that by clicking on the header of a container, QTP can learn all the objects in the window]
5. Click the 'Export' button
6. Type in the name of a file in the dialog window that appears
[This will save a file on your harddrive with a TSR extension. This is your shared object repository]


[Method 2]
1. Open a new test
2. Open the Resources tab by clicking 'Test->Settings->Resources'
3. Specify 'shared' as the object repository type.
4. Type in the name you want to give your object repository in the available field
[You must specify a filename that does not exist, and you must include the .tsr extension]
5. Close this window by clicking OK
6. Open the object repository by clicking 'Tools->Object Repository'
7. Click the 'Add New Object' button
8. Click the object in your application that you want to introduce into the object repository
[Repeat 8 for all the objects you want to store. Note that by clicking on the header of a container, QTP can learn all the objects in the window]
9. Click the 'Save' button



USING AN OBJECT REPOSITORY FILE

Before you begin, you must know the following
a. The location, and name of your object repository file.

1. Open a new test
2. Open the Resources tab by clicking 'Test->Settings->Resources'
3. Specify 'shared' as the object repository type.
4. Click the ellipsis to bring up the 'File Open' dialog. Search for your object repository file. Choose it, and click okay.
[IMPORTANT: Choose the file instead of typing in the name, this will ensure that you select a file name that already exists]
5. Close this window by clicking OK
6. Start recording, editing...




CREATING AN ODBC DATASOURCE

Before you begin, you must know the following
a. The type of datasource you want File, System or User
b. The type of database that you want to connect to
c. The connection details for connecting to the database

[Microsoft Access]
1. Bring up the system's Control Panel
2. Choose 'Administrative Tools->Data Sources (ODBC)'
3. Choose File, System or User DSN tab
4. Click the 'Add' button
5. Choose the appropriate driver for the database you have in mind
[For Access, this would be Microsoft Access Drive (*.mdb)]
6. Click Next
7. In the DataSource dialog, do the following
Type in the DatasourceName
Click Select and choose the file from the file system,
Optionally type in a description
Click Finish to dismiss this dialog
[You will now see the DSN in the list of DSNs on the machine]
8. Clicking Ok to close the ODBC tool.



Specify Object Repository
-----------
1. Open a new test [File->New->Test]
2. Open the Test Settings dialog [Test->Settings->Resources]
3. Select shared
4. Click on the ellipsis
5. Choose your object repository [.tsr] from the file system


Checkpoints
-----------
1. Begin Recording [Test->Record]
2. Select Checkpoint [Insert->Checkpoint]
3. Select Object
4. Specify Checkpoint details
5. Stop Recording [Test->Stop]


Output Value
-----------
1. Begin Recording [Test->Record]
2. Select Output Value [Insert->Output Value]
3. Select Object
4. Specify Output Value details
5. Specify DatatTable column
6. Stop Recording [Test->Stop]


Data Parameterization
---------------------
1. Open the Data Driver Wizard [Tools->Data Driver]
2. Click on the item to parameterize
3. Click the Parametrize button
4. Choose step-by-step parameterization
5. Click Next
6. Click the Modify Parameters icon if you want to change the data table column. Type in the Name, click Ok.
7. Click Finish
8. Repeat steps 2 to 7 for each value you want to parameterize.


Synchronization Point
---------------------
1. Select Synchronization Point [Insert->Output Value]
2. Select Object
3. Specify Synchronization Point details
[Details include:
object: The object you are waiting for
Property: The specific property of this object that you are waiting for
Value: The value you expect the property to get
Timeout: The maximum amount of time your are willing wait for the event to occur
]

Wednesday, June 07, 2006

VBScript [draft]

What is VBScript?
Originally conceived as a web scripting language to provide some client-side validation and programmatic functionality to HTML pages (similar to JavaScript), VBScript has grown to become the scripting language of choice in many tools such as Mercury Interactive's QTP and Microsoft's Monad Shell.
By being a script language, VBScript is incredibly lightweight containing only a small number of keywords and operators, yet being able to support useful functionality.


HISTORY
=======
VBScript is related to the Visual Basic family of languages and bears a lot of syntactic similarities to the language. However, by being a script language, VBScript supports much less functionality than Visual Basic or Visual Basic.Net.


LANGUAGE CHARACTERISTICS
========================
Syntax - VBScript has English-like syntax reminiscent of such languages as COBOL, FORTRAN etc. This sets it apart from languages derived from C/C++ that have a heavy reliance on symbols.

Supports COM Objects - COM objects can be instanced and referenced from within VBScript giving the language considerable strength of functionality.
[Note: COM objects cannot be created in VBScript. ]

Interpreted - VBScript is an interpreted language requiring that the source code for the script be made available to the interpreter at runtime.


LANGUAGE CONTENT
=================
Comments - Used to explain code sections
Variables - Temporary storage for data
Constants - Permanent storage for data
Declaration - Reservation of space for a variable or constant
Naming Rules - The following 5 rules that must be followed to name items
1. Must begin with letter or underscore
2. Can't contain special characters except underscore
3. Can't be same as the keyword
4. Must be less than 255 characters long
5. Must be unique

Operators
* Arithmetic - Operators used for mathematical computation
* Relational - Use to compare 2 values against each other
* Logical - Used to simplify one or more boolean conditions
* Assignment - Used to store the value of an expression
* Concatenation - Uses to combine strings

Control Flow
* Branching - Allows sections of code to be skipped
+ If - Allows branching based on a set condition
+ Select - Allows branching based on the value of a variable
* Loops - Allows section of code to be repeated
+ While - Entry condition loop
+ Do...While - Exit condition loop
+ For - Iterated Loop
Functions
* Built-In - Code units provided with the VBScript language
* User Defined


OPERATORS
=========
Arithmetic
- Subtraction
+ Addition
/ Division
* Multiplication
^ Exponent
Mod Modulo

Relational
> Greater than
<>= Greater than or equal
<= Less than or equal = Equals <> Not equal

Logical
And
Or
Not

Assignment
= Assign

Concatenation
& Concatenate


KEYWORDS
========
Comments - ', Rem
Declaration - Dim, Const
If - If, Then, Else, ElseIf, End If
Select - Select, Case, Else, End Select
While - While, Wend
Do...While - Do, Loop, While
For - For, To, Step, Next, Exit
Function - Function, Sub, Byval, ByRef, Exit, End Function
Misc - Option Explicit, Option Compare Text, Option Compare Binary

USEFUL FUNCTIONS
================
Msgbox - Displays information
InputBox - Allows the application to accept input
Now - Returns the system date and time

Friday, June 02, 2006

What is ODBC?

Why ODBC?

The concept of ODBC is important for database connectivity because it provides a mechanism in which the developer can insulate themselves from the inherent difficulties in learning how to connect to every possible type of database that exists. Using ODBC, the developer simply connects to an ODBC datasource and lets the ODBC connection specify the database it wants to connect to.

Still unclear? Well lets take a second look at the process of an application connecting to the database. As shown in Figure 1, the developers writes code to connect to a specific database, if connection details about a database changes, the use of a configuration file will make it easy for the application to adapt to the change.


------- --------


APP ---> DB

------- --------

V
--------
config
file
-------


Figure 1: Direct connection to a database using settings from a configuration file

What happens when the actual type of database changes? Well, this is more complicated because the connection details of different databases expectedly are different. MS Access, for example is a file based database and as such would require you to specify the Access database file from your filesystem. Oracle, which is a connection based database will include such details as the host, port, username and password that will be used to connect to the database. Unless a large amount of code has been written to support all possible types of databases that an application can encounter, the application will no longer be able to connect to a database. In technical parlance, your application now has a vendor dependency. If you start out with Oracle, and Oracle were to raise their rates tomorrow, you'd have no choice but to pay it. But, another way exists and that is ODBC.
ODBC leaves the task of database configuration to the user, or an installer, and allows the developer to worry about connecting with the ODBC datasource. This way, during runtime, a user can change the connection details about their applications easily (Just as can be done in the previous example), but they can also change the type of database being connect to. Figure 2 shows the chart of a database that is being connect to through the use of an ODBC datasource.


------- -------- ----------------

SQL Server DB
APP ---> ODBC ---->---------------
Oracle DB
------- -------- ----------------

Figure 2: Indirect connection to a database using ODBC

As long as the data in the database internal structures (tables, fields, relationships etc) remains the same, the application will be able to continue using the database.

You will find that this technology works out perfectly for any automated testing tool. It is impossible for the developers of QTP to know the type of database you will use in you applications. In fact, it is possible for your application to be using a DBMS that was created after QTP was released. So how can QTP connect to it, well, using ODBC, QTP simply must know how to connect to a datasource defined on your computer. The tester will then complete the connection by connecting the datasource to the actual database that is used in you application.

This means that to use ODBC during your testing, you will need to create an ODBC data source. We will go through the process of creating thus, but before we begin we must discuss some items that you will need. When dealing with ODBC, you need to know at least three details, including:

Data Source Name - A unique data source name (DSN) that you will use to refer to your database on the machine. Think of the DSN as an alias for the database. While the DSN can really be anything, it is often best to specify a name that bears some relation to the real database, or the AUT.

CAUTION: Don't forget that you must create the same DSN on all machines you intend to run your test on. Without doing so, your test will not have a valid connection to the database and as such, will fail.

Data Source Type - The type of data source which you intend to create. There are two major types
* Machine Datsource
* File Datasource

Database Driver installed - You can only create an ODBC data source for a database that has the appropriate drivers installed on your system. You can easily check the list of drivers you have installed by clicking on the Drivers tab of the ODBC dialog.

You will find that the choice of drivers chosen determines the type of details that will be requested from you during the process of adding your datasource. Access, for instance being a file based database provides a button that allows you to select the database file from the filesystem while SQL Server, a connection based database, request such details as the host on which the database is running. Expectedly, you cannot conclude the creation of an ODBC data source if you do not have all the necessary details.

Tuesday, May 30, 2006

Test Director Notes

What are folders?
Folders are structures that are used to arrange your test case. Similar to what you do on your file system where you separate files into logical folder structures, folders in TestDirector are a logical equivalent.


CREATING A NEW FOLDER

Note: This must be done in the 'Plan Test' tab

1. Select the folder in which you want the new folder to be placed in, or select the root folder if you want to create a root level folder.
2. Click on Folder->New button at the bottom left corner of the page(5.0 or 6.0 version)
3. Type in the name of the folder in the dialog box that is loaded, then click on the OK button


DELETING A FOLDER

Note: This must be done in the 'Plan Test' tab

1. Select the folder you want to delete by clicking on it once.
2. Click on Folder->Delete button at the bottom left corner of the page
3. Confirm your action on the confirmation dialog presented

You can also delete folders by using the context menu that is activated by right-clicking on the folder name.



TEST CASES

The folders that we created exist simply to structure our test cases in a logical manner. Our test case is the document that actuals contains our test. The test case contains several pieces of information including

* Details
- Meta-information about the test that can be used to locate the test case, track the creation of the test case, provide a description etc
* Design Steps
- Step wise information that describes each step in a test and the expected result that should occur after each step.
* Test Script
- An automated test script in one of the 3 technologies supported by TestDirector. These technologies include
WinRunner
QTP
LoadRunner
* Attachments
- Attachments of files or URL that hold additional information useful to anyone that will use this testcase


CREATING A NEW TEST CASE

Note: This must be done in the 'Plan Test' tab

1. Select the folder in which you want the new test to be placed in.
2. Click on test->New button at the bottom left corner of the page
3. Choose the type of test you plan on creating from the dialog provided
4. Type in the name of the test in the appropriate space.


DELETING A TEST CASE

Note: This must be done in the 'Plan Test' tab

1. Select the test you want to delete by clicking on it once.
2. Click on Test->Delete button at the bottom left corner of the page
3. Confirm your action on the confirmation dialog presented


CAUTION

1. Test vs. TestCase vs. Test Script
Although the terms test, testcase and test script are used interchangeably, they are quite different.

* A test script is a part of a test case.
* In Test Director, the term 'Test' refresh to a TEST CASE
* In Winrunner, QTP & LoadRunner, the term 'Test' refers to a TEST SCRIPT

2. Validations
You can put any information you want in the fields of a test case. Be careful when you do this though as it may make it ver

WINRUNNER vs. QTP [Comparison]

Environments (common)

Environments that are supported by both QTP and WinRunner. This means that for these environments, Mercury has provided add-ins for both QTP & WinRunner.

Web

Desktop

Internet Explorer

Active X Controls

Netscape

Visual Basic

AOL

C/C++

AWT & JFC

Environments (different)

Environments that are supported by one of QTP or WinRunner.

WinRunner

QTP

PowerBuilder

.NET

Forte

Flash

Delphi

XML Web Services

Centura

Stingray

SmallTalk

User Model

How users interact with the application

WinRunner

QTP

Focus on test script

Synchronized Test Script and Active Screen

Requires familiarity with programming

Has an expert mode for programmers

Very Powerful

Easy, yet powerful

Test Creation Process

  1. Create GUI Map (WR) or Object Repository (QTP)
  2. Create Test

- Record Script

- Edit Script

Add one or more of the following

Verification

Synchronization

Checkpoints

Data Parameterization

  1. Debug Test
  2. Run Test
  3. View Result
  4. Track Defects

Script Recording Modes

WinRunner

QTP

Context Sensitive

- Uses a flat object hierarchy

Context Sensitive

- Uses a multi-level object hierarchy

Analog

- Captures keyboard input, mouse click, mouse path

Low-level

- Uses mouse co-ordinates

Scripts

The process of how scripts are created and stored.

WinRunner

QTP

Programmatic representation

Two modes. Icon based and programmatic representation

TSL, similar to C

VBScript, similar to VB

Procedural language

Object-oriented language

Uses objects from GUI Map

Uses objects from Object Repository

Object Storage and Operations

How QTP/Winrunner recognize the objects in an AUT and how they store the information about these objects.

WinRunner

QTP

Stored in a flat hierarchy

Multi level object hierarchy

Viewed using GUI Spy

Viewed using Object Spy

Stored in GUI Map

Stored in Object Repository

Creates temporary GUI Map file to hold new objects

Automatically saves object repository

Additional Items

Miscellaneous details

WinRunner

QTP

Transaction measurement

- Through TSL programming

Transaction measurement

- Through tree view and VBScript programming

Data Driven operations

- Create iterations programmatically

Data Driven operations

- Create iterations automatically and programmatically

Create code using Function generator

Create code using Method wizard generator

Exception Handling

- Uses the Exception Editor

Exception Handling

- Uses the Recovery Scenario Manager

Tuesday, May 23, 2006

Testing Types [Updated 5/30]

The most important thing to note about this section is that many of the testing types are not mutually exclusive. You can convievably be doing black-box testing at the same time as system testing.



Accessibility Testing
Testing to ensure that a software interface meets accessibility standards for differently abled individuals. For certains system, it is required by law that the system interface must meet certain federal accessibility requirements.

Acceptance Testing (aka = also known as)
(aka End User Testing)
The testing phase typically carried out by the paying client before they accept delivery of the software product.

Automated Testing:
Software testing using automated testing tools. This involves the use of tools to create an automated testing script which can then later be executed in a unattended state.

Ad-hoc testing:
An unstructured form of testing where functionality is tested for based on the the biases of the tester. It is often used to quickly test a specific functionality.

Black Box:
Testing a system by providing input and examining output without knowledge and/or regard of the internal code of the system.

Functional Testing:
This is testing to verify the functionality of an application as dictated in requirements.

Integration Testing:
Testing that occurs during the phase of the application development lifecycle where the different modular elements that make up a software system are being joined (integrated) together.

Load Test:
Testing an application to measure performance under the desired in which the application is expected to operate.

Manual Testing:
Software testing process where a tester verifies functionality of an application/system by physically interacting with the application.

Penetration Tesing:
A form of testing used to test the security of software systems. Penetration testing often involves the use of specialized tools to attack the system in order to find out where security vulnerabilities lie.

Performance Testing:
Testing an application to measure its performance during use. This is similar to load testing (for multi-user applications) and Benchmark Testing (for single user applications).

Regression Testing:
This involves running test scripts created for a previous version of the application against a later version of the application. Running regression tests against an application is done to identify what has changed between two versions of an application.

User Acceptance Test:
This is often carried out by the end use and is carried primarily to ensure that the user accepts the software that has been created as meeting with their approval before checks are signed.

Sanity test
This type of testing is also called sanity testing and is done in order to check if the application is ready for further major testing and is working properly without failing up to least expected level.

Security testing:
Testing the application from a security perspective to ensure that users can do everything, and only everything, that they have been given the access rights to do.

Smoke Testing:
aka Sanity Testing
Testing the application in order to ensure that the current build of the application/system is sufficiently stable for further, more comprehensive, testing to be performed.

Stress Testing:
This involves placing the system at maximum load for an extended period of time to monitor its performance under stress.

System Testing:
Testing that takes place when all the modular units that make up a software system have been fully integrated. Therefore, system testing happens way after integration testing

User Interface Testing
Testing the user interface application to help ensure that it is user friendly and (optionally) meets with standard software accessibility guidelines.

Unit testing:
This form is done by developers as it involves testing the individual component of a software system. This is loosely defined enough to be interpreted as anything from a function to a class

Usability testing:
Testing to see how easy it is to use a web site or web application. The usability of an application is often referred to as the 'user-friendliness' of the application

White Box Testing:
A testing technique in which an explicit knowledge of the internal workings of a system is used in testing the system.