Showing posts with label Automation Testing. Show all posts
Showing posts with label Automation Testing. Show all posts

Friday, November 25, 2011

Designing QTP Framework

What is framework?
Automation Framework is a set of guidelines and process you use to manage and optimize your automation testing. In simple words, Framework is a way to do the things in fashioned and organized manner! Framework is nothing but a concept.
It’s always possible to work without framework but you’ll be doing a lot of rework, everything will be here & there and in most of the time you will end-up with a mess, specially in the large projects.

Framework lets you predefine your automation plans, strategies and how you are going to proceed.
Types of Framework:
Framework can be of several types, but here are three main types of frameworks-
1. Keyword driven framework
2. Data driven framework
3. Hybrid framework
But this is only theoretical. Practically, there is no ‘Chinese Wall’ between the framework types.
In every organization you work, you’ll find that it’s quite different from the other and not only on organization level, you can feel the difference within different projects!
Yess, but most of the them could be mapped with Hybrid type and I like it!! :)
Hybrid framework has no boundaries and open to take benefit of all possible type of frameworks.

How to design a framework?
I have done a lot of automation projects and designed a lot a frameworks, but seriously guys, I never used any particular type of framework!
Practically, every application/project has its own expectation. You just need to start your work in organized way and believe me friends, at the end of the day; your framework will be ready automatically!! Sounds crazy??
You can’t design a complete framework and then start automation! You start automation and framework will start building simultaneously.

The first step of any test automation framework is to do a quick POC with few high priority test cases. By doing POC, you will identify the object identification issues, challenges, complexities, required test-data and limitation you have. Once you are ready with this information, you can proceed with next steps. On the basis of above information, you can decide what type of framework is most suitable to you.

But before starting, you must take some time to decide your strategies about..
1. Object Identification
2. Test-Data
3. Function Library
4. Error Handling
5. Controller script
6. Documents and Manuals
1. Object Identification:
How to identify objects i.e. using Object Repository or Descriptive programming or both. As per my understanding, dont’t try to stick on one particular. Depending on the application/object types, mixed approach is most fruitful most of the time.
2. Test-Data:
How to manage you data? DataTable or Excel or may be flat/csv files.
3. Function Library:
Be clear about what type of function libraries you are going to use and why.
4. Error Handling:
Whets your plan to handle errors? Be clear about it.
5. Controller script:
Design a controller script, which will control all your automation. It should be neat. This helps to understand what actually you are going to call.
6. Documents and Manuals:

Tuesday, November 22, 2011

QTP Script for Application Launch

QTP Script for Application Launch
Ways to launch your application

Four different ways to launch your application are mentioned below:

1) SystemUtil.Run

SystemUtil.Run ( FileName, Parameters, Path, Operation )

FileName – The name of the file you want to run.

Parameters – If the specified FileName is an executable file, use the Parameters argument to specify any parameters to be passed to the application.

Path – The default directory of the application or file.

Operation – The action to be performed. If this argument is blank (“”), the open operation is performed.

The following operations can be specified for the operation argument of the SystemUtil.Run method:

open – Opens the file specified by the FileName parameter. The file can be an executable file, a document file, or a folder. Non-executable files are open in the associated application.

edit – Launches an editor and opens the document for editing. If the FileName argument does not specify an editable document file, the statement fails.

explore – Explores the folder specified by the FileName argument.

find – Initiates a search starting from the specified folder path.

print – Prints the document file specified by the FileName argument. If the specified file is not a printable document file, the statement fails.

Example:SystemUtil.Run “D:\My Music\Breathe.mp3?,”",”D:\My Music\Details”,”open”

2) InvokeApplication

This command is now mainly used for the backward compatability ie to use with the lower versions(below QTP 6.0) of QTP.

InvokeApplication(“Full URL as Parameter”)

Example:InvokeApplication “C:\Program Files\Internet Explorer\IEXPLORE.EXE http://www.yahoo.com”

3) VBscript to invoke application

1. Create a “WScript.shell” object.

2. Use the “run” object to launch the application. If the path to your executable contains spaces, use Chr(34) to ensure the path is contained within double quotes.

3. When done, set the shell object to nothing to release it.

Example:

Dim oShellSet oShell = CreateObject (“Wscript.shell”)’

Example 1 – run a batch file:oShell.run “F:\jdk1.3.1\demo\jfc\SwingSet2.bat”‘

Example 2 – run a Java jar file:oShell.run “java -jar F:\jdk1.3.1\demo\jfc\SwingSet2\SwingSet2.jar”‘

Example 3 – launch Internet Explorer:oShell.Run Chr(34) & “C:\Program Files\Internet Explorer\IEXPLORE.EXE” & Chr(34)Set oShell = Nothing


4) Trivial but useful method

If nothing works out you might try this

You can use the Start -> Run dialog of Windows.

1. Add the Windows Start button to the Object Repository using the “Add Objects” button in Object Repository dialog.

2. Open the Run dialog (Start -> Run), and learn the “Open” edit field and the “OK” button into the Object Repository.

3. Switch to the Expert View, and manually add the lines to open the Run dialog.

Example:Window(“Window”).WinButton(“Button”).ClickWindow(“Window”).Type(“R”)

4. Manually enter the lines to enter the information to launch the application, and click the “OK” button of the Run dialog.

Example:

Dialog(“Run”).WinEdit(“Open:”).Type “c:\WINNT\system32\notepad.exe”

Dialog(“Run”).WinButton(“OK”).Click

Friday, November 18, 2011

Benefits of Automated Testing


Benefits of Automated Testing
Fast
QuickTest runs tests significantly faster than human users.
Reliable
Tests perform precisely the same operations each time they are run, thereby eliminating human error.
Repeatable
You can test how the Web site or application reacts after repeated execution of the same operations.
Programmable
You can program sophisticated tests that bring out hidden information.
Comprehensive
You can build a suite of tests that covers every feature in your Web site or application.
Reusable
You can reuse tests on different versions of a Web site or application, even if the user interface changes.

Tuesday, November 15, 2011

What's New in QuickTest Professional 11.00?

Manage Your Test Data

Quality Center (HP ALM) test configuration functionality enables you to determine at runtime which data sets to use for your tests.

ALM test configurations enable you to:

    * Unbind your data from your tests
    * Share common data sources across different tests
    * Filter your data to fit your testing needs
    * Increase requirements traceability

You store the data for your tests in the Quality Center Test Resources module in the form of data table resource files.

You can then define multiple test configurations for a test in the Test Plan module. When working with data-driven QuickTest tests in HP ALM, each configuration is a QuickTest test that is set to run with a selected data resource file and optional data filter settings.

One or more specific configurations of the test can be included in a Test Set to cover different parts of a requirement or to cover multiple requirements.

By using Quality Center test configurations, you can create more generic tests and reuse them by associating a different set of data with each. You can also reuse your data by associating the same data table file with multiple tests.