Forum Discussion

completeintern's avatar
completeintern
Occasional Contributor
9 years ago
Solved

DBTable variable from a DBTable

Hi all,

 

I have tests that need multiple CSV files each.

 

All the tests follow the same steps. So it'd be great if I could just have one keyword test execute all these similar tests. What I've been trying to do is to store these CSV files into a master CSV file that would be accessed through a data-driven loop, that way to perform more tests all I'd have to do is to add more rows to the master CSV

 

Example : Navigation is the column title under which is the path to a DBTable, stored within DBTable Master_CFG

 

What I tried to do is : Set variable value Var1 with value Variables.Master_cfg("Navigation")

With var of type DBTable

 

The cell under Navigation looks like {CSV file. "..\path\Nav.csv"}

What I get is a type mismatch :(

 

Any idea of how I could get this to work?

Thanks!

 

  • Thank you but I ended up creating a script to create a table from the path of a CSV file passed as an argument dynamically

    I used the DDT.CSVDriver methods and it works great :)

     

    Couldn't find a way to do that through the UI though.

     

     

5 Replies

  • m_essaid's avatar
    m_essaid
    Valued Contributor

    Hi,

    To call your row you should use the following syntax no ?

     

    Project.Variables.Master_cfg.Value['Navigation']

     

    Which script are you using ?

    • completeintern's avatar
      completeintern
      Occasional Contributor

      I'm using JScript (but mainly I'm using the UI)

       

      But you're right when I export the steps to script I get the following : 

       

       Project.Variables.Var1 = Project.Variables.Master_cfg.Value("Navigation");

       

      With Var1 a DBTable, and the value stored under Navigation a CSV file

       

      I get a type mismatch :(

       

       

      • NisHera's avatar
        NisHera
        Valued Contributor

        What is exact value in file.

        what is the type of Var1 ?

        Are those same?

  • completeintern's avatar
    completeintern
    Occasional Contributor

    Thank you but I ended up creating a script to create a table from the path of a CSV file passed as an argument dynamically

    I used the DDT.CSVDriver methods and it works great :)

     

    Couldn't find a way to do that through the UI though.