Wednesday, December 3, 2008

Capture the Screen shot during runtime

''''''''''''''''''''''Capture the Screen Shot when Error Is Occured'''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''Using Objects'''''''''''''''''''''''''''''''''''''''''''''''''
Systemutil.run"C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe"
Set Dlg= Dialog("text:=Login")
Set wnd=Window("text:=Flight Reservation")
Set oDlg=wnd.Dialog("text:=Open Order")

Dlg.WinEdit("attached text:=Agent Name:").set "rajaputra"
Dlg.WinEdit("attached text:=Password:").setsecure"mercury"
Dlg.WinButton("text:=OK").click

wait(7)

wnd.Activate
wnd.WinButton("window id:=5").click
oDlg.WinCheckBox("text:=&Order No.").set "ON"
oDlg.WinEdit("window id:=1016").set "55"
oDlg.WinButton("text:=OK").click

if(oDlg.Dialog("text:=Flight Reservations").Exist) then
oDlg.Dialog("text:=Flight Reservations").CaptureBitmap"c:\snapshot1.bmp"
oDlg.Dialog("text:=Flight Reservations").WinButton("text:=OK").click
oDlg.WinButton("text:=Cancel").click
end if

wnd.Close

No comments:

About Me

My photo
Hi all,I am Arun Singh Rajaputra. I am working as a Project Lead in a reputed organization in Hyderabad, AP, India. I have little bit knowledge on Quick Test Professional and like to share my knowledge to all through this blog.

Subscribe to get updates on this blog

Enter your email address:

NOTE

Some of the posts posted in this blog are collected and most of them have been prepared by me. If any one have objections regarding any copied posts. Please mail me so that I can take a necessary action on that post.