''''''''''''''' Discriptive Program for starting from Logging in - Opening a order and closing the Flight Reservation Application'''''''''''''
''''''''''''''Importing the Excel sheet into datatable and Exporting the Datatable into Excel file''''''''''''''''''''''''''''''''''''''''
systemutil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe"
Dialog("text:=Login").Activate
Dialog("text:=Login").WinEdit("attached text:=Agent Name:").set "rajaputra"
Dialog("text:=Login").WinEdit("attached text:=Password:").set "mercury"
Dialog("text:=Login").WinButton("text:=OK").click
wait(5)
Window("text:=Flight Reservation").Activate
datatable.Importsheet "c:/orders.xls",1,1' 1st sheet will be imported into the 1st sheet in runtime datatable
rowcount=datatable.GetRowCount
'msgbox rowcount
For i=1 to rowcount
Window("text:=Flight Reservation").WinButton("window id:=5").click
Dialog("text:=Open Order").Activate
Dialog("text:=Open Order").WinCheckBox("text:=&Order No.").set "ON"
datatable.SetCurrentRow(i)
n=datatable(1,1) '1st column 1st sheet
Dialog("text:=Open Order").WinEdit("window id:=1016").set n
Dialog("text:=Open Order").WinButton("text:=OK").click
If(window("text:=Flight Reservation").Dialog("text:=Open Order").Dialog("text:=Flight Reservations").exist)then
window("text:=Flight Reservation").Dialog("text:=Open Order").Dialog("text:=Flight Reservations").WinButton("text:=OK").click
window("text:=Flight Reservation").Dialog("text:=Open Order").WinButton("text:=Cancel").click
datatable(2,1)="Not Exist"'2nd column 1st sheet
Else
datatable(2,1)="Exist" '2nd column 1st sheet
end if
Next
DataTable.Exportsheet"C:\flight.xls",1'1st sheet of the runtime datatable will be exported at last sheet in flight.xls
Window("text:=Flight Reservation").Close
Important Topics & Useful Scripts on QTP. Ask your QTP related questions at this id - asrajaputra@gmail.com
Subscribe to:
Post Comments (Atom)
About Me
- RAJAPUTRA
- 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
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.
No comments:
Post a Comment