Wednesday, 8 April 2015

QTP ONLINE TRAINING:::SAMPLE SCRIPT FOR FAX-ORDER::::

QTP SAMPLE SCRIPT FOR FAX-ORDER::::

Option Explicit
On Error Resume Next
Dim
Set fileObj=CreateObject("Scripting.FileSystemObject")
Set filePtrObj=fileObj.OpenTextFile("D:\gk\test data\faxorder.txt",1,True)
Set filePtrObj1=fileObj.OpenTextFile("D:\gk\test
data\faxorderresults.txt",2,True)
While filePtrObj.AtEndOfStream="False"
        actTxt=filePtrObj.ReadLine
        actTxt=Split(actTxt," ")
        ordNum=actTxt(3)
        faxNum=actTxt(8)
        Set obj=Window("Flight Reservation")
        obj.Activate
        obj.Type micAltDwn+"f"+micAltUp
        obj.Type "o"
        If obj.Dialog("Open Order").Exist Then
                obj.Dialog("Open Order").Activate
                obj.Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
                obj.Dialog("Open Order").WinEdit("Edit_2").Set ordNum
                obj.Dialog("Open Order").WinButton("OK").Click
                If obj.Dialog("Open Order").Dialog("Flight Reservations").Exist(3) Then
                        obj.Dialog("Open Order").Dialog("Flight Reservations").WinButton("OK").Click
                        obj.Dialog("Open Order").WinButton("Cancel").Click
                        filePtrObj1.WriteLine ordNum&" order is not found in data base and
hence fax not sent"
                Else
                        obj.Activate
                        obj.Type micAltDwn+"f"+micAltUp
                        obj.Type "a"
                        If obj.Dialog("Fax Order No. 1").Exist Then
                                obj.Dialog("Fax Order No. 1").Activate
                                obj.Dialog("Fax Order No. 1").ActiveX("MaskEdBox").Type faxNum
                                obj.Dialog("Fax Order No. 1").WinButton("Send").Click
                                If obj.Dialog("Fax Order No. 1").Dialog("Flight Reservations").Exist(3) Then
                                        obj.Dialog("Fax Order No. 1").Dialog("Flight
Reservations").WinButton("OK").Click
                                        obj.Dialog("Fax Order No. 1").WinButton("Cancel").Click
                                        filePtrObj1.WriteLine faxNum&" fax number is invalid and hence
fax not sent for the order "&ordNum
                Else
                                        dlgExist=obj.Dialog("Fax Order No. 1").Exist
                                        While dlgExist= "True"
                                                        dlgExist=obj.Dialog("Fax Order No. 1").Exist(2)
                                        Wend
                                        faxMsg=obj.ActiveX("Threed Panel Control").GetROProperty("Text")
                                        If faxMsg="Fax Sent Successfully..." Then
                                                filePtrObj1.WriteLine "Fax sent for order number "&ordNum
                                        Else
                                                filePtrObj1.WriteLine "Fax not sent for order number "&ordNum
                                        End If
                                End If
                        Else
                                Reporter.ReportEvent micFail,"Verify fax order dialog exist","Fax
order dialog is not exist"
                        End If
                End If
        Else
                Reporter.ReportEvent micFail,"Verify Open Order dialog exist","Open
order dialog is not exist"
        End If
Wend


RELATED POSTS:::

what is the Difference between Verification & ValidationDifference?

When to Stop Testing?

Testing documentation?test plan, test scenario, test case, traceability matrix

Levels of testing? functional and non functional testing?

Testing Methods?

what are the AUTOMATION TOOLS?

what is automation testing? when to AUTOMATE?

what is QUALITY ASSURANCE and QUALITY CONTROL?

What is Difference between QA, QC and testing?

Qtp online training,qtp taining onlne,qtp interview questions and answers


No comments:

Post a Comment

Note: only a member of this blog may post a comment.