Does Ranorex survive a Windows restart?

Ask general questions here.
a_schatzer
Posts: 1
Joined: Tue Jul 21, 2015 2:23 pm

Does Ranorex survive a Windows restart?

Post by a_schatzer » Tue Jul 21, 2015 2:40 pm

Dear all,

I would like to automatize some Installation tests of an Installation package. One of the Installation steps is a restart of the whole PC. Is it possible to let Ranorex continue the test execution afterwards automatically?

Best regards,
Andy

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

Re: Does Ranorex survive a Windows restart?

Post by krstcs » Tue Jul 21, 2015 2:59 pm

No, Ranorex doesn't support this kind of activity out of the box. Ranorex is not designed for system testing, it is a Functional UI Test Automation tool.

It's only possible in the same test if you use some kind of data store (database, CSV file, etc.) where you write the last test case that was run and then you would need to start the test again at system start-up and read the data store and figure out where to go from there. You could have your test write it's own start-up batch file to the start menu's Startup folder and then remove it at the 'end' of the test. Note that this whole thing would require a LOT of user code and could be very brittle.

You could also create two tests, one that does the part before reboot and the second that runs on startup. This is probably the easier way to do it.


Also note that Ranorex (and all other Windows UI automation tools) requires that the desktop be unlocked** and active in order to function properly.

**I use "Autologon" to automatically log my test users onto my test VMs and then unlock the systems when I run the tests. DO NOT USE THIS ON SYSTEMS THAT CAN BE ACCESSED FROM OUTSIDE YOUR FIREWALL!!!
Shortcuts usually aren't...

fester13579
Posts: 30
Joined: Thu Feb 13, 2014 10:29 pm

Re: Does Ranorex survive a Windows restart?

Post by fester13579 » Mon Jul 11, 2016 10:57 pm

Hello,

I am using AutoIT (https://www.autoitscript.com) to solve this issue.
I am trying NOT to hard code my values but I need a pointer to the ranorex project EXE to tell my autoIT code what ranorex project file to run.

NOTE: My ranorex project is VB.net.

Is there some built in method/api that exposes the full path of the ranorex test EXE file that I can put into a code module (like autoit's @ScriptFullPath macro?)

So if for example my ranorex project's full path is:

d:\Ranorex_Projects\Project01\Project01\bin\Debug\Project01.exe


What method could I call to get this string so that I could then write it to a state file for later use?


Thanks...

Vaughan.Douglas
Posts: 250
Joined: Tue Mar 24, 2015 5:05 pm
Location: Des Moines, Iowa, USA

Re: Does Ranorex survive a Windows restart?

Post by Vaughan.Douglas » Tue Jul 12, 2016 4:12 pm

There are a bunch of ways to get the exe path programmatically. I have no idea if one is better than an other

Code: Select all

Dim appPath As String = Application.StartupPath()

Code: Select all

Dim exePath As String = Application.ExecutablePath()

Code: Select all

Dim strPath As String = System.IO.Path.GetDirectoryName( _
    System.Reflection.Assembly.GetExecutingAssembly().CodeBase)
Doug Vaughan

fester13579
Posts: 30
Joined: Thu Feb 13, 2014 10:29 pm

Re: Does Ranorex survive a Windows restart?

Post by fester13579 » Tue Jul 12, 2016 7:44 pm

Awesome thank you!!!