Force one test suite to run during rerunfailedsuites

86 views
Skip to first unread message

Noah Reson-Brown

unread,
May 25, 2018, 8:12:43 PM5/25/18
to robotframework-users
I have to set some specific things up when running my tests, and generally do it with a suite that runs before all other suites.  However, that suite always passes, because it's just running variable settings and similar.

When I use --rerunfailedsuites , all my tests fail, because that setup suite isn't run.  Is there a way to have --rerunfailedsuites and yet still force a specific suite to run?

For example, let's say I have "Setup.robot", "Tests.robot", and "Tests2.robot".  Tests2 is a bit unstable, so I want to use --rerunfailedsuites, but I want "Setup.robot" to also run when I do that.  How do I make that work?

Bryan Oakley

unread,
May 25, 2018, 8:38:46 PM5/25/18
to no...@agentiq.com, robotframework-users
I would recommend moving all of that setup code into a keyword that can be called from any suite. You can then add a suite setup for every suite that calls it. I can detect if it's been called or not, and do nothing if it's already been called. We have a couple keywords like that and it works great, because we don't have to remember to run the magic suite before running any other test. We just run the suite we want, and it will initialize itself if necessary.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframework-users@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

Anne kootstra

unread,
May 27, 2018, 4:31:25 AM5/27/18
to robotframework-users
Any reason for have a separate suite file to perform this preparatory work, instead of using the Setting: Suite Setup in each Suite file? That way each Suite File is self contain and does not depend on other Suites. In the Suite Setup I'd add a check to see if it's already been executed before to prevent re-execution. Most likely by setting and reading a Global Variable that is available across Suite files.

-Anne

Op zaterdag 26 mei 2018 02:12:43 UTC+2 schreef Noah Reson-Brown:

Noah Reson-Brown

unread,
May 27, 2018, 8:23:59 PM5/27/18
to koot...@gmail.com, robotframework-users
Well, the main thing is I don't want to do certain operations over and over again (like the call I use to get the screenshot directory).  Anne's solution about avoiding re-execution would work, and is my current plan, but I was hoping for something more elegant.

--

Michael

unread,
Jun 13, 2018, 3:49:40 AM6/13/18
to robotframework-users
Making use of an initialization "suite" __init__.txt (__init__.robot) might solve your problem. Please check out
http://robotframework.org/robotframework/2.8.7/RobotFrameworkUserGuide.html#initialization-files
https://stackoverflow.com/questions/26610579/init-txt-in-robot-framework

-Michael
To post to this group, send email to robotframe...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages