In real projects we GetRoProperty function to get the property of the
testobject at  runtime and check that property with the expected.

Eg given below:


On error resume next

Call login("Prasad","Mercury")

Call data_import("C:\testdata\Testdata_scenario1.xls","Sheet1","Action1")

window("Flight Reservation").ActiveX("MaskEdBox").Type
datatable.Value("Date","Action1")

window("Flight Reservation").WinComboBox("Fly From:").Select
datatable.Value("Flyfrom","Action1")

window("Flight Reservation").WinComboBox("Fly To:").Select
datatable.Value("Flyto","Action1")

window("Flight Reservation").WinButton("FLIGHT").Click

window("Flight Reservation").Dialog("Flights Table").WinList("From").Select
datatable.Value("Flight","Action1")

window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click

window("Flight Reservation").WinEdit("Name:").Set
datatable.Value("Name","Action1")

window("Flight Reservation").WinButton("Insert Order").Click

wait(6)

Dim check_insert

*check_insert=Window("Flight Reservation").ActiveX("Threed Panel
Control").GetROProperty("Text")*

*If check_insert ="Insert Done..." Then*

*            reporter.ReportEvent micPass,"insert successful",pass*

*End If*

dim order_No

order_No=window("Flight Reservation").WinEdit("Order
No:").GetROProperty("text",1000)

msgbox order_No

            datatable.GlobalSheet.AddParameter "Orderno"," "

            datatable.Value("Orderno","Global")=order_No

window("Flight Reservation").Close





Set objconn=createobject("ADODB.connection")

Set objRecord=createobject("ADODB.recordset")

strcommand="select count(*) as validate  from orders where order_number= "&
datatable.Value("Orderno","Global")

objconn.open "QT_flight32"

If objconn.state= 1 Then

            msgbox "connection successful"

End If

objRecord.open strcommand,objconn

While not  objRecord.EOF

                        Dim v_count

             v_count   =cint(objrecord("validate"))

                        objrecord.movenext

Wend



If v_count >= 1 Then

            reporter.ReportEvent micPass,"insert successfull","Pass"

End If

datatable.GlobalSheet.AddParameter "Scenario1","Pass"

Datatable.Export "C:\Result\Result_Test1.xls"

Set objconn=nothing

Set objRecord=nothing


On Tue, Oct 13, 2009 at 11:49 AM, pooja <[email protected]> wrote:

>
> Hi Friends,
>
> Do we really use checkpoints in QTP in Real Time Projects.
> If really please tell me which checkpoints we use.
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to