Tuesday, 9 September 2014

Testing process in QTP

Testing process in QTP:
To automate functionality testing with help of QTP we use following process

Plan the Test:
Analyze automation test scenario which you want to test

Prepare Tool for Recording:
In this phase we should open QTP with required Add-ins based on application environment in order to support

Specify on which application operations QTP need to convert into automation script using “Record & Run Settings”

Navigation:
“Automation” menu
Select “Record & Run Settings”
Or
Click on “Record” icon in a New Test

In “Record & Run Settings” there are 2 types of options
1.      Record and Run test on any open windows based application:
When we select this option QTP able to record multiple application operations into automation script
2.      Record & Run only on:
When we select this option QTP records only on specified application operations and also QTP is able to launch application during recording and Runtime

Ex: prepare QTP to record only “FR” application operations
Navigation:
Open “R & R Settings”
Select “Record & Run Test only on” option
Click on [+] button
Browse “FR” application path
Select “Launch application” if required (when application not available on screen)
Click on “OK”
Click on “Ok”

Generating Basic script:
To perform required business transactions on AUT we generate basic script using recording modes or by writing script manually.

Enhancement of script:
After creation of basic script in order to validate application actual behavior we perform some editing operations in the script.
Following are the options we use during enhancement of script:

Checkpoints:
Output values
Conditional statements
Loop statements
Test object methods
Synchronization points
Transaction points
Parameterize script

Debug test script:
After enhancement to identify any logical errors and to confirm script will smoothly or not we perform debugging

Following are the debug commands:
Breakpoint
Add to watch
Step Into
Step Out
Step Over

Execution of test script:
After debugging in order to validate application functionalities we execute test scripts as Test batches

Analyze Result:
After execution QTP provides test result in terms of pass/fail, where we analyze test result

Defect Reporting:
During result analysis if any defects deviations are identified then we can log the defect directly into Quality Center or we can export test result


Components in QTP main screen

1.Tool Bar:
    It contains menu options and icons to perform operations on QTP

2. Test Pane:
It is like an editor screen, where we can generate automation script using recording modes or by writing script manually and also we can perform required editing operations
There are 2 types of views in Test pane:
                                    a. Expert View:
In this view by default script generates in VB Script
In general we prefer Expert View where it is easy to write the script manually

                                    b. Keyword view:
In this view script generates in simple understandable language in terms of Item, Operation, Value and Documentation
In this view script is easy to understand without VB script knowledge

3. Active Screen:
By default during recording QTP captures snapshot of application for each recorded statement and those will be maintained in Active screen component
Advantages:
-easy to understand script
-we can perform enhancement in the script like inserting checkpoints, output values and new steps
-we can view/add objects into ‘Object Repository’

Disadvantage:
-Active screen files will occupy more memory space

Note:
Using “Active Screen modes” in “General Options” we can configure Active screen capture settings

Note: if active screen files are ready exist then while saving test script we can set “OFF” for “save Active screen files” check box to remove Snapshots for a test

4. Data Table:
QTP default providing built-in data table, where we can import/maintain test data and then we can parameterize test script
There are 2 types of sheets in Data table
                                    a. Global sheet:
By default Test will execute multiple times based number of rows filled with test data in Global sheet

Using test data from Global sheet we can parameterize any Action script within the test

                                    b. Action/Local sheet:
By default for each action QTP provides individual local sheets in data table

Irrespective of number of rows filled with test data in Action sheet test will execute only one time

Using test data from Action/local sheet we can parameterize that particular Action script only

Note:
In Test we can create maximum 255 Actions

5. Test Flow:
In this component we can view the sequence of actions execution flow and also based on requirement we can reorder those actions execution flow

Note:
In general Actions will execute in a test, in which sequence we created those actions

6. Debug viewer:
During execution break time to view the intermediate values of variables and to modify those values based on requirement we can use debug viewer
There are 3 sections in Debug viewer:
                                    Watch: to view specific variable value
                                    Variables: to view all the variable values at Breakpoint
                                    *Command: to modify value in a variable

7. Information pane: (Ctrl+F7)
To view any syntax errors information in the script we use information pane

8. Missing Resources:
In general for a test we associate different resource files like repositories, library functions, environment variables, test data, recovery scenarios…etc

For a opened test any associated resource file is not available that information will be provided in “Missing Resources” component

Tuesday, 2 September 2014

Introduction to QTP

  • It is product of HP
  • It is a functionality and Regression testing tool
  • It works on windows OS only
  • It supports client/server and web based applications to automate like Java, .Net, Visual basic, Asp.Net, People soft, Seibel CRM,Delphi, SAP, XML files &application, HTML, Mainframes (Terminal Emulator), Oracle applications…etc
  • QTP supported automation scripting languages are VB Script & Java script
  • Basic working principle is Record & Playback
  • Record: converting our business transactions into automation script
  • Playback: execution of automation script to validate application

Monday, 1 September 2014

Automation Testing Approach for a Project

Automation Testing Approach for a Project:
Following are the activities performed by automation testing team

1. Feasibility Study:
After getting a new project for automation testing, TM will do feasibility study to confirm project is acceptable or not for automation testing
Following are the factors analyzed in Feasibility study:
                                    -Application Environment
                                    -complexity of functionalities
                                    -Return On Investment (ROI)
                                    -Availability of time

2. Selection of automation tool:
If project is acceptable for automation testing then TM will select required automation tool by analyzing following factors
                                    -Availability of Automation Tools
                                    -which tool will support application Environment
                                    -if client specified any particular automation tool
                                    -availability of automation TE’s

3. Prepare Test Strategy/ Framework
Framework: It describes set of activities to be performed by automation testing team to develop the automation scripts and to execute the scripts. After selection of Automation tool TM will design framework based on complexity of functionalities in a project.

4. Prepare Automation Test Plan:
It is performed by Test Lead
Automation TP will describes list of automation test scenarios, TE names, allocated tasks, Test Environment, schedule…etc

5. Developing automation scripts
Automation TE is responsible to develop the automation scripts based on automation test scenarios

6. Maintenance & Execution:

Maintenance:
For reusability of automation scripts and corresponding resource files we should maintain folder structure in our local system

Execution:
After creation of test scripts and corresponding test resource files we execute scripts to validate application.




Scenarios which are preferred/not preffered for automation testing

Scenarios which are preferred for automation testing:

In general scenarios which are complex and more repeatable those are more suitable for automation testing
Ex:
                  -Sanity Test scenarios
                  -Regression test scenarios
                  -Scenarios which are required multiple set of test data to validate (i.e. Re-Testing)
                  -Compatibility Test scenarios

     Scenarios which are not preferred for automation testing:
In general scenarios which are simple and which are not repeatable those are performed manually only
Ex:
                  -User Interface test factors
                  -Usability test factors
                  -One time testing activities
                  -Ad-Hoc testing/Random testing activities (i.e. Informal testing)

    Note: For an application there can be manual testing team and automation testing team but automation                    testing is an optional