SlideShare una empresa de Scribd logo
1 de 17
For more QTP Real time scripts, visit www.ramupalanki.com




                           QTP Scripts




########################################################
########################################################
####################

'### Test Name: 2Step_1orMoreAcres_Attribute_145_100orMoreAcres

'# ## Created by: Sam Harris

'### Purpose: Verify the 145 Lot Size is 100 or More Acres atttribute in the 1 or More
Acres Scenario

'### Creation Date: 1/11/2010



www.ramupalanki.com
For more QTP Real time scripts, visit www.ramupalanki.com
'#######################################################
########################################################
#####################


'=======================

'              SETUP

'=======================


'_______________________________________________________________________
_____________________________________________________________

Dim objNet

Dim strInfo

'_______________________________________________________________________
_____________________________________________________________

'Set the initial value of the variables

i=1

msgnum = 0

strFail = 1

strTestName = "2Step_1orMoreAcres_Attribute_145_100orMoreAcres"

'_______________________________________________________________________
_____________________________________________________________

'Function to open a brower and go to a specified URL

Function OpenBrowser (browser, URL)

    systemUtil.Run browser, URL

End Function

'_______________________________________________________________________
_____________________________________________________________

'Get Computer Name

set wshnetwork=createobject("wscript.network")


www.ramupalanki.com
For more QTP Real time scripts, visit www.ramupalanki.com
scomputername=wshnetwork.computername

set wshnetwork=nothing

strServ = scomputername

'msgbox strServ

'_______________________________________________________________________
_____________________________________________________________

'Turn off the report filter

CurrentMode = Reporter.Filter

Reporter.Filter = rfDisableAll

'_______________________________________________________________________
_____________________________________________________________

'Get username from the local box

Set objNet = CreateObject("WScript.NetWork")

strInfo = objNet.UserName

'msgbox strInfo

'_______________________________________________________________________
_____________________________________________________________

'Create a unique name for the results file each time the test is executed.

mypath =
"taz02mon901MercuryQTP_Test_Results2Step_1orMoreAcres_Attribute_145_100orMo
reAcres.html"

    Call CreateFiles()

'_______________________________________________________________________
_____________________________________________________________

' Set Excel File to be appenced

strDataSheet = "taz02mon901MercuryMercury_QTP_TestRealtor2-
Step2STEP_ATTRIBUTES_FAILURE_LOG_QA.xls"

'_______________________________________________________________________
_____________________________________________________________


www.ramupalanki.com
For more QTP Real time scripts, visit www.ramupalanki.com
'Clear the cookies and temp files

'Call ClearCookies

'_______________________________________________________________________
_____________________________________________________________


'=======================

'              MAIN

'=======================


'_______________________________________________________________________
_____________________________________________________________

'Database query

' Connect to the Realtor database

Set dbconn = CreateObject("ADODB.Connection")

Set recordset = CreateObject("ADODB.recordset")

'MS SQL Server DSNless connection

'dbconn.Open("Driver={SQL Server};Server=TAZ02SQL832 ;Database=XProperty
;Uid=admin;Pwd=admin")

dbconn.Open("Driver={SQL Server};Server=TAZ02SQL832;Database=XProperty")

dbconn.commandTimeout = 300

' Specify the query

sql = "select top 1
l.listingid,l.postalcode,l.marketingtypeid,l.listingtypeid,l.bedrooms,l.bathrooms,l.listingsqft,
l.price,l.address,l.city,l.state,l.createdate,l.geoapproximation from xproperty.dbo.listing
(nolock) l join xproperty.dbo.LISTING_ATTRIBUTE (nolock) la1 on l.listingid = la1.listingid
left join xproperty.dbo.LISTING_ATTRIBUTE (nolock) la2 on l.listingid = la2.listingid and
la2.attributeid in (144,146,147,150,152,154,159,161,166) where l.status = 'a' and
l.agentid is not null and l.postalcode is not null and l.postalcode <> '' and l.country = 'usa'
and la1.attributeid = 145 and l.geoapproximation = 1 and l.DataSourceID not in (select
datasourceid from xproperty.dbo.DATA_SOURCE_ATTRIBUTE where attributeid in (27,31))
and la2.ListingID is null and l.createdate < getdate() - 2 order by l.createdate desc"

' Set the recordset cursor type


www.ramupalanki.com
For more QTP Real time scripts, visit www.ramupalanki.com
recordset.CursorType = 0

' Execute the query

recordset.Open sql, dbconn

     listingid = recordset.Fields("listingid")&""

     listingid = Trim(listingid)'

     'msgbox listingid

     postalcode = recordset.Fields("postalcode")&""

     'msgbox postalcode

     marketingtypeid = recordset.Fields("marketingtypeid")&""

     'msgbox marketingtypeid

     listingtypeid = recordset.Fields("listingtypeid")&""

     'msgbox listingtypeid

     bedrooms = recordset.Fields("bedrooms")&""

     'msgbox bedrooms

     bathrooms = recordset.Fields("bathrooms")&""

     'msgbox bathrooms

     listingsqft = recordset.Fields("listingsqft")&""

     'msgbox listingsqft

     price = recordset.Fields("price")&""

     'msgbox price

     address = recordset.Fields("address")&""

     'msgbox address

     city = recordset.Fields("city")&""

     'msgbox city




www.ramupalanki.com
For more QTP Real time scripts, visit www.ramupalanki.com
     state = recordset.Fields("state")&""

     'msgbox state

     createdate = recordset.Fields("createdate")&""

     'msgbox createdate

If bedrooms = "" Then

    'Do Nothing

         Else

                If bedrooms >5 Then

                    bedrooms = 5

                End If

End If

bathrooms = fix(bathrooms)

If bathrooms = "" Then

    'Do Nothing

         Else

                If bedrooms >5 Then

                    bedrooms = 5

                End If

End If

If listingtypeid = 6 Then

    bedrooms = ""

    bathrooms = ""

End If

'_______________________________________________________________________
_____________________________________________________________



www.ramupalanki.com
For more QTP Real time scripts, visit www.ramupalanki.com
' Date and Start Time of the test run

strDate = date

strStartTime = time

'_______________________________________________________________________
_____________________________________________________________

