Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

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 still ...

Go Back   Geeks Talk > Software Testing > QTP
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 01-23-2007
Expert Member
 
Join Date: Nov 2006
Location: Hyd-IND
Posts: 528
Thanks: 1
Thanked 63 Times in 50 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 12 Times in 6 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 12 Times in 6 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 11 Times in 10 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
Expert Member
 
Join Date: Sep 2007
Location: Hyderabad
Posts: 115
Thanks: 1
Thanked 19 Times in 15 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Descriptive Programming thotaravikiran QTP 12 09-02-2009 04:44 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 10:43 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved