On Thu, Oct 29, 2009 at 8:34 PM, Prasad Dev <[email protected]> wrote:
> Hi,
>
> User GetROProperty method to capture runtime property value of a test
> object.
> and compare it with the expected value.
>
> Example script is on flight application.
>
> 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 Thu, Oct 29, 2009 at 2:35 PM, veeru <[email protected]> wrote:
>
>>
>>
>>
>> Hi can u please give me the code how we can test whether the
>> checkpoint is passed or failed.
>>
>> And also please provide any websites where we can get qtp project
>> scripts.Please respond to my mail ASAP
>>
>>
>> Thanks & Regards
>>
>> Veeraswamy
>>
>> >>
>>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---