Home  |  Contact Us 
Manual Testing
BlackBox Testing
Black-box Testing treats the system as a "black-box"...
http://testingfaqs.co.in/bb

BlackBox Testing Skills
What skills I want to have for Blackbox testing...
http://testingfaqs.co.in/bbt

BlackBox Test Approach
What Approaches we need to follow for Blackbox testing...
http://testingfaqs.co.in/bba

BlackBox Test Metrics
A metric is defined to be the name of a mathematical function...
http://testingfaqs.co.in/bbm

BlackBox Test Plan
Test planning is one of the keys to successful software testing...
http://testingfaqs.co.in/bbp

Bug Life Cycle
Defect tracking is the process of finding defects in a product...
http://testingfaqs.co.in/blc

Client-Server Testing
Client/Server computing is a style of computing involving multiple processors...
http://testingfaqs.co.in/blc

Compatibility Testing
A Testing to ensure compatibility of an application...
http://testingfaqs.co.in/ct

Manual Testing Faq's
A Testing to ensure compatibility of an application...
http://testingfaqs.co.in/mtf

Functionality Testing
Functional testing is validating an application or web site...
http://testingfaqs.co.in/ft

Metrics
Test Metrics are meaningful if they provide objective feedback ...
http://testingfaqs.co.in/me

Performance Testing
Performance testing is a rigorous usability evaluation...
http://testingfaqs.co.in/pt

Perfor on Web Applications
Performance of a Web site is analyzed from different viewpoints...
http://testingfaqs.co.in/pw

Regression Testing
Regression testing is testing the module in which a bug...
http://testingfaqs.co.in/rt

Seven-Steps Metrics
Software metrics are an integral part of the state-of-the-practice...
http://testingfaqs.co.in/ssm

Techniques Testing
Black box testing attempts to derive sets of inputs that...
http://testingfaqs.co.in/bbt

Testing Life Cycle
The lifecycle ensures that all the relevant inputs are obtained...
http://testingfaqs.co.in/tlc

Types of Testing
Regression, Blockbox, Load, Stress testing and etc...
http://testingfaqs.co.in/tot

V - Model
The development process for a system is traditionally...
http://testingfaqs.co.in/vm

Waterfall Model
This is one of the first models of software development...
http://testingfaqs.co.in/wm

Web Testing
During testing the websites the following scenarios...
http://testingfaqs.co.in/wt
QTP Solutions 1

1. Action Template

If you need any default Template to be loaded whenever you create a new Action, just follow these steps.
  1. Design the template with all the statements and comments in a text file.
  2. Save the text file as "ActionTemplate.mst" to the "QuickTest Installation Folder" under \dat folder.
  3. Start QTP and whenever you create new Actions, you can find the template by default.

2. ADO Connection Function - Open the ADO connection through QTP

Public Function BIP_sqlDBConnect(sConnectionStr)
   ' Create the Connection Object.
   Set oADOConnection = CreateObject("ADODB.Connection")
   ' Set the Connection String.
   oADOConnection.Open (sConnectionStr)
   'ReturnADO object reference
   Set BIP_sqlDBConnect = oADOConnection
End Function

3. Close QTP - Closing the QTP after Execution

Private Function CloseQTP
   Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
   Set colProcess = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = 'QTPro.exe'")
   For Each objProcess in colProcess
   objProcess.Terminate()
   Next
   Set objWMIService = Nothing
   Set colProcess = Nothing
End Function

4. Open Application

' Open a specified application
' Parameter: application - the application full name (including location)
'@Description Opens an application
'@Documentation Open the application.

Function OpenApp (application)
   systemUtil.Run application
End Function

5. Add Test Results

' Add a Report.Event step to the Test Results
'Parameters:
' status - Step status (micPass, micFail, micDone or micWarning)
' StepName - Name of the intended step in the report (object name)
' details - Description of the report event
'@Description Reports an event to the Test Results
'@Documentation Report an event to the Test Results.

Public Function AddToTestResults (status, StepName, details)
   Reporter.ReportEvent status, StepName, details
End Function

6. Verify Object Is Enabled

' Add a Report.Event step to the Test Results
'Parameters:
' status - Step status (micPass, micFail, micDone or micWarning)
' StepName - Name of the intended step in the report (object name)
' details - Description of the report event
'@Description Reports an event to the Test Results
'@Documentation Report an event to the Test Results.

Public Function VerifyEnabled (obj)
   Dim enable_property
   'Get the enabled property from the test object
   enable_property = obj.GetROProperty("enabled")
   If enable_property <> 0 Then ' The value is True (anything but 0)
     Reporter.ReportEvent micPass, "VerifyEnabled Succeeded", "The test object is enabled"
     VerifyEnabled = True
   Else
     Reporter.ReportEvent micFail, "VerifyEnabled Failed", "The test object is NOT enabled"
     VerifyEnabled = False
   End If
End Function

7. Verify Object Is Disabled

' Add a Report.Event step to the Test Results
'Parameters:
' status - Step status (micPass, micFail, micDone or micWarning)
' StepName - Name of the intended step in the report (object name)
' details - Description of the report event
'@Description Reports an event to the Test Results
'@Documentation Report an event to the Test Results.

Public Function VerifyDisabled (obj)
   Dim enable_property
   'Get the enabled property from the test object
   enable_property = obj.GetROProperty("disabled")
   If enable_property = 0 Then ' The value is False (0) - Enabled
     Reporter.ReportEvent micPass, "VerifyDisabled Succeeded", "The test object is enabled"
     VerifyDisabled = True
   Else
     Reporter.ReportEvent micFail, "VerifyDisabled Failed", "The test object is NOT enabled"
     VerifyDisabled = False
   End If
End Function

8. Get Value Property

' Return the object 'Value' property
'@Description Returns the Object value
'@Documentation Return the 'Test object name' 'test object type' value.

Public Function GetValueProperty (obj)
   GetValueProperty = obj.GetROProperty("value")
End Function

9. Get Text Property

' Return the object 'Text' property
'@Description Returns the Object value
'@Documentation Return the 'Test object name' 'test object type' value.

Public Function GetTextProperty (obj)
   GetTextProperty = obj.GetROProperty("text")
End Function

10. Get Position Property

' Return the object 'position' property
'@Description Returns the Object value
'@Documentation Return the 'Test object name' 'test object type' value.

Public Function GetPositionProperty (obj)
   GetPositionProperty = obj.GetROProperty("position")
End Function

11. Get Selection Property

' Return the object 'selection' property
'@Description Returns the Object value
'@Documentation Return the 'Test object name' 'test object type' value.

Public Function GetSelectionProperty (obj)
   GetSelectionProperty = obj.GetROProperty("selection")
End Function

12. Get Checked Property

' Return the object 'checked' property
'@Description Returns the Object value
'@Documentation Return the 'Test object name' 'test object type' value.

Public Function GetCheckedProperty (obj)
   GetCheckedProperty = obj.GetROProperty("checked")
End Function




Important Faq's




Automation Testing
Basic QTP Faq's
Learn Basic's of QTP for free...
http://testingfaqs.co.in/bq

QTP Database Functions
Fucntions to use Database through QTP...
http://testingfaqs.co.in/db

Descriptive Programming
Diff between DP and Object Repository...
http://testingfaqs.co.in/dp

QTP Excel Functions
All Excel QTP functinos are at one place...
http://testingfaqs.co.in/ex

QTP Faq's
Learn QTP Faqs...
http://testingfaqs.co.in/fq

QTP FSO Functions
File System Object functions for QTP...
http://testingfaqs.co.in/fs

QTP HTML Report Functions
Funcitons for generating the .html results through QTP...
http://testingfaqs.co.in/htm

QTP Solutions 1
Real-time functions on need base...
http://testingfaqs.co.in/s1

QTP Solutions 2
Collection of solutions...
http://testingfaqs.co.in/s2

QTP Solutions 3
Copy & Past the functions...
http://testingfaqs.co.in/s3

QTP Solutions 4
Use all the functions...
http://testingfaqs.co.in/s4

QTP Topics
Good Topics on QTP...
http://testingfaqs.co.in/tp

LoadRunner Faq's
Loadrunner faqs for free...
http://testingfaqs.co.in/lr

WinRunner Faq's
Learn winrunner for free...
http://testingfaqs.co.in/wr

Copyright © 2008 Testing Faqs. All rights reserved.