Page 1 of 1

Does Ranorex survive a Windows restart?

Posted: Tue Jul 21, 2015 2:40 pm
by a_schatzer
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

Re: Does Ranorex survive a Windows restart?

Posted: Tue Jul 21, 2015 2:59 pm
by krstcs
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!!!

Re: Does Ranorex survive a Windows restart?

Posted: Mon Jul 11, 2016 10:57 pm
by fester13579
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...

Re: Does Ranorex survive a Windows restart?

Posted: Tue Jul 12, 2016 4:12 pm
by Vaughan.Douglas
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)

Re: Does Ranorex survive a Windows restart?

Posted: Tue Jul 12, 2016 7:44 pm
by fester13579
Awesome thank you!!!