App closes after Jenkins cmd completes

Ranorex Studio, Spy, Recorder, and Driver.
ablang_58
Posts: 10
Joined: Tue Feb 12, 2013 6:51 pm

App closes after Jenkins cmd completes

Post by ablang_58 » Mon Nov 16, 2015 5:15 pm

Running Ranorex 5.3.1 on a Virtual Machine (Windows 7). A Jenkins Project (on a remote system) issues a command line:
H:\Automation\VirtualDM\VirtualDM\bin\Debug\TestApps.exe /mo:StartApp

The Virtual Machine receives the command and starts the App.
When the Jenkins Project completes the App is closed on the Virtual Machine. My goal is to have the App remain active.
The TestSuite is "checked" and the solution has been built, F8.
TestSuite-->TestCase-->StartApp.
The Module has two entries.
1. Run Application
2. Delay

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

Re: App closes after Jenkins cmd completes

Post by krstcs » Mon Nov 16, 2015 6:21 pm

This is a Jenkins issue, not a Ranorex issue.

When Jenkins creates processes, they are in the context of the running job. When that job ends, the processes associated with it end.

If you want to find a way around that, you should search Jenkins forums and Google.



In addition, you should update Ranorex to a newer version (5.4.3 is current) as 5.3.1 is no longer supported.
Shortcuts usually aren't...

ablang_58
Posts: 10
Joined: Tue Feb 12, 2013 6:51 pm

Re: App closes after Jenkins cmd completes

Post by ablang_58 » Tue Nov 17, 2015 12:02 am

Thanks for your comments.
I have two versions of my StartApp, each with one action where one works and the other does not so I thought it was a Ranorex issue.

Option 1.
Run Application - This does not keep the application running after Jenkins Project closes

Option 2.
Double click (on the desktop icon) This keeps the app running after Jenkins closes

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

Re: App closes after Jenkins cmd completes

Post by krstcs » Tue Nov 17, 2015 4:28 pm

That is because a link in Windows always creates a new process for the application, so Jenkins has no control over the new process and it won't be killed when the Jenkins job ends.
Shortcuts usually aren't...