Page 1 of 1

Re-run failed tests, is there an option for this?

Posted: Mon Jul 10, 2017 4:03 pm
by xibinki
I searched on the forum for this topic and it seems there's a lot of people asking the same thing and no one answering a proper answer.

This been said, I decided to make a post and ask to the Ranorex Devs and Support Team, is there an option or a code block to re-run the failed tests on Ranorex?

I have 60 test cases which run during the night and I want for Ranorex Studio to re-run the failed tests, mostly of these tests fail because Ranorex default timeout (1min) isn't enough to identify a controller on the login of my app. Also the computer where I run the tests, isn't very fast and sometimes the app takes longer to open.

So, is there an option for re-run tests?

Thanks.

Re: Re-run failed tests, is there an option for this?

Posted: Mon Jul 10, 2017 8:17 pm
by krstcs
First, no, there is no built-in way to rerun failed tests.

Second, if you tests are timing out you need to either increase the timeout, or change the RanoreXPath so that it is more specific (which makes it faster), or both. Having a good XPath is usually the best way to speed up tests and get around timeout failures.

Re: Re-run failed tests, is there an option for this?

Posted: Tue Jul 11, 2017 9:46 am
by xibinki
krstcs wrote:First, no, there is no built-in way to rerun failed tests.

Second, if you tests are timing out you need to either increase the timeout, or change the RanoreXPath so that it is more specific (which makes it faster), or both. Having a good XPath is usually the best way to speed up tests and get around timeout failures.
Well, to be honest I have some problems with XPath and finding the elements on my testing app. The app was firstly built in winforms and now it has wpf elements on top of the winforms. Ranorex has a real hard time identifying the correct xpath and when I need to add a new element to the repository, basically I have to use the Spy tool and walk my way through the hierarchy tree of elements, which is a pain in head. I tried to initiate the testing app with administrator rights, also initiated Ranorex with administrator rights, but Ranorex keeps identifying the elements as "ElementHost". I also tried disabling the WPF plugin and enabling it, but then it messes up with the xpaths and it's even more difficult to correct them.

I never figured out if its a problem with Windows 10, the testing app, Ranorex or winforms. Tried different solutions and nothing seemed to work :( and this is why sometimes the elements timeout and my tests fail.

Re: Re-run failed tests, is there an option for this?

Posted: Thu Jul 13, 2017 1:08 pm
by Support Team
Hello xibinki,

I think that we could best help you via our ticketing support system. I suggest that you drop us an email at [email protected].

It would be best, if you would send us your application already in your first email together with the description of your problem. If this is not possible, then please at least send us a Ranorex snapshot of your application. Instructions on how you can create one can be found here: How to Create a Ranorex Snapshot

Furthermore, please don't forget to attach your Customer ID at the beginning of your email ;)

I am looking forward to your email.

Sincerely,
Tomaž

Re: Re-run failed tests, is there an option for this?

Posted: Thu Jul 13, 2017 5:58 pm
by tvu
Hi xibinki,

I re-run my failed test case by doing the following:
  • I run the automation with the desired run configuration.
  • In the Suite teardown section, I write a list of failed test cases to a CSV
  • I then run the automation again, but with a Re-Run Failed test case configuration
  • The configuration runs only one test case. That test will read in the CSV file and enable all the failed test case
  • This one test case has to be before any failed test case you are running.
You can enable the test case by doing:

Code: Select all

TestSuite.Current.GetTestContainer(testCaseName).Checked = true;
Hope that helps.