Windows 10: Batch-triggered first run of TC fails

Ranorex Studio, Spy, Recorder, and Driver.
loonquawl
Posts: 69
Joined: Wed Nov 22, 2017 10:08 am

Windows 10: Batch-triggered first run of TC fails

Post by loonquawl » Fri Nov 16, 2018 12:32 pm

I'm currently experimenting with executing Testcases that test the before and after of a Reboot-Situation. I use a Solution that has two Testcases, Before and After. The Before Testcase does some things, and then triggers a forced Reboot (via
System.Diagnostics.Process.Start("shutdown.exe", -r -f -t " + argument1);

(the argument is a time in seconds)). This works well. I then use a batch script in the autostart Folder of windows 10 ("Startup") to start the Testcase After:
START "Ranorex-Cmd" /D C:\PathtoTest\X\bin\Debug /B X.exe /tc:AfterBoot 
Now to the weird part: If i run this batch script for the first time after a reboot, it fails to execute. It does not matter whether it started manually, or by Autostart. First Run = Fail. If i then start it again, it runs fine. It fails with errorcode 0xc0000142

Has anybody had similar problems? I imagine it has something to do with permissions, but i'm lost as to what i could do. (My current workaround is to run the same start command twice in the Batch File, but that seems like an ugly hack.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Windows 10: Batch-triggered first run of TC fails

Post by odklizec » Fri Nov 16, 2018 2:21 pm

Hi,

It sounds to me like a windows-related problem and not something Ranorex-related? Have you tried to run your test on another PC (including win restart)?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

loonquawl
Posts: 69
Joined: Wed Nov 22, 2017 10:08 am

Re: Windows 10: Batch-triggered first run of TC fails

Post by loonquawl » Tue Nov 20, 2018 12:26 pm

It is most certainly a Windows problem, but i was hoping that someone had encountered (and countered) it with Ranorex already - the Problem of errorcode 0xc0000142 is widely known all over the net, but the remedies seem to be very specific to the circumstances and tools that trigger it.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Windows 10: Batch-triggered first run of TC fails

Post by odklizec » Tue Nov 20, 2018 2:11 pm

Hi,

A quick search revealed few old posts, discussing this issue. Check for example this post, with possible solution of the issue:
getting-an-error-related-to-exe-while-r ... tml#p30432
Or this one:
viewtopic.php?f=9&t=8277&p=33507#p33507
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration