Ask a Question

Getting a DB Table variable into a Log Message

DSmachineWorld
Contributor

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.

 

DSmachineWorld_0-1667591626277.png

 

I then try to put this variable in the log.

DSmachineWorld_1-1667591658759.png

DSmachineWorld_2-1667592047619.png

The log output is blank.

 

--
You might not like AI, but it doesn't care about you.
7 REPLIES 7
Marsha_R
Community Hero

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


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame

The accountID from the DBTable isn't showing up in my logs, I kept getting a "Type mismatch" error when I tried to add it in directly.

When I use the DBTable variable with Keys, it works fine to enter the data into the application's text box.

DSmachineWorld_0-1667849041053.png

 

--
You might not like AI, but it doesn't care about you.

Type mismatch can frequently be resolved with one of the methods here

https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqconvert/methods.html


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
DSmachineWorld
Contributor

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?

--
You might not like AI, but it doesn't care about you.

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
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
DSmachineWorld
Contributor

DSmachineWorld_0-1667921357832.png

 

--
You might not like AI, but it doesn't care about you.

 

See if this puts something in the log

log.message(aqConvert.IntToStr(nameofF1variable))

 

 


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
cancel
Showing results for 
Search instead for 
Did you mean: