SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Aug 2004
    Location
    san jose, california
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Using VBscript to extract data

    Hello Everyone:

    I recored a script which will use data table to store outbound flight price from mercury tutorial website. when I first time run it everything pass. Runtime data table showed price for outbound flight price. The second time I run the script, I got a run time error. first interation passed, second interation stuck on sign-on page of mercury tutorial webpage.

    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 may need to insert loop statement into the script, so it can access find flight page multiple times. in this case should I use scalar variable or I need to assign the object in the script to a variable?

    -- what kind of loop structure is better, Do..Loop or for..next loop? I am thinking use the do loop structure. What kind of exit condition should I use. I want to go though every departure city in the drop down list, then exit.

    I post my script here. Please give me some advise. I don't ask for solutions, just some necessary hints (like what kind of keywords, or function shall I use). Please give me some help. Thanks!

    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

  2. #2
    Member
    Join Date
    Dec 2003
    Posts
    205
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Using VBscript to extract data

    Make sure that the values stored in the data table for the departure match those displayed in the application. At times spelling or an extra space may cause this.
    By default say you have 3 values stored in the daparture column then the script would iterate 3 times.
    Also, when your script goes to the second iteration, does it go back to the login page? or the flight finder section?

  3. #3
    Junior Member
    Join Date
    Aug 2004
    Location
    san jose, california
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Using VBscript to extract data

    Hello garifo:

    Thanks for replying my message. when script went through second iteration it hangs on log-in page.

    I also want to ask you is there any good reference books or online resources on VBScripts that focus on automation? I want some books with detailed examples along with clear explanation.

    mercqtp
    2-26-05

  4. #4
    Member
    Join Date
    Dec 2003
    Posts
    205
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Using VBscript to extract data

    A good book that someone recommended on this site si Visual Basic for Testers. The author of the Book is Mary Romero Sweeney.
    I found it to be a very useful book. In addition, there many resources online on VbScript.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:14 PM.

Copyright BetaSoft Inc.