Friday, June 6, 2008

How to Capture the Screen Shot

By using the below script we can capture the screen shot at run time -

Browser("BrowserName").Page("PageName").captureBitmap "c:\test\ScreeShot1.bmp"

Below example will help you to get familiar with this-
'Prerequisite: Open the FlightReservation Login screen
'Then Run this Script

Set Dlg=Dialog("text:=Login")
set Wnd=Window("text:=Flight Reseravation")
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
oDlg.Dialog("text:=Flight Reservations").CaptureBitmap "C:\ScreenShot.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.