SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Senior Member
    Join Date
    May 2001
    Posts
    378
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    ddt_set_row() fails when data table is empty

    Hello all.
    I am facing a problem where I am creating a new XLS file using ddt_open_statement. The table is initially empty and is supposed to get filled during the test run.
    The problem is that when I do the ddt_set_row(table, 1); statement returns an error that a parameter is out of range, the parameter is the row of course. But why is it out of range. The fact that the table is initially empty is essential for me.
    Also, is it possible to create new columns in the XLS file from the code itself?

    Thank-you,
    LIOR
    If it's working... don't touch it!

  2. #2
    Moderator JakeBrake's Avatar
    Join Date
    Dec 2000
    Location
    St. Louis - Year 2025
    Posts
    15,609
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: ddt_set_row() fails when data table is empty

    Cheap workaround:

    Put some data in row 1 that you will overwrite.

    Regarding new columns:
    My guess is yes - you can create them. I don't have WRunner in front of me right at this moment to verify. Please look over all the ddt_functions. I think a function to do that would stand out. If there is no function for that directly, you could probably do that by using a combination of obj_type statements to get you to the desired column and input a name. I would suspect that you would need to do a ddt_save, close, re-open, etc.

  3. #3
    Junior Member
    Join Date
    Feb 2003
    Location
    Israel
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: ddt_set_row() fails when data table is empty

    Hi
    Better to use function
    ddt_set_val_by_row ( data_table_name, row, parameter, value );

    where
    row is number of row, started from 1
    (because row=0 is row with column names)
    parameter is name of column

    Good luck

  4. #4
    Member
    Join Date
    Jan 2003
    Location
    Chennai,TN,India
    Posts
    42
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: ddt_set_row() fails when data table is empty

    WinRunner returns the error "Parameter out of range" because you are trying to select the first row of the table but the table is empty.

    Its better to check the table whether it is populated with rows or not before doing
    ddt_set_row(table, 1);

    You can use ddt_get_row_count(table, RowCount) and check whether the contains any row.

    ddt_get_row_count(table, RowCount)
    if(RowCount > 0)
    {
    ddt_set_row(table, 1);
    }

    I believe this will help you

 

 

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:03 PM.

Copyright BetaSoft Inc.