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 2

1. Getting Number from String

Function extract_number(msg)
   Dim re, matches, item, result
   Set re = New RegExp
   re.pattern = "[A-Za-z -.]*(\d+).*"
   Set matches = re.Execute(msg)
   If matches.Count > 0 Then
      Set item = matches(0)
      If item.SubMatches.Count > 0 Then
         result = item.SubMatches(0)
      Else
         result = -1
      End If
   Else
           result = -1
   End If
   extract_number = result
End Function

MsgBox extract_number("This user belongs to 10 groups")
MsgBox extract_number("206 features assigned to the user.")

2. Close All the opened Browsers Except QC opened browser

On Error Resume Next
Dim intWndCnt
Dim oDesc, oWnd
'Create Object description
Set oDesc = Description.Create '
Set oWnd = Desktop.ChildObjects(oDesc)
intWndCnt = oWnd.Count
For i = 0 to intWndCnt - 1
Set TmpObj = oWnd.item(i)
strTmpTitle = oWnd.item(i).GetROProperty("Text")
If instr(1,strTmpTitle, "Microsoft Internet Explorer",1) > 0 Then
   If instr(1,strTmpTitle, "Mercury Quality Center",1) > 0 Then
       'msgbox "Title :" & oWnd.item(i).GetROProperty("Text")
   Else
       'msgbox "Close :" & oWnd.item(i).GetROProperty("Text")
       oWnd.item(i).close
   End if
End If
Next
'Clean up
Set oDesc = nothing
Set oWnd = nothing

3. Close all opened Excel files

Public Function fn_close_all_excel_files()
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = 'EXCEL.EXE'")
For Each objProcess in colProcessList
   objProcess.Terminate()
Next
End Function

4. Excel sheet column count

Public Function dtGetColCount (sSheetName)
   On Error Resume Next
   Do
   i = i + 1
   sColName = DataTable.GetSheet(sSheetName).GetParameter(i).Name
   Loop While 0 = Err.Number
   'GetParameter throws an error when using an index that is out of bounds ...
   'We can use this functionality to ASSUME that it's an unused column.
   'We've come to the end of our USED columns
   dtGetColCount = i - 1
   On Error GoTo 0
End Function

5. Count Number of files in any Folder

iFileCount = 0
Set objFileSysOb = CreateObject("Scripting.FileSystemObject")
Set colFolderName = objFileSysOb.GetFolder("C:\Automation") ' Folder Path
Set vFiles =colFolderName.Files
For each vFileItem in vFiles
   print vFileItem
   iFileCount = iFileCount + 1
Next
print iFileCount

6. Create Dynamic Array

For i = 0 to 20
   Redim Preserve arrFileLines(i)
   arrFileLines(i) = "test" & i
Next

7. Close Dialog box

Function DialogClose (obj)
If obj.Dialog("nativeclass:=#32770").Exist(0) Then
   obj.Dialog("nativeclass:=#32770").WinButton("nativeclass:=Button","index:=0").Click
End If
RegisterUserFunc "Browser", "DialogClose", "DialogClose"
End Function

8. Create Dynamic Value

iDynamicValue = now
iDynamicValue = replace(iDynamicValue,"/","")
iDynamicValue = replace(iDynamicValue,":","")
iDynamicValue = replace(iDynamicValue," ","")
iDynamicValue = replace(iDynamicValue,"PM","")
iDynamicValue = replace(iDynamicValue,"AM","")
msgbox iDynamicValue

9. Get QTP file path

Set qtApp = CreateObject("QuickTest.Application") ' Create the Application objectqtpApp.Test.Location
TestLoc = qtApp.Test.Location
MsgBox TestLoc

10. IS QC Connected?

Set qtApp = CreateObject("QuickTest.Application")
If qtApp.TDConnection.IsConnected Then
   msgbox "QC"
Else
   msgbox "Local"
End If

(or)

if QCUtil.IsConnected then
   Reporter.ReportEvent 0, "Connected", "Connected to server: " + QCUtil.QCConnection.ServerName + chr (13) +"Project: " +
   QCUtil.QCConnection.ProjectName + chr (13) + "Domain: " + QCUtil.QCConnection.DomainName
else
   Reporter.ReportEvent 1, "Not connected", "Not connected to Quality Center"
end if

11. Keyboard Key Press through QTP Script

'Create Shell Object
Set WshShell = CreateObject("WScript.Shell")
'Send any Functinal Keys
' ALT = %
' F4 = {F4}
WshShell.SendKeys "%{F4}"
' Set shell object to Null
Set WshShell=nothing

12. QTP9.0 Futurs

- Open and edit multiple Object Repositories
- Easy conversion to/from XML
- Multiple object repositories per test asset
- Leveraging the automation assets across multiple groups
- Missing resources panel
- Pass parameters between Actions


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.