SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Aug 2006
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    ImportSheet Datatable Iteration Problem

    Hi
    I am importing an Excel sheet and its working fine. I have 3 rows and rowcount is showing me the correct value but when run the script, it runs the same script on 1st row instead of 2nd and 3rd row data for 3 iterations. I checked the settings at File > Settings > Run and its fine also as radio button for "Run on all rows" is selected.

    DataTable.ImportSheet "C:\data.xls",1, "Global"
    rowcount=datatable.getsheet("Global").GetRowCount
    'msgBox rowcount
    i=0
    For i=0 to rowcount-1
    SetCurrentRow i
    Next
    rest of the script
    .....
    ....
    .... and so on


    Is there any other setting I need to change. Its the first time I am working with Datatables. I searched Forum before posting my question here but couldn't find the solution to fix it. I am not getting any error or something like that. It runs smoothly but not taking data from 2nd or 3rd row.

    If I use the datatable inside the script, it works fine and takes data from 2nd and 3rd rows. I am unable to find the solution. Can anyone please help me?

    Thanks

  2. #2
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: ImportSheet Datatable Iteration Problem

    I guess there is a KB Article on the same on mercurty website. You can either use code to avoid such situation and in case you are using QTP 9 then you can do registry modification to fix the issue as explaned in the article

  3. #3
    Member
    Join Date
    Aug 2006
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: ImportSheet Datatable Iteration Problem

    Hi Tarun

    I am using QTP 9.0 I did the registry modification as instructed bt Mercury KB but still its the same. I noticed that it selects the rows in the imported sheet but doesn't change the data in my script. And I can see that run time data table also shows 3 rows. Am I using the correct flow of steps in my code? Can you please help me in solving this problem?

    Thanks

  4. #4
    Member
    Join Date
    Aug 2006
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: ImportSheet Datatable Iteration Problem

    Hi Tarun

    Is there any other way to handle this situation?

    Thanks

  5. #5
    Junior Member
    Join Date
    Feb 2007
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: ImportSheet Datatable Iteration Problem

    Hi Paul,
    you could add another action before, and move the first line code(DataTable.ImportSheet "C:\data.xls",1, "Global")into it,then it will work

  6. #6
    Senior Member
    Join Date
    Dec 2006
    Location
    Germany, Dresden
    Posts
    1,536
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: ImportSheet Datatable Iteration Problem

    the solution seems simple:
    after each iteration the global sheet is reloaded and the active row will be always the first row.

    to find out which row you need to set you should use

    Environment.Value "TestIteration"

    -> SetCurrentRow Environment.Value("TestIteration")

    this value will give you always the correct iteration number and start with #1


    please give a feedback if it works
    http://qcmt.pc-polis.de

    de omnibus dubitandum

    For all Questions: Please be sure to take a look at the QTP Manual before posting any Questions, thanks for doing this

  7. #7
    Member
    Join Date
    Aug 2006
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: ImportSheet Datatable Iteration Problem

    thanks...its working now

 

 

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 10.71%
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 06:41 AM.

Copyright BetaSoft Inc.