How to handle application restarts

Ask general questions here.
rx1337
Posts: 2
Joined: Mon May 04, 2009 6:22 am

How to handle application restarts

Post by rx1337 » Mon May 04, 2009 6:29 am

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.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Post by Support Team » Mon May 04, 2009 1:07 pm

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

rx1337
Posts: 2
Joined: Mon May 04, 2009 6:22 am

Post by rx1337 » Mon May 04, 2009 3:37 pm

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!