Does Ranorex purge resource not accessed after X minutes?

Class library usage, coding and language questions.
User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Does Ranorex purge resource not accessed after X minutes?

Post by Aracknid » Mon Mar 09, 2015 8:21 pm

Hello,

Sorry, but I don't know how to word this very well. I noticed that when I went from Ranorex 4.0.06 to 5.2.x, I started having a lot of issues with my scripts trying to connect my main browser DOM AFTER some time had gone by. I tried to understand why, and as far as I can tell, it just seems like it forgot about it.

So what I am doing is running in VS2012 with the Ranorex API. In my code, when I connect to my browser DOM, I store the DOM in a class as a Ranorex.WebDocument object. I also store the Form that contains the DOM as a Ranorex.Form object. When I try to act upon my DOM (like click something), I always use the class variable for the DOM to find other elements off of this object. It works fine most of the time in 5.2.x BUT it Always worked in 4.0.6. When it fails in 5.2.x, I can step into my code and see that the DOM is basically dead. It knows nothing about it or its contents.

In another thread, I posted something about this in a different way, and someone suggested that the DOM must have changed and therefore I would need to re-find it. I did this and it mostly solved my problem.

BUT now I'm finding if I happen to put a breakpoint in a place right after I find it (or re-find it) and go get a coffee for about 15 minutes, when I come back and try to continue my code, it has lost the DOM object.

So I'm wondering what is going on? Someone I work with suggested maybe there was some sort or purge of Ranorex resources that are not accessed often (in a while) or some sort of garbage collection in the code. Is this possible, and if so can I disable it?

Thanks,

Aracknid.

User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Does Ranorex purge resource not accessed after X minutes?

Post by Aracknid » Tue Mar 10, 2015 8:30 pm

Just wanted to add some more info...

We are using Windows 7 SP1 with IE 11 (current version is from windows update a bout 2 or 3 weeks ago... 11.0.9600.17633). This VM has also all windows updates from about 2-3 weeks ago.

The problem also occurs when the script is compiled and run as an EXE. What I mean is that if I don't re-connect in my code, it will fail to work at times. A typical example is the main window launches another IE window in which I do some stuff for a while. When I dismiss the window and want to work again in the main window (could be about 5 minutes) it is dead unless I reconnect to it.

In general this is a big problem for us, especially in how we work. Often I'll have multiple VM's open running scripts in VS2012, with breakpoints set (I'm trying to debug them and find out why they are failing) and when I focus on one VM and the problem and then move to the other VM, the breakpoint has been sitting there for a while and the objects are dead... so I cannot same time an run up to certain points...

Aracknid

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3945
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Does Ranorex purge resource not accessed after X minutes?

Post by odklizec » Tue Mar 10, 2015 8:50 pm

Hi,

I can't help you with your problem, but it reminds me a behavior I recently noticed with spy. I never noticed it before, but I'm working with web automation for over a month :) In my case, the problem happens when I track an element with spy, than I leave both browser and spy open and switch to another app. After a while, when I return to spy, do some changes in the path and confirm them, then instead of finding the appropriate element, the spy resets as if the DOM does not exists? But it's definitely there. Just not visible/accessible to the actual instance of spy. I will try to reproduce it tomorrow.

BTW, I'm using Ranorex 5.2.3.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3945
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Does Ranorex purge resource not accessed after X minutes?

Post by odklizec » Wed Mar 11, 2015 1:20 pm

OK, I tried to reproduce the behavior with Spy and it definitely happens if the spy with predefined path is not used for a while. When used again and the path is confirmed (by Enter), the content of Browser & Results list disappears and it requires another confirmation of the path or using Refresh button to restore it back. It's easy to press Refresh or re-confirm the path in Spy, but if the same happens with paused code (without the way to restore the content of DOM), it's definitely not nice behavior.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Does Ranorex purge resource not accessed after X minutes?

Post by Aracknid » Wed Mar 11, 2015 2:00 pm

Thank you both for adding to my post. I believe the issue in spy is the same I'm experiencing, since under the covers it is using the same Ranorex code (I would assume).

Ranorex, please look into this and provide a fix ASAP. It is really causing a problem for me with my day to day job. And the timing is not great for us... we are trying to get a release out and the dependency on my automation is very high...

thanks,

Aracknid.