SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2
  1. #1
    Super Member
    Join Date
    Jul 1999
    Location
    Rancho Santa Margarita, CA
    Posts
    1,441
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Specifying Data Table in Test Settings/Resources

    Any advantages/disadvantages of mainly specifying your Data Table in the Test Settings/Resources versus coding it with DataTable.Import <filename>?

    Using QTP 11, my excel datafile has 10 or more worksheets.
    My test only has 1 Action and it matches the 2nd Worksheet.
    Case1 - With DataTable.Import <excel file>, QTP is importing only the Global and the 2nd Worksheet.

    Case2 - If I use the relative path in Test Settings/Resources, I am also getting just the Global and the 2nd Worksheet.

    Case3 - If I don't use the relative path in Test Settings/Resources and specify the full path, I get all of my datafile worksheets at runtime.

    Note: We have not applied any of the QTP 11 patches. Is this part of the problem we are seeing?

    Appreciate your help.
    Thanks.

  2. #2
    Moderator
    Join Date
    Oct 2010
    Location
    Norway
    Posts
    3,265
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Specifying Data Table in Test Settings/Resources

    There's no difference betwen Case1 & Case2. They are the same.
    But there's a difference between (Case1, Case2) AND Case3. And that is when you use the Import method, then you must meet this condition. The imported table must match the test. Where in Case3, it doesn't have to meet this condition. It just loads the whole xls file.

    So you have to create the DataTable first before you can load a sheet on to it. Here's something that can help you.
    <font class="small">Code:</font><hr /><pre>
    Function LoadSheet(strFilePath, strSourceSheet, strDestSheet)
    DataTable.ImportSheet PathFinder.Locate(strFilePath), strSourceSheet, strDestSheet
    End Function
    </pre><hr />

    <font class="small">Code:</font><hr /><pre>
    Function AddLoadSheet(strFilePath, strSourceSheet)
    DataTable.AddSheet strSourceSheet
    DataTable.ImportSheet PathFinder.Locate(strFilePath), strSourceSheet, strSourceSheet
    End Function
    </pre><hr />
    Rajkumar

 

 

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 12.50%
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 07:50 PM.

Copyright BetaSoft Inc.