Successful test, error level -1

Ask general questions here.
HansSchl
Posts: 143
Joined: Wed Sep 19, 2018 10:05 am

Successful test, error level -1

Post by HansSchl » Fri Jan 13, 2023 9:00 am

Hi,

I am running several tests on an unatteded machine, controlled by a PowerShell script. The tests are compiled elsewhere, and the test executable file and it required dlls are then copied into the test system. The script launches the tests in sequence and logs the resulting errorlevels (exit codes).

Errorlevels are documented at https://www.ranorex.com/help/latest/ran ... execution/. Errorlevel 0 means "Successful test run", and that is what I see most of the time, fortunately.

Errorlevel -1 means "Test run aborted due to error." When I open the corresponding rxzlog file, I see failures and can try to find reasons. This is ok.

Today, I found that a test execution exited with errorlevel -1, but the rxzlog file showed 4 out of 4 tests succeeded. When I look into the results uploaded into TestRail, I see the same pattern: All 4 tests succeeded. How can that be?

This is Ranorex 10.1.7 running under Windows 10 22H2.

Cheers
Hans

IvanF
Posts: 151
Joined: Thu Aug 11, 2022 8:55 pm

Re: Successful test, error level -1

Post by IvanF » Fri Jan 20, 2023 4:50 pm

Hi, do any of the actions in those 4 tests have "continue on failure" enabled? Or any other kind of advanced error handling?

HansSchl
Posts: 143
Joined: Wed Sep 19, 2018 10:05 am

Re: Successful test, error level -1

Post by HansSchl » Fri Jan 20, 2023 4:54 pm

Hi @IvanF, yes "Continue on Error" may be enabled on some actions. What else could be "advanced error handling"?
If an error occurred which is ignored due to "continue on error", wouldn't there be a warning in the protocol?

IvanF
Posts: 151
Joined: Thu Aug 11, 2022 8:55 pm

Re: Successful test, error level -1

Post by IvanF » Mon Jan 23, 2023 3:14 pm

Advanced error handling = any user code modules that perform functions beyond what's available through the Actions UI. E.g., enable-continue-on-fail-without-warning-t11938.html - this thread mentions a Try...Catch block that ignores the warning for Continue on Fail.

If nothing like that is used, do you pass the "/reportlevel:" argument explicitly in the PowerShell script or do you use the default values?

HansSchl
Posts: 143
Joined: Wed Sep 19, 2018 10:05 am

Re: Successful test, error level -1

Post by HansSchl » Mon Jan 23, 2023 3:32 pm

@IvanF, thanks for your reply. I think I don't explicitly catch exceptions, but I'll recheck that. I am passing the following command line options to the test: -agent:... -testrail -truser=... -trpass=... -trvideo -trrunname=... -zrf=... (I don't remember why -agent requires a colon and the others want an equals sign, but it works that way).

HansSchl
Posts: 143
Joined: Wed Sep 19, 2018 10:05 am

Re: Successful test, error level -1

Post by HansSchl » Mon Jan 23, 2023 3:35 pm

There's lot of user code involved, and some of it has try-catch blocks, but I see no indication that any exception was thrown during test execution.

IvanF
Posts: 151
Joined: Thu Aug 11, 2022 8:55 pm

Re: Successful test, error level -1

Post by IvanF » Mon Jan 23, 2023 4:23 pm

I see, i'd suggest trying to run the command line execution once more with the "/reportlevel:debug", just to make sure it would display all the relevant info and not skip the info/warning levels.

If that doesn't produce any additional hints, a direct support ticket sharing more about the Actions/user code setup may be the best bet.

HansSchl
Posts: 143
Joined: Wed Sep 19, 2018 10:05 am

Re: Successful test, error level -1

Post by HansSchl » Mon Jan 23, 2023 4:51 pm

Will do that, and then wait to see when the problem shows up again :-) Thanks!