How to write logo information into a variable or table?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to write logo information into a variable or table?
When searching for Testcomplete Examples i often find Examples writeing results to log file(s).
How can i write this information into a variable or a Table
E.g. a function that searches for files in a directory and writes the file name into the log:
What do i have to do to write the information into a variable or Table?
function FileFinder()
{
var foundFiles, aFile;
foundFiles = aqFileSystem.FindFiles("C:\\Users\\imyuser\\Downloads\\","response_*.json");
if (!strictEqual(foundFiles, null))
while (foundFiles.HasNext())
{
aFile = foundFiles.Next();
Log.Message(aFile.Name);
}
else
Log.Message("No files were found.");
- Labels:
-
Keyword Tests
-
Script Tests
-
Web Testing
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Assuming you're using JavaScript, store the object returned into an Array. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array for example.
var filenames = [];
...
filenames.push(aFile.Name);
...
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @rhu,
I hope you are keeping well.
There is the LogTableData Object as per following description;
Within the following documentation there is a code example that obtains the total number of the specified log item's rows and then posts the values of all the rows to the test log.
Please let me know if this resolves your query or if you have any additional questions.
Thanks,
Shane
