Currently there is no easy way to do this, but there are plans to
include this functionality [1] into the next Robot Framework release.
Before that it would be possible to use Robot's internal APIs [2] to
read the test cases and write the --test options to i.e. arguments
file.
[1] http://code.google.com/p/robotframework/issues/detail?id=702
[2] http://robotframework.googlecode.com/svn/tags/robotframework-2.5.5/doc/userguide/RobotFrameworkUserGuide.html#executed-test-data
Br,
Juha
--
Juha Rantanen
agile tester/coach @ reaktor.fi
2011/1/11 Sajjad Malang <sajjad...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "robotframework-users" group.
> To post to this group, send email to robotframe...@googlegroups.com.
> To unsubscribe from this group, send email to
> robotframework-u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/robotframework-users?hl=en.
>
This (partly http://code.google.com/p/robotframework/issues/detail?id=757&colspec=ID%20Type%20Status%20Priority%20Target%20Owner%20Summary%20Stars&start=100)
works:
gather_failed_tests.py:
#!/usr/bin/env python
"""Usage: gather_failed_tests.py inpath [outpath]
Reads result of a test run from Robot output file and gathers failed
test names to
an argument file (default failed_tests.txt). Note! This works only
when all tests
have differing names.
To re-run failed tests:
pybot --argumentfile failed_tests.txt ..
"""
from __future__ import with_statement
import sys
from robot.output import TestSuite
def check_tests(inpath, outpath=None):
if not outpath:
outpath = 'failed_tests.txt'
suite = TestSuite(inpath)
with open(outpath, 'w') as outfile:
gather(suite, outfile)
def gather(suite, outfile):
if suite.status == 'PASS':
return
for test in suite.tests:
if test.status == 'FAIL':
outfile.write('--test %s\n' % (test.name))
for subsuite in suite.suites:
gather(subsuite, outfile)
if __name__ == '__main__':
try:
check_tests(*sys.argv[1:])
except TypeError, e:
print e
print __doc__
2011/1/11 Sajjad Malang <sajjad...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "robotframework-users" group.
> To post to this group, send email to robotframe...@googlegroups.com.
> To unsubscribe from this group, send email to
> robotframework-u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/robotframework-users?hl=en.
>
--
Mikko Korpela
I just attached an enhanced version of Mikko's script to issue 702 [1]
that requests adding rerun capability to the core framework. The
enhancement is that when using the yet to be released RF 2.5.6 or
never, the script will use long names of tests (2.5.6 supports using
them with --test option [2]). With earlier version it will use just
tests' own name which will result with possible other tests with same
name to be executed.
I hope this script is useful until we get the rerun functionality into
the core framework.
[1] http://code.google.com/p/robotframework/issues/detail?id=702
[2] http://code.google.com/p/robotframework/issues/detail?id=757
Cheers,
.peke
2011/1/11 Mikko Korpela <mikko....@gmail.com>:
> Hello!
>
> This (partly http://code.google.com/p/robotframework/issues/detail?id=757)