Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    san jose, CA

    Unanswered: Using VBScript to extract data

    Dear Forums members:

    I am using mercury functional testing tool-Quick Test Professional to record flight reservation page. QTP will generate VBScript in expert view. I added in table check points and text check points in the script. The script suppose to run in three iterations correspond to three departure cities in the data table.

    --The purpose of this hands-on exercise is to let user generate output values from application and compare actual results stored in the data table with expected results.

    --The script runs ok first time, it extracted outbound flight fares into data tables. But When I run it second time, I encountered a run error. It fails at second iteration. It stops at sign-in page.

    The error message says:

    the error message is like this:
    Run error: under action1 Summary
    --> Welcome: Mercury Tours

    object: Run Error

    details: can not indetify the object "fromPort" (of class Weblist). Verify that this
    object's propertyies match an object currently displayed in your application.

    line(5): in expertview browser(welcome: Mercury Tours").page("Find a Flight Mercury).weblist.
    ("fromPort").selectDatatable("departure", dtGlobalSheet)".

    I think that I need to add a loop structure (Do..Loop) in the script so it can access select flight page three times. I post my script here, please give me some advise on where this loops should be and any necessary functions I need in order to run this script successfully.

    -- I also want to know is there any good reference books or web resources focus on using VBScripts to do automation (work with QTP functional testing too will help me a lot)

    --Where I can download Microsoft Script debugger for free?

    I am new to VBScripting. Hope some VB gurus can give me some advises. I appreciate your help!

    The recorded script are as follows:

    1)Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").Set "sjqtp005"

    2)Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("password").SetSecure "421ea4921fd7aae347a5e92d58caf3a20a4e2d46bc73"

    3)Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").Image("Sign-In").Click 35,4

    4)Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("fromPort").Select DataTable("departure", dtGlobalSheet)

    5)Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("fromMonth").Select "Mar"

    6)Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("fromDay").Select "22"

    7)Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toPort").Select "San Francisco"

    8)Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toMonth").Select "Mar"

    9) Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toDay").Select "26"

    10)Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebRadioGroup("servClass").Select "Business"

    11)Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").Image("findFlights").Click 70,14

    12)Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury_2").Output CheckPoint("270")

    13)Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").Image("reserveFlights").Click 80,12

    14)Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebTable("New York to San Francisco").Check CheckPoint("New York to San Francisco")

    15)Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("passFirst0").Set "jee"

    16)Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("passLast0").Set "monk"

    17) Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("creditnumber").Set "7763"

    18)Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebCheckBox("ticketLess").Set "ON"

    19)Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").Image("buyFlights").Click 64,9
    Browser("Welcome: Mercury Tours").Page("Flight Confirmation: Mercury_2").Check CheckPoint("New York")

    20) Browser("Welcome: Mercury Tours").Page("Flight Confirmation: Mercury").Image("home").Click

    21)Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").Sync

    P.S. Should I assign a class object to a varible in order to extract data?

    Last edited by sjgrad03; 02-26-05 at 23:12.

  2. #2
    Join Date
    Aug 2003
    san jose, CA

    seems like no one know the subject :(

    ok fourms:

    Seems like no one know the subject I posted here.

  3. #3
    Join Date
    Mar 2010

    Wink nothing

    I think, if you login before run your Script. It'll ok!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts