Forum Discussion

srandall's avatar
srandall
Contributor
8 years ago

How to assign initial variable to new variable for DB Table Type

I am trying to refer back to my initial DB Table type variable and am having a difficult time understanding how to do this.

 

We use Keyword test. I have my initial variables set up and I am changing the data on each of these variables. I realize these values are static; therefore once I change and save my changes to this data, I need to understand how I can reference the values from the initial variable so I can confirm my changes saved (along with some other data I need to verify that also changes).

 

I found this in one of the support documents, but I'm not able to get it set up correctly to work:

 

Note that the data obtained via the DB Table variable is static. It is not refreshed if the data in the storage is changed. Also, there is no special way to command the variable to refresh the data. However, you can work around this by creating another variable of the DB Table type and assigning the value of the initial variable to the new variable. Then, you need to assign the value of the new variable back to the initial variable. This will refresh the data stored in the initial DB Table variable.

 

If someone could explain how I set that up, that would be so very helpful. I have attached an example of my variables. It is the one I named 'ChangedData' that I need to know how I reference that back to the initial variables.

 

8 Replies

    • andrewa's avatar
      andrewa
      Contributor

      I've actually moved away from using DB Tables because they were very 'static' in nature. I use regular Table type variables because I can add/remove columns from them on the fly. Is that the sort of functionality you're aiming for?

      • srandall's avatar
        srandall
        Contributor

        I actually am using table variables. Maybe I'm not using them in the correct way. I've attached pictures of my test case and circled the area I am have complications with. What I want to do is to reference back to my original variable by bknCaseID and gather the changed values from the database so I can confirm we are saving our data correctly. There are additional expectations as well that should occur in the database that I need to check. But I have been unable to find that 'work around' that was mentioned in the documentation from SmartBear.

         

        .