Page 1 of 1

How to handle application restarts

Posted: Mon May 04, 2009 6:29 am
by rx1337
Hello,

I'm trying to put together an automation that restarts the target application frequently, without interrupting a loop that runs through a bunch of rows. As it is, after a restart, the locations of the rows are not correct anymore. I'm using a repository, is there a procedure to refresh it with the new instance of the app?

Thank you.

Posted: Mon May 04, 2009 1:07 pm
by Support Team
There is no need to refresh the repository, the repository will automatically work on the current instance of your application. You just have to make sure that the path of the application folder in your repository corresponds to the freshly started application instance.
The screen position of the application does not matter either, as Ranorex does not rely on coordinates to find UI elements.

Regards,
Alex
Ranorex Support Team

Posted: Mon May 04, 2009 3:37 pm
by rx1337
For reference, I managed to work around the issue. My issue was not with the repository but rather that my instances of the Row objects generated in a foreach loop were not current after a restart, and would not behave correctly. Doing a row.Click() would send the cursor in a crazy place (0, 0 on the screen it seems). I had to refer to my Rows with an index ("rows") in a for loop and it worked perfectly, because the parent object is straight from the repository. I just had to refresh the parent from the repository after a restart.

Hope it helps someone one day!