Results 1 to 8 of 8

Thread: Whats wrong in this Descriptive Program?

  1. #1
    Expert Member
    Join Date
    Nov 2006
    Answers
    518

    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.

    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.


  2. #2
    Junior Member
    Join Date
    May 2006
    Answers
    7

    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.


  3. #3
    Contributing Member
    Join Date
    Feb 2007
    Answers
    48

    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


  4. #4
    Junior Member
    Join Date
    Nov 2006
    Answers
    18

    Re: Whats wrong in this Descriptive Program?

    why were u using "selectrange 0". Did not make any sense to me.



  5. #5
    Contributing Member
    Join Date
    Feb 2007
    Answers
    48

    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


  6. #6
    Junior Member
    Join Date
    Apr 2007
    Answers
    8

    Re: Whats wrong in this Descriptive Program?

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

    after pressing the 'FLIGHT' button..


  7. #7
    Expert Member
    Join Date
    Apr 2007
    Answers
    147

    Re: Whats wrong in this Descriptive Program?

    Please use Select function instead of selectrange


  8. #8
    Expert Member
    Join Date
    Sep 2007
    Answers
    110

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact