Getting a DB Table variable into a Log Message
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
You might not like AI, but it doesn't care about you.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What type is your original accountid variable? Does it come out blank in the log too?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
You might not like AI, but it doesn't care about you.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Type mismatch can frequently be resolved with one of the methods here
https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqconvert/methods.html
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You might not like AI, but it doesn't care about you.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
See if this puts something in the log
log.message(aqConvert.IntToStr(nameofF1variable))
