Getting Object is disabled when I try to run my script for flight application ... using QTP 11.0

26 views
Skip to first unread message

Kusum Bharti

unread,
May 13, 2014, 7:25:26 AM5/13/14
to mercu...@googlegroups.com
Option Explicit
Dim vPath, vApp, vSheet, vOrder, vRow, vName
vPath = "C:\Users\AA83986\Desktop\FlightDDF.xlsx"
Set vApp = CreateObject("Excel.Application")
vApp.Workbooks.Open vPath
Set vSheet = vApp.ActiveWorkbook.Worksheets("Sheet1")
vRow = 2
SystemUtil.Run "C:\Program Files (x86)\HP\QuickTest Professional\samples\flight\app\flight4a.exe"
Dialog("Login").WinEdit("Agent Name:").Set "Guru"
Dialog("Login").WinEdit("Agent Name:").Type  micTab
Dialog("Login").WinEdit("Password:").Set "mercury"
Dialog("Login").WinButton("OK").Click

Do while vSheet.Cells(vRow, 1) <> ""
vOrder = vSheet.Cells(vRow, 1)
       Window("Flight Reservation").WinButton("Button_4").Click
Dialog("Open Order").WinCheckBox("Order No.").Click    ------------------------------------ Here Set "ON" isn't working so changed it to Click
Dialog("Open Order").WinEdit("Edit").Set "2"   ----------------------------------------------- Here Set vOrder isn't working ... getting object is disabled error.. please help
Dialog("Open Order").WinButton("OK").Click

vName = Window("Flight Reservation").WinEdit("window id:=1016").GetROProperty("text")
vSheet.Cells(vRow, 2) = vName
vApp.ActiveWorkbook.Save
vRow = vRow + 1
Loop

vApp.ActiveWorkbook.Close
vApp.Application.Quit
Set vApp = nothing
Set vSheet = nothing

Excel File is attached.
FlightDDF.xlsx
Reply all
Reply to author
Forward
0 new messages