Reputation: 518
I'm working on UFT datatable methods and i'm exporting test results to xls file with the help of Datatable exportsheet methods and i want to add test execution time and date end of the xls file and my code is.
'Export Test Results into TestResults Folder with Test Cases
DataTable.ExportSheet "D:\QTP_Automation\Test_Results_AutomationTesting_Results.xls","TestCases"
DataTable.ExportSheet "D:\QTP_Automation\Test_Results_AutomationTesting_Results.xls","TestSteps"
DataTable.ExportSheet "D:\QTP_Automation\Test_Results_AutomationTesting_Results.xls","Customer_Enrollment"
DataTable.ExportSheet "D:\QTP_Automation\Test_Results_AutomationTesting_Results.xls","Update_Customer"
And my file should looks like below
Test_Results_AutomationTesting_Results_20180430_timestamp.xls
Upvotes: 0
Views: 231
Reputation: 10360
You can write something like:
ts = Year(Now) & Right("0"&Month(Now),2) & right("0"&Day(Now),2) & "_timestamp"
strFileName = "D:\QTP_Automation\Test_Results_AutomationTesting_Results_"&ts&".xls"
DataTable.ExportSheet strFileName,"TestCases"
DataTable.ExportSheet strFileName,"TestSteps"
DataTable.ExportSheet strFileName,"Customer_Enrollment"
DataTable.ExportSheet strFileName,"Update_Customer"
Upvotes: 1