Whats wrong in this Descriptive Program?
This was the test that is coded using Descriptive Programming (DP) techniques. I couldn't solve the problem when I was learning QTP. It is reopened today and the problem still persists.:mad:
[QUOTE]with window("text:=Flight Reservation")
.activate
.activeX("acx_name:=MaskEdBox").type "070707"
.wincombobox("attached text:=Fly From:").Select "Denver"
.wincombobox("attached text:=Fly To:").Select "London"
.winbutton("text:=FLIGHT").click
[COLOR="Red"].dialog("text:=Flights Table").winlist("attached text:=From", "Window ID:=2001").selectrange 0[/COLOR]
.dialog("text:=Flights Table").winbutton("text:=OK").click
.winedit("attached text:=Name:").set "SutNarCha"
.winbutton("text:=Insert Order").click
end with[/QUOTE]
This test runs fine until that colored statement. It gets stuck there and the error message says “The operation can not be performed”.:confused:
All its argument values are written after applying “Object Spy” on the respective objects.:cool:
Please help solve this problem.
Re: Whats wrong in this Descriptive Program?
Hi ,
can you send the script with out the "with" method?
i think some objects are missing.
Yan.
Re: Whats wrong in this Descriptive Program?
Hi,
Your script needs some more descriptions & modifications.
[U]Here is the right script:[/U]
with window("text:=Flight Reservation")
.activate
.activeX("acx_name:=MaskEdBox").type "070707"
.wincombobox("attached text:=Fly From:").Select "Denver"
.wincombobox("attached text:=Fly To:").Select "London"
.winbutton("text:=FLIGHT").click
.dialog("text:=Flights Table").winlist("attached text:=From", "Window ID:=2001").select 1
.dialog("text:=Flights Table").winbutton("text:=OK").click
.winedit("nativeclass:=Edit", "attached text:=Name:").set "SutNarCha"
.winbutton("text:=&Insert Order").click
end with
Re: Whats wrong in this Descriptive Program?
why were u using "[COLOR=Red]selectrange 0[COLOR=Black]". Did not make any sense to me.[/COLOR]
[/COLOR]
Re: Whats wrong in this Descriptive Program?
[U][COLOR="Blue"]Here is the right script:[/COLOR][/U]
with window("text:=Flight Reservation")
.activate
.activeX("acx_name:=MaskEdBox").type "070707"
.wincombobox("attached text:=Fly From:").Select "Denver"
.wincombobox("attached text:=Fly To:").Select "London"
.winbutton("text:=FLIGHT").click
.dialog("text:=Flights Table").winlist("attached text:=From", "Window ID:=2001").[COLOR="red"]select [/COLOR]0
.dialog("text:=Flights Table").winbutton("text:=OK").click
.winedit("[COLOR="red"]nativeclass:=Edit[/COLOR]", "attached text:=Name:").set "SutNarCha"
.winbutton("text:=[COLOR="Red"]&[/COLOR]Insert Order").click
end with
Re: Whats wrong in this Descriptive Program?
try using window("text:=Flight Reservation").dialog("text:=Flights Table").activate
after pressing the 'FLIGHT' button..
Re: Whats wrong in this Descriptive Program?
Please use [B]Select[/B] function instead of [B]selectrange[/B]
Re: Whats wrong in this Descriptive Program?
You can try for this script, u will get it
This script is for inserting a order and know the order no.
Dim a
Window("text:=Flight Reservation").Activate
Window("text:=Flight Reservation").WinObject("attached text:=Date of Flight:","window id:=0").type "10/10/07"
Window("text:=Flight Reservation").WinComboBox("attached text:=Fly From:").select"London"
Window("text:=Flight Reservation").WinComboBox("attached text:=Fly To:").select"Los Angeles"
Window("text:=Flight Reservation").WinButton("text:=FLIGHT").Click
Dialog("text:=Flights Table").Activate
Dialog("text:=Flights Table").WinList("attached text:=From","window id:=2001").select"19095 LON 10:24 AM LAX 01:54 PM AF $173.47"
Dialog("text:=Flights Table").WinButton("text:=OK").click
Window("text:=Flight Reservation").WinEdit("attached text:=Name:","window id:=1014").set"rajaputra"
Window("text:=Flight Reservation").WinRadioButton("text:=Business").click
Window("text:=Flight Reservation").WinEdit("attached text:=Tickets:","window id:=1029").set"2"
Window("text:=Flight Reservation").WinButton("text:=&Insert Order").click
wait(10)
a=Window("text:=Flight Reservation").WinEdit("attached text:=Order No:").GetROProperty("text")
msgbox "ThankYou. Your Order No - "&a