17 Dec 2012

Can QTP Talk?

Can QTP Talk?

Yes, QTP can now talk...isn't that funny?

See how can we let this happen

Run the below code from the QTP

Set oVoice = CreateObject("sapi.spvoice")

SystemUtil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe"

Dialog("Text:=Login").WinEdit("Attached text:=Agent Name:").set "Agent1"

Dialog("Text:=Login").WinEdit("Attached text:=Password:").set "mercury"

Dialog("Text:=Login").WinButton("text:=OK").click

If Dialog("Text:=Flight Reservation").Exist Then

 oVoice.Speak "Agent1 was able to login successfully"

End If

Dialog("Text:=Flight Reservation").Close

Set oVoice = Nothing

No comments:

Post a Comment