Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
19Activity
0 of .
Results for:
No results containing your search query
P. 1
QTP Procedures

QTP Procedures

Ratings: (0)|Views: 101 |Likes:
Published by G.C.Reddy

More info:

Published by: G.C.Reddy on Feb 13, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

11/27/2010

pdf

text

original

 
For QTP Scripts & Documents Visit:
www.gcreddy.com
QTP Functions
SUBROUTINES
1) Subroutine to clear the browser cookies and temp files
Sub ClearCookiesOpenBrowser "iexplore.exe", "http://qap.www.realtor.com/"wait (3)Browser("Real Estate Listings,").WinToolbar("ToolbarWindow32").Press "&Tools"Browser("Real Estate Listings,").WinMenu("ContextMenu").Select "Internet Options"Browser("Real Estate Listings,").Dialog("Internet Options").WinButton("Delete").ClickBrowser("Real Estate Listings,").Dialog("Internet Options").Dialog("Delete BrowsingHistory").WinButton("Delete all").ClickBrowser("Real Estate Listings,").Dialog("Internet Options").Dialog("Delete BrowsingHistory").Dialog("Delete Browsing History").WinButton("Yes").ClickBrowser("Real Estate Listings,").Dialog("Internet Options").WinButton("OK").ClickBrowser("Real Estate Listings,").Page("Real Estate Listings,").SyncBrowser("Real Estate Listings,").CloseEnd Sub
Subroutine to create a file to store results of this test
Sub CreateFilesSet fso = CreateObject("Scripting.FileSystemObject")Set filetxt = fso.CreateTextFile(mypath, true)filetxt.WriteLine("<html><font face=Arialcolor=blue><h3><b>2Step_1orMoreAcres_Attribute_145_100orMoreAcres&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp" ) & Date&"<br>"filetxt.WriteLine("</b></font></h3><br>")filetxt.WriteLine("<br><font face=Arial></html>")
For Software Testing Documents visit:
ww.gcreddy.net
1
 
For QTP Scripts & Documents Visit:
www.gcreddy.com
filetxt.CloseEnd Sub'_______________________________________________________________________ _____________________________________________________________'Report the results of the testSub ReportPassConst ForReading = 1, ForWriting = 2, ForAppending = 8Set fso = CreateObject("Scripting.FileSystemObject")Set filetxt = fso.OpenTextFile(mypath, ForAppending, True)filetxt.WriteLine(val &"<br>")filetxt.WriteLine("<br>")End Sub'_______________________________________________________________________ _____________________________________________________________'Report the results of the testSub ReportFailConst ForReading = 1, ForWriting = 2, ForAppending = 8Set fso = CreateObject("Scripting.FileSystemObject")Set filetxt = fso.OpenTextFile(mypath, ForAppending, True)filetxt.WriteLine("<font color=red>"&val&"<br>")filetxt.WriteLine("URL = " & strTargetURL &"</font><br>")filetxt.WriteLine("<br>")End Sub'_______________________________________________________________________ _____________________________________________________________
For Software Testing Documents visit:
ww.gcreddy.net
2
 
For QTP Scripts & Documents Visit:
www.gcreddy.com
'Update execution result in dbo.Automation_Run tableSub UpdateRunSet dbConnection = CreateObject("ADODB.Connection")dbConnection.Open("Driver={SQLServer};Server=TAZ02MON901;Database=Automation")sqlUpdateRun = "EXEC dbo.sp_AUTOMATION_RUNS_MOD @SCRIPTID = '186',@RUNSTATUSID = " & intRunStatusID dbConnection.Execute(sqlUpdateRun)dbConnection.CloseSet dbConnection = Nothing End Sub'_______________________________________________________________________ _____________________________________________________________'Subroutine to send an email notification of test resultsSub SendMailIf msgnum = 0 Thenmsgstr = "2Step_1orMoreAcres_Attribute_145_100orMoreAcres TestResults:" &vbcrLf &"All Test Cases Passed "Elsemsgstr ="2Step_1orMoreAcres_Attribute_145_100orMoreAcres Test Results:" &vbcrLf &"One ormore of the Test Cases Failed." &vbcrLf &"See attachment for details."End If Set objMessage = CreateObject("CDO.Message")objMessage.Subject = "~2Step_1orMoreAcres_Attribute_145_100orMoreAcres"objMessage.From = "sam.harris@move.com"
For Software Testing Documents visit:
ww.gcreddy.net
3

Activity (19)

You've already reviewed this. Edit your review.
1 hundred reads
Sai Krishna liked this
dashrath_y07 liked this
r3.arun6100 liked this
anshulkharub liked this
anshulkharub liked this
sonyasok liked this
kmdasari liked this
kmdasari liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->