Hi,
I need help. During running a test, how can I capture a screen?
Can anyone give me instructions or code of how to capture screen during run-time?
Thanks
Printable View
Hi,
I need help. During running a test, how can I capture a screen?
Can anyone give me instructions or code of how to capture screen during run-time?
Thanks
Hi,
[COLOR="Blue"]you can use object.captureBitmap"ScreenShot.bmp"[/COLOR]
method to capture the screen shot at run time.
Below example will help you to get familiar with this.
'''Prerequisites: Open the FlightReservation Login screen.
''then runthis program
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 "100"
oDlg.WinButton("text:=OK").click
if(oDlg.Dialog("text:=Flight Reservations").Exist) then
[COLOR="Blue"]oDlg.Dialog("text:=Flight Reservations").CaptureBitmap"c:\snapshot1.bmp"[/COLOR]
oDlg.Dialog("text:=Flight Reservations").WinButton("text:=OK").click
oDlg.WinButton("text:=Cancel").click
end if
wnd.Close
____________
Regards,
Arun Singh Rajaputra