Export Data Table values to External File
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Export Data Table values to External File
Hi Team,
i wanted to export the data table values to an external CSV file or excel file programatically after each and every execution. im using vbscript.
can anyone help me on this ?
Kind Regards,
Sathish Kumar K
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
By data table values, what do you mean? Is this a Table type variable in Project.Variables?
If so, you can write an iterative for-loop using the table count as the index and use aqFile object to opena and write to a CSV file the values in the table.
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Krishna_Kumar,
You'll need to work with Excel's COM object. There are many examples in the Community - try searching for them. Here is one of topics:
Tanya Yatskovskaya
SmartBear Community and Education Manager
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @TanyaYatskovska and @tristaanogre ,
Thank you very much.
i was able to export the data table values to an external excel successfully by using the ole object concepts.
But it would be good if you provide information about how to retrive the datatable column names, because i am able to retrive only the column values.
waiting for your response.
Kind Regards,
Sathish Kumar K
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Column names from where? from an Excel file?
Tanya Yatskovskaya
SmartBear Community and Education Manager
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A table variable has two properties/methods: ColumnCount and ColumnName. ColumnName has a parameter for the index of the column, 0 based. So Project.Variables.tableVar.ColumnName(0) will return the column name of the first column in the table. Using ColumnCount, you could build a for-loop to iterate through the columns and document the names.
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
