Forum Discussion

DSmachineWorld's avatar
DSmachineWorld
Contributor
5 months ago

Scope of Data-Driven Loop Table Variable

I have a keyword test level variable from a DB table called accountID. 

If I want to use the current run time value of this variable in a script routine inside my keyword test, do I need to pass it as a parameter to the script routine?

Currently I have this line inside my Python script routine which is not working at all.

FooFileName = KeywordTests.checkFoo.Variables.Value["accountID"]

where checkFoo is the name of the keyword test and accountID is the data-driven loop DBTable variable.

This returns a "The object does not support this property or method".

 

  • If I understand your description correctly, you may be missing one of the following required references:
    1. keyword test name = checkFoo 
    2. keyword test, Variables, variable name (DBTable type) = MyTable
    3. DBTable column name = accountID

    In that case your statement should be 
    FooFileName = KeywordTests.checkFoo.Variables.MyTable.Value["accountID"]

    Also I don't think you need the ".Value"

  • Hassan_Ballan's avatar
    Hassan_Ballan
    Frequent Contributor

    If I understand your description correctly, you may be missing one of the following required references:
    1. keyword test name = checkFoo 
    2. keyword test, Variables, variable name (DBTable type) = MyTable
    3. DBTable column name = accountID

    In that case your statement should be 
    FooFileName = KeywordTests.checkFoo.Variables.MyTable.Value["accountID"]

    Also I don't think you need the ".Value"

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    You can either pass the keyword test variable to your script function or you can reference the keyword test variable within the script. Both options will work.

    You don't seem to be using the variable that you have defined!