Geeks Talk

Prepare for your Next Interview




Whats wrong in this Descriptive Program?

This is a discussion on Whats wrong in this Descriptive Program? within the QTP forums, part of the Software Testing category; 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 ...


Go Back   Geeks Talk > Software Testing > QTP

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 01-23-2007
Expert Member
 
Join Date: Nov 2006
Location: Hyd-IND
Posts: 512
Thanks: 1
Thanked 53 Times in 45 Posts
sutnarcha is on a distinguished road
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.

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
.dialog("text:=Flights Table").winlist("attached text:=From", "Window ID:=2001").selectrange 0
.dialog("text:=Flights Table").winbutton("text:=OK").click
.winedit("attached text:=Name:").set "SutNarCha"
.winbutton("text:=Insert Order").click
end with
This test runs fine until that colored statement. It gets stuck there and the error message says “The operation can not be performed”.

All its argument values are written after applying “Object Spy” on the respective objects.

Please help solve this problem.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-16-2007
yan yan is offline
Junior Member
 
Join Date: May 2006
Location: Tel Aviv ,Israel
Posts: 7
Thanks: 0
Thanked 2 Times in 2 Posts
yan is on a distinguished road
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.
Reply With Quote
The Following User Says Thank You to yan For This Useful Post:
  #3 (permalink)  
Old 02-20-2007
Contributing Member
 
Join Date: Feb 2007
Location: Delhi
Posts: 51
Thanks: 3
Thanked 10 Times in 5 Posts
smganesh is on a distinguished road
Re: Whats wrong in this Descriptive Program?

Hi,

Your script needs some more descriptions & modifications.

Here is the right script:

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
Reply With Quote
  #4 (permalink)  
Old 02-20-2007
Junior Member
 
Join Date: Nov 2006
Location: New York city
Posts: 18
Thanks: 4
Thanked 0 Times in 0 Posts
milu_mohanty is on a distinguished road
Re: Whats wrong in this Descriptive Program?

why were u using "selectrange 0". Did not make any sense to me.
Reply With Quote
  #5 (permalink)  
Old 02-21-2007
Contributing Member
 
Join Date: Feb 2007
Location: Delhi
Posts: 51
Thanks: 3
Thanked 10 Times in 5 Posts
smganesh is on a distinguished road
Re: Whats wrong in this Descriptive Program?

Here is the right script:

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 0
.dialog("text:=Flights Table").winbutton("text:=OK").click
.winedit("nativeclass:=Edit", "attached text:=Name:").set "SutNarCha"
.winbutton("text:=&Insert Order").click
end with
Reply With Quote
  #6 (permalink)  
Old 04-08-2007
Junior Member
 
Join Date: Apr 2007
Location: bangalore
Posts: 8
Thanks: 0
Thanked 1 Time in 1 Post
sksanath is on a distinguished road
Re: Whats wrong in this Descriptive Program?

try using window("text:=Flight Reservation").dialog("text:=Flights Table").activate

after pressing the 'FLIGHT' button..
Reply With Quote
  #7 (permalink)  
Old 04-28-2007
Expert Member
 
Join Date: Apr 2007
Location: Kolkata
Posts: 151
Thanks: 3
Thanked 10 Times in 9 Posts
debleena23 is on a distinguished road
Re: Whats wrong in this Descriptive Program?

Please use Select function instead of selectrange
Reply With Quote
  #8 (permalink)  
Old 10-09-2007
Contributing Member
 
Join Date: Sep 2007
Location: Hyderabad
Posts: 93
Thanks: 1
Thanked 14 Times in 13 Posts
rajaputra is on a distinguished road
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
Reply With Quote
Reply

  Geeks Talk > Software Testing > QTP


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
Descriptive Programming thotaravikiran QTP 11 07-08-2008 09:00 AM
Knowledge about Program ID in Cobol program RyanJames MainFrame 2 02-14-2008 09:32 AM
Run a program as a different user in XP Lokesh M Windows 10 10-28-2007 02:41 PM
Recursion in Program joel MainFrame 2 04-25-2007 08:03 AM
When things go wrong... Lokesh M Geeks Lounge 2 12-11-2006 10:09 PM


All times are GMT -4. The time now is 02:00 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved