Change return value when start with command line

Ask general questions here.
PiJano
Posts: 7
Joined: Wed Sep 24, 2014 1:11 pm

Change return value when start with command line

Post by PiJano » Wed Dec 09, 2015 9:44 am

Hi everyone,

we start ranorex every night with Jenkins. So a batch file starts our tests over the command line.
A few iterations should throw an exception and then the iteration fails (intended). But the return value of the test is '-1'.

Is there a way to change it into '0', so the test will be shown as successfull?

thanks for your help,
Jan

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Change return value when start with command line

Post by krstcs » Thu Dec 10, 2015 4:41 pm

There is no way to alter the error code returned without writing code.

The best thing to do would be to adjust your tests so that they don't throw the exceptions. If you know that certain cases will result in a failure you should be testing for that. You can validate that things don't exist, or that there is an error message shown, etc.

You should always make your test pass organically, not by overriding the return code artificially.
Shortcuts usually aren't...