A Sample QTP Real-Time Test Script: For QTP Scripts & Documents Visit
A Sample QTP Real-Time Test Script: For QTP Scripts & Documents Visit
com
'### Purpose: Verify the 145 Lot Size is 100 or More Acres atttribute in the 1 or More
Acres Scenario
'#######################################################
########################################################
#####################
'=======================
' SETUP
'=======================
'_______________________________________________________________________
_____________________________________________________________
Dim objNet
'_______________________________________________________________________
_____________________________________________________________
i=1
msgnum = 0
strFail = 1
'_______________________________________________________________________
_____________________________________________________________
For Software Testing Documents visit: ww.gcreddy.net 1
For QTP Scripts & Documents Visit: www.gcreddy.com
'Function to open a brower and go to a specified URL
End Function
'_______________________________________________________________________
_____________________________________________________________
set wshnetwork=createobject("wscript.network")
scomputername=wshnetwork.computername
set wshnetwork=nothing
strServ = scomputername
'msgbox strServ
'_______________________________________________________________________
_____________________________________________________________
CurrentMode = Reporter.Filter
Reporter.Filter = rfDisableAll
'_______________________________________________________________________
_____________________________________________________________
strInfo = objNet.UserName
'msgbox strInfo
'_______________________________________________________________________
_____________________________________________________________
'Create a unique name for the results file each time the test is executed.
Call CreateFiles()
'_______________________________________________________________________
_____________________________________________________________
strDataSheet = "\\taz02mon901\Mercury\Mercury_QTP_Test\Realtor\2-
Step\2STEP_ATTRIBUTES_FAILURE_LOG_QA.xls"
'_______________________________________________________________________
_____________________________________________________________
'Call ClearCookies
'_______________________________________________________________________
_____________________________________________________________
'=======================
' MAIN
'=======================
'_______________________________________________________________________
_____________________________________________________________
'Database query
dbconn.Open("Driver={SQL Server};Server=TAZ02SQL832;Database=XProperty")
recordset.CursorType = 0
'Do Nothing
Else
bedrooms = 5
End If
End If
bathrooms = fix(bathrooms)
'Do Nothing
Else
bedrooms = 5
End If
bedrooms = ""
bathrooms = ""
End If
'_______________________________________________________________________
_____________________________________________________________
strDate = date
strStartTime = time
'_______________________________________________________________________
_____________________________________________________________
wait (3)
'_______________________________________________________________________
_____________________________________________________________
strView = "LDP"
'_______________________________________________________________________
_____________________________________________________________
'msgbox strPropInfo
'msgbox strGarageCheck
'msgbox "Pass"
Else
'msgbox "Fail"
Call AppendXL
msgnum = msgnum+1
Call SendMail
ExitTest
End If
'_______________________________________________________________________
_____________________________________________________________
wait (3)
'_______________________________________________________________________
____________________________________________________________
wait (3)
If listingtypeid = 1 Then
End If
'_______________________________________________________________________
____________________________________________________________
'Select Listview
strView = "List"
Set odesc=description.Create()
odesc("micclass").value="WebElement"
odesc("html tag").value="DIV"
odesc("class").value="listingData"
strResults = childObjs.count
'msgbox strResults
Call Listcheck
Else
strFail = 1
End If
If strFail= 0 Then
'Do Nothing
Else
Call AppendXL
msgnum = msgnum+1
End If
'_______________________________________________________________________
____________________________________________________________
'Select Galleryview
strView = "Gallery"
Set odesc=description.Create()
odesc("micclass").value="WebElement"
odesc("html tag").value="DIV"
odesc("class").value="listingData"
strResults = childObjs.count
'msgbox strResults
Call Gallerycheck
Else
strFail = 1
End If
If strFail= 0 Then
'Do Nothing
Else
Call AppendXL
msgnum = msgnum+1
End If
'_______________________________________________________________________
____________________________________________________________
'Select Mapview
wait (3)
End If
wait (10)
strView = "Map"
Set odesc=description.Create()
odesc("micclass").value="WebElement"
odesc("html tag").value="DIV"
odesc("class").value="listingData"
strResults = childObjs.count
'msgbox strResults
Call Mapcheck
Else
strFail = 1
End If
If strFail= 0 Then
'Do Nothing
Else
Call AppendXL
msgnum = msgnum+1
End If
'_______________________________________________________________________
_____________________________________________________________
'_______________________________________________________________________
_____________________________________________________________
intRunStatusID = 1
else
End If
'_______________________________________________________________________
_____________________________________________________________
strEndTime = time
'_______________________________________________________________________
_____________________________________________________________
'Call UpdateRun
'_______________________________________________________________________
_____________________________________________________________
If intRunStatusID = 1 Then
Call SendMail
else
Call SendMail
End If
www.gcreddy.net