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
    Feb 2002
    Location
    Decatur
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to skip a null table items in a datadriven test?

    Does anybody know how to skip a null table value in a datadriven test?

    For example:
    Data file may have 3 colums of data
    1. Data_1 |Data_2 |Data_3
    2. red |yellow |blue
    3. red |yellow |

    I tried using the following code to select the items.
    list_select_item("color",ddt_val(table,"data_1"));
    list_extend_item("color",ddt_val(table,"data_2"));
    list_extend_item("color",ddt_val(table,"data_3"));

    When my script gets to the 3rd row it tries to pass the null value to the application and I get the following error.
    Window: "SearchMain"
    Object: "color"
    Error: Item not found.

    ------------------
    Reasons

  2. #2
    Junior Member
    Join Date
    Oct 2002
    Location
    India
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to skip a null table items in a datadriven test?

    Hi
    list_extend_item("color","")); Did u tried this option. In your code you are trying to add and empty string to the list. The error is from the list not from the ddt_...
    So put an if condition to find a valid string before using the list_ext....

    ------------------

  3. #3
    Senior Member
    Join Date
    May 2001
    Location
    Ankh-Morpork
    Posts
    2,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to skip a null table items in a datadriven test?

    You could to the ddt_val() first, then use the returned value in an if clause to determine if you should do the extend.

    color = ddt_val(table, column);
    if(length(color) > 0)
    {
    # do the extend
    }

    ------------------
    Charles Reace
    charlesDOTreaceATverizonDOTnet

    "Any sufficiently advanced bug is indistinguishable from a feature." -Bruce Brown
    web site | [url=http://www.ebookworm.us/[/url]

    [i]...Sound trumpets! Every trumpet in the host! / Sixty thousand, on these words, sound, so high the mountains sound, and the valleys resound.</i] (The Song of Roland)

 

 

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 01:53 AM.

Copyright BetaSoft Inc.