Forum Discussion

DSmachineWorld's avatar
DSmachineWorld
Contributor
3 years ago

Getting a DB Table variable into a Log Message

I have a variable being loaded from a CSV file for a data-driven loop as one of my keyword test variables.

 

I have been trying to get the value of it each time it passes through the loop, but I am not able to get it into a log message.

 

I tried various approaches on this board, none really worked out. My latest attempt was to try and set a second variable inside the keyword test.

 

accountID is from the CSV file.

 

 

I then try to put this variable in the log.

The log output is blank.

 

  • What type is your original accountid variable? Does it come out blank in the log too?

  • So this doesn't give me a "Type Mismatch". Unfortunately, it doesn't print the variable value to the message log.

     

    Log.Message("Account ID " + aqConvert.VarToStr(KeywordTests.PreviousRates.Variables.accountID))

     

    Should I convert the CSV to an Excel file and format the Excel cells to a particular format?

    • Marsha_R's avatar
      Marsha_R
      Moderator

      CSV is all text and Excel will just complicate things. Let's stick with CSV.

       

      If you go look at the table of Variables in your project, what type does it show for KeywordTests.PreviousRates.Variables.accountID?

       

       

    • Marsha_R's avatar
      Marsha_R
      Moderator

       

      See if this puts something in the log

      log.message(aqConvert.IntToStr(nameofF1variable))