SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Jan 2008
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    DeleteParameter not working

    Hi All,

    I m trying to delete all the parameters in my datatable sheet at run time.
    im using the code

    For param_count=1 to Datatable.GetSheet(1).GetParameterCount
    Datatable.GetSheet(1).DeleteParameter(param_count)
    Next

    But QTP is deleting alternate parameters and throwing an error saying parameter number 30 does not exist(there are 57 parameters in that sheet).

    Please help.

  2. #2
    Member
    Join Date
    Oct 2008
    Location
    Cambs, UK
    Posts
    426
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: DeleteParameter not working

    That's because when you delete the first element, they all get shifted downwards to fill the spaces. Try looping BACKWARDS:

    iMax = Datatable.GetSheet(1).GetParameterCount

    For param_count = iMax to 1 step -1
    .....
    For an easy to use test automation framework, checkout my website:

    http://www.atomqa.com

  3. #3
    Junior Member
    Join Date
    Jan 2008
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: DeleteParameter not working

    It worked..thanks a lot...

    What im actually trying to do is..load data into a datatable sheet dynamically.....
    i have a kind of driver script which loads data into the sheet and then executes that action....
    but if i have loaded 3 rows of data for the first time and then ran that action...and then just one row of data for the second time...the below 2 rows are already populated with the data from the previous load.....
    so i was tring to delete the parameters before a fresh load...but now after doing that...im getting the below 2 rows as blank...
    is there any way i can delete rows within a datatable sheet completely..before i make a fresh load?..i dont want the rows to be blank

 

 

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:13 AM.

Copyright BetaSoft Inc.