SikuliX test report name with Timestamp

Asked by Abhijeet Chavan

How to save SikuliX Test Report file as "Filename+TimeStamp" using HtmlTestRunner. I want filename of report with name and timestamp. Which code shall I write in SikuliX script?

I have written following code but not working:
------------------------------------------------------------------------------------------------------------------------------------------------
#Gets the timestamp as an argument to the sikuli via batch and suffixes to the test report

datearg = ""
parms = sys.argv [1:]
print parms
for i in range (len(parms)):
       datearg = parms[i]
fp = file(os.path.join(dir, "testReport_"+datearg+".html"), "wb") #output HTML file
------------------------------------------------------------------------------------------------------------------------------------------------

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
TestMechanic
Solved:
Last query:
Last reply:
Revision history for this message
Best TestMechanic (ndinev) said :
#1

import datetime

timeStamp = datetime.datetime.now().strftime("%m%d%H%M%S")

fp = file(os.path.join(dir, "testReport_" + timeStamp +".html"), "wb") #output HTML file

Revision history for this message
Abhijeet Chavan (acchavanabhi) said :
#2

Thanks dinev, that solved my question.