Results 1 to 7 of 7
  1. #1

    Load data from Global Sheet (loop statement)

    Hi everybody

    I'm struggling with the following scenario:

    I've got a Global sheet with 110 urls in the first column.
    I would like to find a script (a loop I guess) that allows me:

    1. Launch the first url
    2. Execute test script on that webpage
    3. Go back to column and launch the second url in the list
    4. Repeat test script on the second page

    I wrote the script I needed, but what I need now is the method to use in a loop the urls forms the Global sheet.

    Another thing, I'm using the Action Sheet to export the result of the test. This should not interfere with the data in the Global sheet, right?

    Thank in advance

  2. #2

    Re: Load sata from Global Sheet (loop statement)

    QTP has a built in loop around the global sheet.

    In test settings you can set the iterations, this refers to looping around the global sheet, this refers to looping. There is no need to code a "For" loop

  3. #3

    Re: Load sata from Global Sheet (loop statement)

    Ok, but in terms of code, which would be script to execute?

    How can I get the firts url form data sheet and launch it in an IE 7 browser?

  4. #4

    Re: Load sata from Global Sheet (loop statement)

    To get the data it's simple (strURL = DataTable("URL", dtGlobalSheet), then your code to open a browser, then do you testing, then close the browser.

    After this it will repeat for every subsequent row.

    There have been plenty of posts on this forum alreday to help you with the rest of this problem

  5. #5

    Re: Load sata from Global Sheet (loop statement)

    I spent 2 days try to find something easy to apply to my prblem on the forum, but as a Newbie sometimes is even hard to DEFINE the issue, you can imagine how hard it could be to read others posts and then apply to your case.(especially if you don't know nothing in VBScript)

    I only needed something easy for my problem.

    Thanks for the reply, I think this will be the right kick off for the next steps.

    I wish you a good day.

  6. #6

    Re: Load sata from Global Sheet (loop statement)

    q1:how to simplify this code using loop condition
    q2:how to export this result in local disk

    Note: (object_name) is column name in global sheet
    i need to store the result in the another location(ie.. export)

    a=browser("Welcome: Mercury Tours").Page ("Welcome: Mercury Tours").WebEdit ("userName").GetTOProperty ("name")
    b=browser("Welcome: Mercury Tours").Page ("Welcome: Mercury Tours").WebEdit("password").GetTOProperty ("name")
    c=browser("Welcome: Mercury Tours").page("Welcome: Mercury Tours").Link ("SIGN-ON").GetTOProperty ("name")
    browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").Link("REGISTER").GetTOProperty ("name")
    browser("Welcome: Mercury Tours").Page ("Welcome: Mercury Tours").Link ("CONTACT").GetTOProperty ("name")
    browser("Welcome: Mercury Tours").Page ("Welcome: Mercury Tours").Link("SUPPORT").GetTOProperty("name")

    this is my coding

  7. #7

    Re: Load sata from Global Sheet (loop statement)

    Why do you want a loop when all three statement are on different objects?

    Q2: You need to update the valuesin Data Table using below code and then export it to local disk

    DataTable.Export "C:\Test.xls"

    And try putting some effort in reading the help file.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 06:05 PM.

Copyright BetaSoft Inc.