'Open a browser to the REALTOR.com homepage

OpenBrowser "iexplore.exe", "http://qap.www.realtor.com/"

wait (3)

'_______________________________________________________________________
_____________________________________________________________

'Find the listing

'Browser("Real Estate Listings,").WinEdit("Edit").Check CheckPoint("Edit_8")

Browser("Real Estate Listings,").Navigate ("http://qap.www.realtor.com/prop/"&listingid)

Browser("Real Estate Listings,").Sync

strView = "LDP"

'_______________________________________________________________________
_____________________________________________________________

'Check for the text office on the LDP

'Browser("Real Estate Listings,_5").Page("2275 Youngman Ave
Unit:").WebElement("Property Information for").Check CheckPoint("Property Information
for 2275 Youngman Ave Unit: 108W Save Listing Property FeaturesCondo/Townhome/Row
Home/Co-OpStatus: Active Area: SP-Highland Area County: RAMSEYYear Built: 1980 1
total bedroom(s) 2 total bath(s) Approximately 1130 sq. ft.Style: High Rise (4+ Levels)
Office 1 car garage School District: St. Paul Exterior FeaturesHeated garage Listing
InformationRefreshed at 9:35 AM PT (19 days ago)Added on Jun 29, 2004 (1940 days
ago) To access this page directly, usehttp://qap.www.realtor.com/realestateandhomes-
detail/2275-Youngman-Ave-Unit-108W_St-Paul_MN_55116_1038274619 This listing is
brokered byEdina Realty, Inc.Office: (651)698-2434")

strPropInfo = Browser("Real Estate Listings,_5").Page("2275 Youngman Ave
Unit:").WebElement("Property Information for").GetROProperty("innertext")

'msgbox strPropInfo




www.ramupalanki.com
For more QTP Real time scripts, visit www.ramupalanki.com
strGarageCheck = Instr(strPropInfo, "Lot size is 100 or more acres")

'msgbox strGarageCheck

If strGarageCheck <> 0 Then

    'msgbox "Pass"

           Else

                  'msgbox "Fail"

           strEndTime = time

                  Call AppendXL

                  msgnum = msgnum+1

                      Browser("Real Estate Listings,_5").Page("2275 Youngman Ave
Unit:").Sync

                      Browser("Real Estate Listings,_5").Close

                      Call SendMail

           ExitTest

End If

'_______________________________________________________________________
_____________________________________________________________

'Close the browser

Browser("Real Estate Listings,_5").Page("2275 Youngman Ave Unit:").Sync

Browser("Real Estate Listings,_5").Close

'_______________________________________________________________________
_____________________________________________________________

'Open a browser to the REALTOR.com homepage

OpenBrowser "iexplore.exe", "http://qap.www.realtor.com/"

wait (3)

'_______________________________________________________________________
____________________________________________________________


www.ramupalanki.com
For more QTP Real time scripts, visit www.ramupalanki.com
Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebEdit("srchHomeLocation").Set postalcode

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebRadioGroup("ctl00$cphC$MainSearch$ccBuyRen").Select marketingtypeid

Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebElement("More
Search Options").FireEvent "onmouseover"

Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebElement("More
Search Options").Click

Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebEdit("tbMinPrice").Set
price

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebEdit("tbMaxPrice").Set price

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebList("ctl00$cphC$AdvancedSearchPage$_2").Select bedrooms&"+"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebList("ctl00$cphC$AdvancedSearchPage$_3").Select bathrooms&"+"

If marketingtypeid = 2 Then

'Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebElement("WebElement").FireEvent "onmouseover"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebRadioGroup("ctl00$cphC$AdvancedSearchPage$").FireEvent
"onmouseover"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebRadioGroup("ctl00$cphC$AdvancedSearchPage$").Select "2"

wait (3)

End If

If listingtypeid = 1 Then

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$").Set "ON"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_2").Set "OFF"




www.ramupalanki.com
For more QTP Real time scripts, visit www.ramupalanki.com
Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_4").Set "OFF"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_5").Set "OFF"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_6").Set "OFF"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_7").Set "OFF"

ElseIf listingtypeid = 2 Then

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$").Set "OFF"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_2").Set "ON"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_4").Set "OFF"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_5").Set "OFF"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_6").Set "OFF"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_7").Set "OFF"

ElseIf listingtypeid = 4 Then

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$").Set "OFF"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_2").Set "OFF"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_4").Set "ON"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_5").Set "OFF"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_6").Set "OFF"




www.ramupalanki.com
For more QTP Real time scripts, visit www.ramupalanki.com
Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_7").Set "OFF"

ElseIf listingtypeid = 3 Then

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$").Set "OFF"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_2").Set "OFF"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_4").Set "OFF"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_5").Set "ON"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_6").Set "OFF"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_7").Set "OFF"

ElseIf listingtypeid = 5 Then

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$").Set "OFF"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_2").Set "OFF"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_4").Set "OFF"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_5").Set "OFF"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_6").Set "ON"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_7").Set "OFF"

ElseIf listingtypeid = 6 Then

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$").Set "OFF"




www.ramupalanki.com
For more QTP Real time scripts, visit www.ramupalanki.com
Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_2").Set "OFF"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_4").Set "OFF"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_5").Set "OFF"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_6").Set "OFF"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_7").Set "ON"

End If

Browser("Real Estate Listings,").Page("Real Estate Listings,_3").Link("Lot &
Community").FireEvent "onmouseover"

Browser("Real Estate Listings,").Page("Real Estate Listings,_3").Link("Lot &
Community").Click

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebList("ctl00$cphC$AdvancedSearchPage$_5").FireEvent "onmouseover"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebList("ctl00$cphC$AdvancedSearchPage$_5").Click

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebList("ctl00$cphC$AdvancedSearchPage$_5").Select "1 or More Acres"

Browser("Real Estate Listings,_5").Page("Real Estate Listings,").Link("Search").Click

Browser("Real Estate Listings,_5").Sync

'_______________________________________________________________________
____________________________________________________________

'Select Listview

Browser("Real Estate Listings,_5").Page("55116 real estate &
55116").WebElement("WebElement_2").Click

strView = "List"

Set odesc=description.Create()

odesc("micclass").value="WebElement"


www.ramupalanki.com
For more QTP Real time scripts, visit www.ramupalanki.com
odesc("html tag").value="DIV"

odesc("class").value="listingData"

Set childObjs= Browser("Real Estate Listings,").Page("55116 real estate &
55116").ChildObjects(odesc)

strResults = childObjs.count

'msgbox strResults

If strResults <> 0 Then

    Call Listcheck

         Else

                strFail = 1

End If

If strFail= 0 Then

    'Do Nothing

         Else

         strEndTime = time

                Call AppendXL

                msgnum = msgnum+1

End If

'_______________________________________________________________________
____________________________________________________________

'Select Galleryview

Browser("Real Estate Listings,_5").Page("55116 real estate &
55116").WebElement("WebElement_4").Click

strView = "Gallery"

Set odesc=description.Create()

odesc("micclass").value="WebElement"



www.ramupalanki.com
For more QTP Real time scripts, visit www.ramupalanki.com
odesc("html tag").value="DIV"

odesc("class").value="listingData"

Set childObjs= Browser("Real Estate Listings,").Page("55116 real estate &
55116").ChildObjects(odesc)

strResults = childObjs.count

'msgbox strResults

If strResults <> 0 Then

    Call Gallerycheck

         Else

                strFail = 1

End If

If strFail= 0 Then

    'Do Nothing

         Else

         strEndTime = time

                Call AppendXL

                msgnum = msgnum+1

End If

'_______________________________________________________________________
____________________________________________________________

'Select Mapview

Browser("Real Estate Listings,").Page("55116 real estate &
55116").Image("REALTOR.com® - Official").Click

Browser("Real Estate Listings,").Sync

Browser("Real Estate Listings,").Page("Real Estate Listings,_3").WebElement("More
Search Options").Click

If marketingtypeid = 2 Then


www.ramupalanki.com
For more QTP Real time scripts, visit www.ramupalanki.com
'Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebElement("WebElement").FireEvent "onmouseover"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebRadioGroup("ctl00$cphC$AdvancedSearchPage$").FireEvent
"onmouseover"

Browser("Real Estate Listings,_5").Page("Real Estate
Listings,").WebRadioGroup("ctl00$cphC$AdvancedSearchPage$").Select "2"

wait (3)

End If

Browser("Real Estate Listings,").Page("Real Estate Listings,_3").Link("Display
Options").Click

Browser("Real Estate Listings,").Page("Real Estate
Listings,_3").WebRadioGroup("ccViewResults").Select "map"

Browser("Real Estate Listings,").Page("Real Estate Listings,_3").Link("Search").Click

Browser("Real Estate Listings,").Sync

wait (10)

strView = "Map"

'Browser("Real Estate Listings,").Page("55116 real estate &
55116").WebElement("WebElement_3").Check CheckPoint("WebElement_2")

Set odesc=description.Create()

odesc("micclass").value="WebElement"

odesc("html tag").value="DIV"

odesc("class").value="listingData"

Set childObjs= Browser("Real Estate Listings,").Page("55116 real estate &
55116").ChildObjects(odesc)

strResults = childObjs.count

'msgbox strResults

If strResults <> 0 Then

    Call Mapcheck


www.ramupalanki.com
For more QTP Real time scripts, visit www.ramupalanki.com
         Else

                strFail = 1

End If

If strFail= 0 Then

    'Do Nothing

         Else

         strEndTime = time

                Call AppendXL

                msgnum = msgnum+1

End If

'_______________________________________________________________________
_____________________________________________________________

'Close the browser

Browser("Real Estate Listings,_5").Page("2275 Youngman Ave Unit:").Sync

Browser("Real Estate Listings,_5").Close

'_______________________________________________________________________
_____________________________________________________________

           If msgnum = 0 Then

                     intRunStatusID = 1

                         else

                              intRunStatusID = 0

                End If

'_______________________________________________________________________
_____________________________________________________________

'Test Run End Time

strEndTime = time



www.ramupalanki.com
For more QTP Real time scripts, visit www.ramupalanki.com
'_______________________________________________________________________
_____________________________________________________________

'Call UpdateRun

'_______________________________________________________________________
_____________________________________________________________

'Determine which email sub to use based on Pass or Fail




If intRunStatusID = 1 Then

    Call SendMail

         else

                Call SendMail

End If




www.ramupalanki.com

Más contenido relacionado

La actualidad más candente

Cascadia.js: Don't Cross the Streams
Cascadia.js: Don't Cross the StreamsCascadia.js: Don't Cross the Streams
Cascadia.js: Don't Cross the Streamsmattpodwysocki
 
Code Contracts In .Net
Code Contracts In .NetCode Contracts In .Net
Code Contracts In .NetBruce Johnson
 
Best Practices in Qt Quick/QML - Part II
Best Practices in Qt Quick/QML - Part IIBest Practices in Qt Quick/QML - Part II
Best Practices in Qt Quick/QML - Part IIICS
 
Reactive Access to MongoDB from Java 8
Reactive Access to MongoDB from Java 8Reactive Access to MongoDB from Java 8
Reactive Access to MongoDB from Java 8Hermann Hueck
 
The Ring programming language version 1.9 book - Part 48 of 210
The Ring programming language version 1.9 book - Part 48 of 210The Ring programming language version 1.9 book - Part 48 of 210
The Ring programming language version 1.9 book - Part 48 of 210Mahmoud Samir Fayed
 
Understanding Asynchronous JavaScript
Understanding Asynchronous JavaScriptUnderstanding Asynchronous JavaScript
Understanding Asynchronous JavaScriptjnewmanux
 
Groovy Api Tutorial
Groovy Api  TutorialGroovy Api  Tutorial
Groovy Api Tutorialguligala
 
C#을 이용한 task 병렬화와 비동기 패턴
C#을 이용한 task 병렬화와 비동기 패턴C#을 이용한 task 병렬화와 비동기 패턴
C#을 이용한 task 병렬화와 비동기 패턴명신 김
 
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Wprowadzenie do technologii Big Data / Intro to Big Data EcosystemWprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Wprowadzenie do technologii Big Data / Intro to Big Data EcosystemSages
 
Node 관계형 데이터베이스_바인딩
Node 관계형 데이터베이스_바인딩Node 관계형 데이터베이스_바인딩
Node 관계형 데이터베이스_바인딩HyeonSeok Choi
 
From SQLAlchemy to Ming with TurboGears2
From SQLAlchemy to Ming with TurboGears2From SQLAlchemy to Ming with TurboGears2
From SQLAlchemy to Ming with TurboGears2Alessandro Molina
 
06 - Qt Communication
06 - Qt Communication06 - Qt Communication
06 - Qt CommunicationAndreas Jakl
 
Java Concurrency Gotchas
Java Concurrency GotchasJava Concurrency Gotchas
Java Concurrency GotchasAlex Miller
 
Powerful JavaScript Tips and Best Practices
Powerful JavaScript Tips and Best PracticesPowerful JavaScript Tips and Best Practices
Powerful JavaScript Tips and Best PracticesDragos Ionita
 
Apache Cassandra in Bangalore - Cassandra Internals and Performance
Apache Cassandra in Bangalore - Cassandra Internals and PerformanceApache Cassandra in Bangalore - Cassandra Internals and Performance
Apache Cassandra in Bangalore - Cassandra Internals and Performanceaaronmorton
 

La actualidad más candente (20)

Cascadia.js: Don't Cross the Streams
Cascadia.js: Don't Cross the StreamsCascadia.js: Don't Cross the Streams
Cascadia.js: Don't Cross the Streams
 
Headless Js Testing
Headless Js TestingHeadless Js Testing
Headless Js Testing
 
Code Contracts In .Net
Code Contracts In .NetCode Contracts In .Net
Code Contracts In .Net
 
Best Practices in Qt Quick/QML - Part II
Best Practices in Qt Quick/QML - Part IIBest Practices in Qt Quick/QML - Part II
Best Practices in Qt Quick/QML - Part II
 
Reactive Access to MongoDB from Java 8
Reactive Access to MongoDB from Java 8Reactive Access to MongoDB from Java 8
Reactive Access to MongoDB from Java 8
 
bluespec talk
bluespec talkbluespec talk
bluespec talk
 
The Ring programming language version 1.9 book - Part 48 of 210
The Ring programming language version 1.9 book - Part 48 of 210The Ring programming language version 1.9 book - Part 48 of 210
The Ring programming language version 1.9 book - Part 48 of 210
 
Understanding Asynchronous JavaScript
Understanding Asynchronous JavaScriptUnderstanding Asynchronous JavaScript
Understanding Asynchronous JavaScript
 
Oojs 1.1
Oojs 1.1Oojs 1.1
Oojs 1.1
 
Groovy Api Tutorial
Groovy Api  TutorialGroovy Api  Tutorial
Groovy Api Tutorial
 
C#을 이용한 task 병렬화와 비동기 패턴
C#을 이용한 task 병렬화와 비동기 패턴C#을 이용한 task 병렬화와 비동기 패턴
C#을 이용한 task 병렬화와 비동기 패턴
 
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Wprowadzenie do technologii Big Data / Intro to Big Data EcosystemWprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
 
Node 관계형 데이터베이스_바인딩
Node 관계형 데이터베이스_바인딩Node 관계형 데이터베이스_바인딩
Node 관계형 데이터베이스_바인딩
 
From SQLAlchemy to Ming with TurboGears2
From SQLAlchemy to Ming with TurboGears2From SQLAlchemy to Ming with TurboGears2
From SQLAlchemy to Ming with TurboGears2
 
Javascript
JavascriptJavascript
Javascript
 
06 - Qt Communication
06 - Qt Communication06 - Qt Communication
06 - Qt Communication
 
Java Concurrency Gotchas
Java Concurrency GotchasJava Concurrency Gotchas
Java Concurrency Gotchas
 
Powerful JavaScript Tips and Best Practices
Powerful JavaScript Tips and Best PracticesPowerful JavaScript Tips and Best Practices
Powerful JavaScript Tips and Best Practices
 
Apache Cassandra in Bangalore - Cassandra Internals and Performance
Apache Cassandra in Bangalore - Cassandra Internals and PerformanceApache Cassandra in Bangalore - Cassandra Internals and Performance
Apache Cassandra in Bangalore - Cassandra Internals and Performance
 
02 - Basics of Qt
02 - Basics of Qt02 - Basics of Qt
02 - Basics of Qt
 

Similar a Qtp+real time+test+script

Esoteric, Obfuscated, Artistic Programming in Ruby
Esoteric, Obfuscated, Artistic Programming in RubyEsoteric, Obfuscated, Artistic Programming in Ruby
Esoteric, Obfuscated, Artistic Programming in Rubymametter
 
Ruby on Rails testing with Rspec
Ruby on Rails testing with RspecRuby on Rails testing with Rspec
Ruby on Rails testing with RspecBunlong Van
 
Антипаттерны модульного тестирования
Антипаттерны модульного тестированияАнтипаттерны модульного тестирования
Антипаттерны модульного тестированияMitinPavel
 
An Introduction to Windows PowerShell
An Introduction to Windows PowerShellAn Introduction to Windows PowerShell
An Introduction to Windows PowerShellDale Lane
 
Cooking Up Drama - ChefConf 2015
Cooking Up Drama - ChefConf 2015 Cooking Up Drama - ChefConf 2015
Cooking Up Drama - ChefConf 2015 Chef
 
Beeline Firebase talk - Firebase event Jun 2017
Beeline Firebase talk - Firebase event Jun 2017Beeline Firebase talk - Firebase event Jun 2017
Beeline Firebase talk - Firebase event Jun 2017Chetan Padia
 
The Wonderful World of Apache Kafka
The Wonderful World of Apache KafkaThe Wonderful World of Apache Kafka
The Wonderful World of Apache KafkaHostedbyConfluent
 
Buenos Aires Drools Expert Presentation
Buenos Aires Drools Expert PresentationBuenos Aires Drools Expert Presentation
Buenos Aires Drools Expert PresentationMark Proctor
 
Data Wars: The Bloody Enterprise strikes back
Data Wars: The Bloody Enterprise strikes backData Wars: The Bloody Enterprise strikes back
Data Wars: The Bloody Enterprise strikes backVictor_Cr
 
2600Hz - Tuning Kazoo to 10,000 Handsets - KazooCon 2015
2600Hz - Tuning Kazoo to 10,000 Handsets - KazooCon 20152600Hz - Tuning Kazoo to 10,000 Handsets - KazooCon 2015
2600Hz - Tuning Kazoo to 10,000 Handsets - KazooCon 20152600Hz
 
How to ship customer value faster with step functions
How to ship customer value faster with step functionsHow to ship customer value faster with step functions
How to ship customer value faster with step functionsYan Cui
 
Real howto vbs
Real howto vbsReal howto vbs
Real howto vbsChris x-MS
 
DIWE - Programming with JavaScript
DIWE - Programming with JavaScriptDIWE - Programming with JavaScript
DIWE - Programming with JavaScriptRasan Samarasinghe
 
Answer main.cpp.pdf
Answer main.cpp.pdfAnswer main.cpp.pdf
Answer main.cpp.pdfvichu19891
 

Similar a Qtp+real time+test+script (20)

Esoteric, Obfuscated, Artistic Programming in Ruby
Esoteric, Obfuscated, Artistic Programming in RubyEsoteric, Obfuscated, Artistic Programming in Ruby
Esoteric, Obfuscated, Artistic Programming in Ruby
 
Ruby on Rails testing with Rspec
Ruby on Rails testing with RspecRuby on Rails testing with Rspec
Ruby on Rails testing with Rspec
 
Run Node Run
Run Node RunRun Node Run
Run Node Run
 
Антипаттерны модульного тестирования
Антипаттерны модульного тестированияАнтипаттерны модульного тестирования
Антипаттерны модульного тестирования
 
Postman On Steroids
Postman On SteroidsPostman On Steroids
Postman On Steroids
 
An Introduction to Windows PowerShell
An Introduction to Windows PowerShellAn Introduction to Windows PowerShell
An Introduction to Windows PowerShell
 
Cooking Up Drama
Cooking Up DramaCooking Up Drama
Cooking Up Drama
 
Cooking Up Drama - ChefConf 2015
Cooking Up Drama - ChefConf 2015 Cooking Up Drama - ChefConf 2015
Cooking Up Drama - ChefConf 2015
 
Beeline Firebase talk - Firebase event Jun 2017
Beeline Firebase talk - Firebase event Jun 2017Beeline Firebase talk - Firebase event Jun 2017
Beeline Firebase talk - Firebase event Jun 2017
 
The Wonderful World of Apache Kafka
The Wonderful World of Apache KafkaThe Wonderful World of Apache Kafka
The Wonderful World of Apache Kafka
 
JBoss World 2011 - Drools
JBoss World 2011 - DroolsJBoss World 2011 - Drools
JBoss World 2011 - Drools
 
Buenos Aires Drools Expert Presentation
Buenos Aires Drools Expert PresentationBuenos Aires Drools Expert Presentation
Buenos Aires Drools Expert Presentation
 
Data Wars: The Bloody Enterprise strikes back
Data Wars: The Bloody Enterprise strikes backData Wars: The Bloody Enterprise strikes back
Data Wars: The Bloody Enterprise strikes back
 
2600Hz - Tuning Kazoo to 10,000 Handsets - KazooCon 2015
2600Hz - Tuning Kazoo to 10,000 Handsets - KazooCon 20152600Hz - Tuning Kazoo to 10,000 Handsets - KazooCon 2015
2600Hz - Tuning Kazoo to 10,000 Handsets - KazooCon 2015
 
How to ship customer value faster with step functions
How to ship customer value faster with step functionsHow to ship customer value faster with step functions
How to ship customer value faster with step functions
 
MongoDB
MongoDBMongoDB
MongoDB
 
Howto ghf
Howto ghfHowto ghf
Howto ghf
 
Real howto vbs
Real howto vbsReal howto vbs
Real howto vbs
 
DIWE - Programming with JavaScript
DIWE - Programming with JavaScriptDIWE - Programming with JavaScript
DIWE - Programming with JavaScript
 
Answer main.cpp.pdf
Answer main.cpp.pdfAnswer main.cpp.pdf
Answer main.cpp.pdf
 

Más de Ramu Palanki

Qtp sample certification questions and answers
Qtp sample certification questions and answersQtp sample certification questions and answers
Qtp sample certification questions and answersRamu Palanki
 
Qtp questions and answers
Qtp questions and answersQtp questions and answers
Qtp questions and answersRamu Palanki
 
Qtp material for beginners
Qtp material for beginnersQtp material for beginners
Qtp material for beginnersRamu Palanki
 
Qtp interview questions
Qtp interview questionsQtp interview questions
Qtp interview questionsRamu Palanki
 
Qtp interview questions and answers
Qtp interview questions and answersQtp interview questions and answers
Qtp interview questions and answersRamu Palanki
 
Qtp interview questions3
Qtp interview questions3Qtp interview questions3
Qtp interview questions3Ramu Palanki
 
Qtp complete guide for all
Qtp complete guide for allQtp complete guide for all
Qtp complete guide for allRamu Palanki
 
Qtp compare two xml files
Qtp compare two xml filesQtp compare two xml files
Qtp compare two xml filesRamu Palanki
 
Qtp change excel cell color with condition
Qtp change excel cell color with conditionQtp change excel cell color with condition
Qtp change excel cell color with conditionRamu Palanki
 
Qtp certification questions
Qtp certification questionsQtp certification questions
Qtp certification questionsRamu Palanki
 
Qtp certification questions and tutorial
Qtp certification questions and tutorialQtp certification questions and tutorial
Qtp certification questions and tutorialRamu Palanki
 
Qtp certification questions2
Qtp certification questions2Qtp certification questions2
Qtp certification questions2Ramu Palanki
 
Qtp automation estimation techniques
Qtp automation estimation techniquesQtp automation estimation techniques
Qtp automation estimation techniquesRamu Palanki
 
Qtp 11 new enhacements in
Qtp 11 new enhacements inQtp 11 new enhacements in
Qtp 11 new enhacements inRamu Palanki
 
Qtp passing parameters between actions
Qtp passing parameters between actionsQtp passing parameters between actions
Qtp passing parameters between actionsRamu Palanki
 
Qtp wsh scripts examples
Qtp wsh scripts examplesQtp wsh scripts examples
Qtp wsh scripts examplesRamu Palanki
 

Más de Ramu Palanki (20)

Qtp sample certification questions and answers
Qtp sample certification questions and answersQtp sample certification questions and answers
Qtp sample certification questions and answers
 
Qtp questions and answers
Qtp questions and answersQtp questions and answers
Qtp questions and answers
 
Qtp presentation
Qtp presentationQtp presentation
Qtp presentation
 
Qtp material for beginners
Qtp material for beginnersQtp material for beginners
Qtp material for beginners
 
Qtp interview questions
Qtp interview questionsQtp interview questions
Qtp interview questions
 
Qtp interview questions and answers
Qtp interview questions and answersQtp interview questions and answers
Qtp interview questions and answers
 
Qtp interview questions3
Qtp interview questions3Qtp interview questions3
Qtp interview questions3
 
Qtp complete guide for all
Qtp complete guide for allQtp complete guide for all
Qtp complete guide for all
 
Qtp compare two xml files
Qtp compare two xml filesQtp compare two xml files
Qtp compare two xml files
 
Qtp change excel cell color with condition
Qtp change excel cell color with conditionQtp change excel cell color with condition
Qtp change excel cell color with condition
 
Qtp certification questions
Qtp certification questionsQtp certification questions
Qtp certification questions
 
Qtp certification questions and tutorial
Qtp certification questions and tutorialQtp certification questions and tutorial
Qtp certification questions and tutorial
 
Qtp certification questions2
Qtp certification questions2Qtp certification questions2
Qtp certification questions2
 
Qtp best tutorial
Qtp best tutorialQtp best tutorial
Qtp best tutorial
 
Qtp basic stuff
Qtp basic stuffQtp basic stuff
Qtp basic stuff
 
Qtp automation estimation techniques
Qtp automation estimation techniquesQtp automation estimation techniques
Qtp automation estimation techniques
 
Qtp 11 new enhacements in
Qtp 11 new enhacements inQtp 11 new enhacements in
Qtp 11 new enhacements in
 
Qtp sample resume
Qtp sample resumeQtp sample resume
Qtp sample resume
 
Qtp passing parameters between actions
Qtp passing parameters between actionsQtp passing parameters between actions
Qtp passing parameters between actions
 
Qtp wsh scripts examples
Qtp wsh scripts examplesQtp wsh scripts examples
Qtp wsh scripts examples
 

Qtp+real time+test+script

  • 1. For more QTP Real time scripts, visit www.ramupalanki.com QTP Scripts ######################################################## ######################################################## #################### '### Test Name: 2Step_1orMoreAcres_Attribute_145_100orMoreAcres '# ## Created by: Sam Harris '### Purpose: Verify the 145 Lot Size is 100 or More Acres atttribute in the 1 or More Acres Scenario '### Creation Date: 1/11/2010 www.ramupalanki.com
  • 2. For more QTP Real time scripts, visit www.ramupalanki.com '####################################################### ######################################################## ##################### '======================= ' SETUP '======================= '_______________________________________________________________________ _____________________________________________________________ Dim objNet Dim strInfo '_______________________________________________________________________ _____________________________________________________________ 'Set the initial value of the variables i=1 msgnum = 0 strFail = 1 strTestName = "2Step_1orMoreAcres_Attribute_145_100orMoreAcres" '_______________________________________________________________________ _____________________________________________________________ 'Function to open a brower and go to a specified URL Function OpenBrowser (browser, URL) systemUtil.Run browser, URL End Function '_______________________________________________________________________ _____________________________________________________________ 'Get Computer Name set wshnetwork=createobject("wscript.network") www.ramupalanki.com
  • 3. For more QTP Real time scripts, visit www.ramupalanki.com scomputername=wshnetwork.computername set wshnetwork=nothing strServ = scomputername 'msgbox strServ '_______________________________________________________________________ _____________________________________________________________ 'Turn off the report filter CurrentMode = Reporter.Filter Reporter.Filter = rfDisableAll '_______________________________________________________________________ _____________________________________________________________ 'Get username from the local box Set objNet = CreateObject("WScript.NetWork") strInfo = objNet.UserName 'msgbox strInfo '_______________________________________________________________________ _____________________________________________________________ 'Create a unique name for the results file each time the test is executed. mypath = "taz02mon901MercuryQTP_Test_Results2Step_1orMoreAcres_Attribute_145_100orMo reAcres.html" Call CreateFiles() '_______________________________________________________________________ _____________________________________________________________ ' Set Excel File to be appenced strDataSheet = "taz02mon901MercuryMercury_QTP_TestRealtor2- Step2STEP_ATTRIBUTES_FAILURE_LOG_QA.xls" '_______________________________________________________________________ _____________________________________________________________ www.ramupalanki.com
  • 4. For more QTP Real time scripts, visit www.ramupalanki.com 'Clear the cookies and temp files 'Call ClearCookies '_______________________________________________________________________ _____________________________________________________________ '======================= ' MAIN '======================= '_______________________________________________________________________ _____________________________________________________________ 'Database query ' Connect to the Realtor database Set dbconn = CreateObject("ADODB.Connection") Set recordset = CreateObject("ADODB.recordset") 'MS SQL Server DSNless connection 'dbconn.Open("Driver={SQL Server};Server=TAZ02SQL832 ;Database=XProperty ;Uid=admin;Pwd=admin") dbconn.Open("Driver={SQL Server};Server=TAZ02SQL832;Database=XProperty") dbconn.commandTimeout = 300 ' Specify the query sql = "select top 1 l.listingid,l.postalcode,l.marketingtypeid,l.listingtypeid,l.bedrooms,l.bathrooms,l.listingsqft, l.price,l.address,l.city,l.state,l.createdate,l.geoapproximation from xproperty.dbo.listing (nolock) l join xproperty.dbo.LISTING_ATTRIBUTE (nolock) la1 on l.listingid = la1.listingid left join xproperty.dbo.LISTING_ATTRIBUTE (nolock) la2 on l.listingid = la2.listingid and la2.attributeid in (144,146,147,150,152,154,159,161,166) where l.status = 'a' and l.agentid is not null and l.postalcode is not null and l.postalcode <> '' and l.country = 'usa' and la1.attributeid = 145 and l.geoapproximation = 1 and l.DataSourceID not in (select datasourceid from xproperty.dbo.DATA_SOURCE_ATTRIBUTE where attributeid in (27,31)) and la2.ListingID is null and l.createdate < getdate() - 2 order by l.createdate desc" ' Set the recordset cursor type www.ramupalanki.com
  • 5. For more QTP Real time scripts, visit www.ramupalanki.com recordset.CursorType = 0 ' Execute the query recordset.Open sql, dbconn listingid = recordset.Fields("listingid")&"" listingid = Trim(listingid)' 'msgbox listingid postalcode = recordset.Fields("postalcode")&"" 'msgbox postalcode marketingtypeid = recordset.Fields("marketingtypeid")&"" 'msgbox marketingtypeid listingtypeid = recordset.Fields("listingtypeid")&"" 'msgbox listingtypeid bedrooms = recordset.Fields("bedrooms")&"" 'msgbox bedrooms bathrooms = recordset.Fields("bathrooms")&"" 'msgbox bathrooms listingsqft = recordset.Fields("listingsqft")&"" 'msgbox listingsqft price = recordset.Fields("price")&"" 'msgbox price address = recordset.Fields("address")&"" 'msgbox address city = recordset.Fields("city")&"" 'msgbox city www.ramupalanki.com
  • 6. For more QTP Real time scripts, visit www.ramupalanki.com state = recordset.Fields("state")&"" 'msgbox state createdate = recordset.Fields("createdate")&"" 'msgbox createdate If bedrooms = "" Then 'Do Nothing Else If bedrooms >5 Then bedrooms = 5 End If End If bathrooms = fix(bathrooms) If bathrooms = "" Then 'Do Nothing Else If bedrooms >5 Then bedrooms = 5 End If End If If listingtypeid = 6 Then bedrooms = "" bathrooms = "" End If '_______________________________________________________________________ _____________________________________________________________ www.ramupalanki.com
  • 7. For more QTP Real time scripts, visit www.ramupalanki.com ' Date and Start Time of the test run strDate = date strStartTime = time '_______________________________________________________________________ _____________________________________________________________ 'Open a browser to the REALTOR.com homepage OpenBrowser "iexplore.exe", "http://qap.www.realtor.com/" wait (3) '_______________________________________________________________________ _____________________________________________________________ 'Find the listing 'Browser("Real Estate Listings,").WinEdit("Edit").Check CheckPoint("Edit_8") Browser("Real Estate Listings,").Navigate ("http://qap.www.realtor.com/prop/"&listingid) Browser("Real Estate Listings,").Sync strView = "LDP" '_______________________________________________________________________ _____________________________________________________________ 'Check for the text office on the LDP 'Browser("Real Estate Listings,_5").Page("2275 Youngman Ave Unit:").WebElement("Property Information for").Check CheckPoint("Property Information for 2275 Youngman Ave Unit: 108W Save Listing Property FeaturesCondo/Townhome/Row Home/Co-OpStatus: Active Area: SP-Highland Area County: RAMSEYYear Built: 1980 1 total bedroom(s) 2 total bath(s) Approximately 1130 sq. ft.Style: High Rise (4+ Levels) Office 1 car garage School District: St. Paul Exterior FeaturesHeated garage Listing InformationRefreshed at 9:35 AM PT (19 days ago)Added on Jun 29, 2004 (1940 days ago) To access this page directly, usehttp://qap.www.realtor.com/realestateandhomes- detail/2275-Youngman-Ave-Unit-108W_St-Paul_MN_55116_1038274619 This listing is brokered byEdina Realty, Inc.Office: (651)698-2434") strPropInfo = Browser("Real Estate Listings,_5").Page("2275 Youngman Ave Unit:").WebElement("Property Information for").GetROProperty("innertext") 'msgbox strPropInfo www.ramupalanki.com
  • 8. For more QTP Real time scripts, visit www.ramupalanki.com strGarageCheck = Instr(strPropInfo, "Lot size is 100 or more acres") 'msgbox strGarageCheck If strGarageCheck <> 0 Then 'msgbox "Pass" Else 'msgbox "Fail" strEndTime = time Call AppendXL msgnum = msgnum+1 Browser("Real Estate Listings,_5").Page("2275 Youngman Ave Unit:").Sync Browser("Real Estate Listings,_5").Close Call SendMail ExitTest End If '_______________________________________________________________________ _____________________________________________________________ 'Close the browser Browser("Real Estate Listings,_5").Page("2275 Youngman Ave Unit:").Sync Browser("Real Estate Listings,_5").Close '_______________________________________________________________________ _____________________________________________________________ 'Open a browser to the REALTOR.com homepage OpenBrowser "iexplore.exe", "http://qap.www.realtor.com/" wait (3) '_______________________________________________________________________ ____________________________________________________________ www.ramupalanki.com
  • 9. For more QTP Real time scripts, visit www.ramupalanki.com Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebEdit("srchHomeLocation").Set postalcode Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebRadioGroup("ctl00$cphC$MainSearch$ccBuyRen").Select marketingtypeid Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebElement("More Search Options").FireEvent "onmouseover" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebElement("More Search Options").Click Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebEdit("tbMinPrice").Set price Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebEdit("tbMaxPrice").Set price Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebList("ctl00$cphC$AdvancedSearchPage$_2").Select bedrooms&"+" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebList("ctl00$cphC$AdvancedSearchPage$_3").Select bathrooms&"+" If marketingtypeid = 2 Then 'Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebElement("WebElement").FireEvent "onmouseover" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebRadioGroup("ctl00$cphC$AdvancedSearchPage$").FireEvent "onmouseover" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebRadioGroup("ctl00$cphC$AdvancedSearchPage$").Select "2" wait (3) End If If listingtypeid = 1 Then Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$").Set "ON" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_2").Set "OFF" www.ramupalanki.com
  • 10. For more QTP Real time scripts, visit www.ramupalanki.com Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_4").Set "OFF" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_5").Set "OFF" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_6").Set "OFF" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_7").Set "OFF" ElseIf listingtypeid = 2 Then Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$").Set "OFF" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_2").Set "ON" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_4").Set "OFF" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_5").Set "OFF" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_6").Set "OFF" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_7").Set "OFF" ElseIf listingtypeid = 4 Then Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$").Set "OFF" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_2").Set "OFF" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_4").Set "ON" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_5").Set "OFF" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_6").Set "OFF" www.ramupalanki.com
  • 11. For more QTP Real time scripts, visit www.ramupalanki.com Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_7").Set "OFF" ElseIf listingtypeid = 3 Then Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$").Set "OFF" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_2").Set "OFF" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_4").Set "OFF" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_5").Set "ON" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_6").Set "OFF" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_7").Set "OFF" ElseIf listingtypeid = 5 Then Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$").Set "OFF" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_2").Set "OFF" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_4").Set "OFF" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_5").Set "OFF" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_6").Set "ON" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_7").Set "OFF" ElseIf listingtypeid = 6 Then Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$").Set "OFF" www.ramupalanki.com
  • 12. For more QTP Real time scripts, visit www.ramupalanki.com Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_2").Set "OFF" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_4").Set "OFF" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_5").Set "OFF" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_6").Set "OFF" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebCheckBox("ctl00$cphC$AdvancedSearchPage$_7").Set "ON" End If Browser("Real Estate Listings,").Page("Real Estate Listings,_3").Link("Lot & Community").FireEvent "onmouseover" Browser("Real Estate Listings,").Page("Real Estate Listings,_3").Link("Lot & Community").Click Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebList("ctl00$cphC$AdvancedSearchPage$_5").FireEvent "onmouseover" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebList("ctl00$cphC$AdvancedSearchPage$_5").Click Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebList("ctl00$cphC$AdvancedSearchPage$_5").Select "1 or More Acres" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").Link("Search").Click Browser("Real Estate Listings,_5").Sync '_______________________________________________________________________ ____________________________________________________________ 'Select Listview Browser("Real Estate Listings,_5").Page("55116 real estate & 55116").WebElement("WebElement_2").Click strView = "List" Set odesc=description.Create() odesc("micclass").value="WebElement" www.ramupalanki.com
  • 13. For more QTP Real time scripts, visit www.ramupalanki.com odesc("html tag").value="DIV" odesc("class").value="listingData" Set childObjs= Browser("Real Estate Listings,").Page("55116 real estate & 55116").ChildObjects(odesc) strResults = childObjs.count 'msgbox strResults If strResults <> 0 Then Call Listcheck Else strFail = 1 End If If strFail= 0 Then 'Do Nothing Else strEndTime = time Call AppendXL msgnum = msgnum+1 End If '_______________________________________________________________________ ____________________________________________________________ 'Select Galleryview Browser("Real Estate Listings,_5").Page("55116 real estate & 55116").WebElement("WebElement_4").Click strView = "Gallery" Set odesc=description.Create() odesc("micclass").value="WebElement" www.ramupalanki.com
  • 14. For more QTP Real time scripts, visit www.ramupalanki.com odesc("html tag").value="DIV" odesc("class").value="listingData" Set childObjs= Browser("Real Estate Listings,").Page("55116 real estate & 55116").ChildObjects(odesc) strResults = childObjs.count 'msgbox strResults If strResults <> 0 Then Call Gallerycheck Else strFail = 1 End If If strFail= 0 Then 'Do Nothing Else strEndTime = time Call AppendXL msgnum = msgnum+1 End If '_______________________________________________________________________ ____________________________________________________________ 'Select Mapview Browser("Real Estate Listings,").Page("55116 real estate & 55116").Image("REALTOR.com® - Official").Click Browser("Real Estate Listings,").Sync Browser("Real Estate Listings,").Page("Real Estate Listings,_3").WebElement("More Search Options").Click If marketingtypeid = 2 Then www.ramupalanki.com
  • 15. For more QTP Real time scripts, visit www.ramupalanki.com 'Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebElement("WebElement").FireEvent "onmouseover" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebRadioGroup("ctl00$cphC$AdvancedSearchPage$").FireEvent "onmouseover" Browser("Real Estate Listings,_5").Page("Real Estate Listings,").WebRadioGroup("ctl00$cphC$AdvancedSearchPage$").Select "2" wait (3) End If Browser("Real Estate Listings,").Page("Real Estate Listings,_3").Link("Display Options").Click Browser("Real Estate Listings,").Page("Real Estate Listings,_3").WebRadioGroup("ccViewResults").Select "map" Browser("Real Estate Listings,").Page("Real Estate Listings,_3").Link("Search").Click Browser("Real Estate Listings,").Sync wait (10) strView = "Map" 'Browser("Real Estate Listings,").Page("55116 real estate & 55116").WebElement("WebElement_3").Check CheckPoint("WebElement_2") Set odesc=description.Create() odesc("micclass").value="WebElement" odesc("html tag").value="DIV" odesc("class").value="listingData" Set childObjs= Browser("Real Estate Listings,").Page("55116 real estate & 55116").ChildObjects(odesc) strResults = childObjs.count 'msgbox strResults If strResults <> 0 Then Call Mapcheck www.ramupalanki.com
  • 16. For more QTP Real time scripts, visit www.ramupalanki.com Else strFail = 1 End If If strFail= 0 Then 'Do Nothing Else strEndTime = time Call AppendXL msgnum = msgnum+1 End If '_______________________________________________________________________ _____________________________________________________________ 'Close the browser Browser("Real Estate Listings,_5").Page("2275 Youngman Ave Unit:").Sync Browser("Real Estate Listings,_5").Close '_______________________________________________________________________ _____________________________________________________________ If msgnum = 0 Then intRunStatusID = 1 else intRunStatusID = 0 End If '_______________________________________________________________________ _____________________________________________________________ 'Test Run End Time strEndTime = time www.ramupalanki.com
  • 17. For more QTP Real time scripts, visit www.ramupalanki.com '_______________________________________________________________________ _____________________________________________________________ 'Call UpdateRun '_______________________________________________________________________ _____________________________________________________________ 'Determine which email sub to use based on Pass or Fail If intRunStatusID = 1 Then Call SendMail else Call SendMail End If www.ramupalanki.com