Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 59 by aalto.t...@gmail.com: Timestamp is set to 00000000
00:00:00.000 when keyword is set to FAIL
http://code.google.com/p/robotframework-mabot/issues/detail?id=59
When a test suite contains multiple files. If the first suite, last test
case has some failing keywords, then the timestamp is set to 00000000
00:00:00.000 in the report.xml file (when saved). This timestamp zeroing
causes an error when rebot is used to generate the report and log file.
One can reproduce this by taking the selenium2Library demo test cases (in
the attachments). In the invalid_login.txt test suite, make Invalid
Username, Invalid Password, Invalid Username And Password, Empty Username
and Empty Password test to pass by pressing Ctrl+P.
Then in Empty Username And Password test case, make the keywords, Login
With Invalid Credentials Should Fail, Input Username and Input Password to
pass, by pressing Ctrl+P. Make Submit Credentials and Login Should Have
Failed keywords fail by pressing Ctrl+F.
Then make the valid_login.txt suite pass, by pressing Ctrl+p. In the end,
situation should look like the in the end.png picture in the attachments.
When File -> Save is done successfully, run the rebot script and see the
following error message:
C:\Data\SWD-Sprint>rebot tidii.xml
[ ERROR ] Unexpected error: ValueError: Invalid timestamp '00000000
00:00:00.000
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\robot\rebot.py", line 275, in main
rc = ResultWriter(*datasources).write_results(settings)
File "C:\Python27\lib\site-packages\robot\reporting\resultwriter.py",
line 36,
self._write_log(results.js_result, settings.log, settings.log_config)
File "C:\Python27\lib\site-packages\robot\reporting\resultwriter.py",
line 104
self._js_result = builder.build_from(self.result)
File "C:\Python27\lib\site-packages\robot\reporting\jsmodelbuilders.py",
line
suite=SuiteBuilder(self._context).build(result_from_xml.suite),
File "C:\Python27\lib\site-packages\robot\reporting\jsmodelbuilders.py",
line
tuple(self._build_suite(s) for s in suite.suites),
File "C:\Python27\lib\site-packages\robot\reporting\jsmodelbuilders.py",
line
tuple(self._build_suite(s) for s in suite.suites),
File "C:\Python27\lib\site-packages\robot\reporting\jsmodelbuilders.py",
line
tuple(self._build_test(t) for t in suite.tests),
File "C:\Python27\lib\site-packages\robot\reporting\jsmodelbuilders.py",
line
tuple(self._build_test(t) for t in suite.tests),
File "C:\Python27\lib\site-packages\robot\reporting\jsmodelbuilders.py",
line
self._build_keywords(test.keywords, split=True))
File "C:\Python27\lib\site-packages\robot\reporting\jsmodelbuilders.py",
line
model = tuple(self._build_keyword(k) for k in kws)
File "C:\Python27\lib\site-packages\robot\reporting\jsmodelbuilders.py",
line
model = tuple(self._build_keyword(k) for k in kws)
File "C:\Python27\lib\site-packages\robot\reporting\jsmodelbuilders.py",
line
self._build_keywords(kw.keywords, split),
File "C:\Python27\lib\site-packages\robot\reporting\jsmodelbuilders.py",
line
model = tuple(self._build_keyword(k) for k in kws)
File "C:\Python27\lib\site-packages\robot\reporting\jsmodelbuilders.py",
line
model = tuple(self._build_keyword(k) for k in kws)
File "C:\Python27\lib\site-packages\robot\reporting\jsmodelbuilders.py",
line
tuple(self._build_message(m) for m in kw.messages))
File "C:\Python27\lib\site-packages\robot\reporting\jsmodelbuilders.py",
line
tuple(self._build_message(m) for m in kw.messages))
File "C:\Python27\lib\site-packages\robot\reporting\jsmodelbuilders.py",
line
return self._build(msg)
File "C:\Python27\lib\site-packages\robot\reporting\jsmodelbuilders.py",
line
return (self._timestamp(msg.timestamp),
File "C:\Python27\lib\site-packages\robot\reporting\jsbuildingcontext.py",
lin
millis = long(round(timestamp_to_secs(time) * 1000))
File "C:\Python27\lib\site-packages\robot\utils\robottime.py", line 286,
in ti
raise ValueError("Invalid timestamp '%s'" % timestamp)
C:\Data\SWD-Sprint>
The saved tidii.xml is also in the attachments. On can do a workaround and
manually search and replace the zeroed time stamp values in the xml file.
Then the report and log file are successfully generated.
C:\Data\SWD-Sprint>rebot --version
ebot 2.7.1 (Python 2.7.2 on win32)
C:\Data\SWD-Sprint>mabot.py --version
Mabot 0.8
Run on windows 7 64bits version
Attachments:
invalid_login.txt 1.1 KB
valid_login.txt 425 bytes
end.png 85.4 KB
tidii.xml 10.7 KB