Ranorex could not identify any controls after sometime

Class library usage, coding and language questions.
balajichandan
Posts: 24
Joined: Tue Apr 14, 2009 12:29 pm

Ranorex could not identify any controls after sometime

Post by balajichandan » Tue May 12, 2009 6:31 am

Hi,
I am using Ranorex 1.5 version. I have a strange scenario. I have automated my application with 180+ test cases using Ranorex for identifying controls. When I run my suite against Windows XP and Office 2007 environment I could not execute my suite after some time as Ranorex could not identify or continue running the suite.

The same suite works fine with Windows Vista and Office 2007. Is there anything specific to Windows XP with regard to Ranorex.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Post by Support Team » Wed May 13, 2009 4:24 pm

No, Ranorex does not have code specific to Windows XP, but MS Office might have...
Did you try setting Element.EnableCaching to false?

Could you please give us some more information on the element you are searching for, e.g. the control you are searching in, how you are searching for the element, you code, ... Then we might be able to run a few tests.

Regards,
Alex
Ranorex Support Team

balajichandan
Posts: 24
Joined: Tue Apr 14, 2009 12:29 pm

Post by balajichandan » Mon May 25, 2009 6:48 am

We have not explicitly set Element.EnableCaching to true. Ranorex documentation does not say what is the default value.

We query for many controls in Outlook like dialogs for eg., Tools->Customize dialog and Tools->Options dialog. We tried commenting the code where we check for these dialogs and controls inside them. But it will end up saying someother control is not found.

Earlier, we used Ranorex on XP/OL 2K7 and XP/OL 2K3. But we did not face issues. After adding more test cases into our suite, we start seeing this issue. If we run more than 45 test cases Ranorex is bound to fail saying 'control is not found'.

I feel that RanorexSpy.dll got corrupted during the execution of my suite.
Is there a way to check this?

This is really causing problem for us. This prevents us from continuing with automating our application.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Post by Support Team » Mon May 25, 2009 11:32 am

The default of Element.EnableCaching is true.

What do you mean with "RanorexSpy.dll got corrupted"? Do you change the RanorexSpy.dll in your code?

Are all you tests run in a single process or do you start a new process for each test? If you execute all your tests within a single process/executable, you coud try to divide your test suite into multiple executables called one after another.

Regards,
Alex
Ranorex Support Team

balajichandan
Posts: 24
Joined: Tue Apr 14, 2009 12:29 pm

Post by balajichandan » Mon May 25, 2009 12:07 pm

We can try by setting Element.EnableCaching to false.

We do not change anything with respect to RanorexSpy.dll. What I mean by corrupted is if that dll get unregistered for some reason, then it would not identify any controls.

Is there any way to ensure that the dll does not get unregistered.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Post by Support Team » Mon May 25, 2009 4:09 pm

Can you please specify what you mean by "unregistered"? The RanorexSpy.dll is loaded when it's first needed by the RanorexNet.dll and unloaded when the process dies.
balajichandan wrote:I feel that RanorexSpy.dll got corrupted during the execution of my suite.
Where does this feeling come from? Is there an exception thrown mentioning the RanorexSpy.dll?

And did you try dividing your test suite into multiple executables?

Regards,
Alex
Ranorex Support Team

balajichandan
Posts: 24
Joined: Tue Apr 14, 2009 12:29 pm

Post by balajichandan » Tue May 26, 2009 6:15 am

If RanorexSpy.dll is a COM dll then it needs to be registered in registry. If it is COM dll, i am trying to understand if it gets unregistered or unloaded from memory for any reason. This could be the reason for failing controls when i run my Automation Suite for sometime.

As I mentioned, this is happening only on Windows XP but not on Windows Vista. We do not see any exception thrown mentioning RanorexSpy.dll. But still, it fails to identify controls in Outlook.

Moreover, I wanted to know if I my Automation Suite grows bigger, should I break it to multiple executables?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Post by Support Team » Tue May 26, 2009 11:08 am

RanorexSpy.dll is not used as a COM dll, so it is not registered or deregisterd by Ranorex.

Identifying UI elements uniquely with Ranorex 1.5 is not as easy as in Ranorex 2.0 due to the missing RxPath. You might want to try out Ranorex 2.0 on your Outlook controls.

In general, there is no need to break up automation suites into smaller executables. However, if you experience problems, this could be a way to try to resolve them.

Regards,
Alex
Ranorex Support Team

balajichandan
Posts: 24
Joined: Tue Apr 14, 2009 12:29 pm

Re: Ranorex could not identify any controls after sometime

Post by balajichandan » Thu Jun 18, 2009 11:57 am

Adding one more scenario for the same behaviour.

Whenever we get AccessViolation error specifying message "Attempted to read or write protected memory ..." we are closing Outlook and relaunching it. Then onwards Ranorex could not identify any control in Outlook. If we manually interact with Outlook during this time, it responds and we can select menus etc.

I observed the same behaviour in XP/Outlook 2003, XP/Outlook 2007 and Vista/Outlook 2007 environments.
Has anyone observed this behaviour.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Ranorex could not identify any controls after sometime

Post by Support Team » Fri Jun 19, 2009 3:57 pm

We will provide another service release (Ranorex V1.5.2) for existing 1.X customers next week that addresses memory issues like the AccessViolationException some users reported with Ranorex V1.X versions. Ranorex 1.X versions are available to existing Ranorex 1.X customers only and can be requested by sending an email to support_at_ranorex.com.

Regards,
Alex
Ranorex Support Team

balajichandan
Posts: 24
Joined: Tue Apr 14, 2009 12:29 pm

Re: Ranorex could not identify any controls after sometime

Post by balajichandan » Tue Jun 23, 2009 2:55 pm

Hi,
As suggested by support team, I got links to download 1.5.1.5519 and 1.5.2 versions. I tried both of them on XP/Office 2003 and XP/Office 2007 respectively. But still I could see the issue happening. I used RanorexNet and RanorexCore of same version. Any other things I should do apart from using RanorexNet and RanorexCore dlls.

It is blocker for us to proceed further using Ranorex for our Automation.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Ranorex could not identify any controls after sometime

Post by Support Team » Tue Jun 23, 2009 4:10 pm

The Ranorex version 1.5.2 introduces the new method Application.ResetRanorexCore which completely resets the Ranorex Core library. Please, try to call this method in between your test cases!
You have to consider, though, that all of the Ranorex settings are gone after calling that method and that all Element instances are invalid. So, you should only call this method in between test cases that are completely independent from each other and do all the test set-up stuff on their own.

Regards,
Alex
Ranorex Support Team

balajichandan
Posts: 24
Joined: Tue Apr 14, 2009 12:29 pm

Re: Ranorex could not identify any controls after sometime

Post by balajichandan » Wed Jun 24, 2009 12:56 pm

Hi,
I tried using Application.ResetRanorexCore(). This is how I used this function with Ranorex 1.5.2.

There is an initialization function for each test case. This will be called before running any test case. I used Application.ResetRanorexCore() in this function, so that this will not affect the next test case. Moreover I found that functions of 'Logger' class is not working with 1.5.2. We could not see log messages in our log. But with Ranorex 1.5, we could see logging properly.

I have tried the same on both XP/Office 2003 and XP/Office 2007 environments and still could see access violation issue.

Is there any way to handle this exception?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Ranorex could not identify any controls after sometime

Post by Support Team » Wed Jun 24, 2009 8:27 pm

Can you please try the following:
Divide your test suite into multiple executables and call one after another. Make some small EXEs instead of one long EXE. One long script can cause resource problems on your machine, this should not happen if you use a smaller EXEs.

We also use XP with Office 2007? It would help us to analyse the problem if we could reproduce this issue. Can you please send us a sample script and a description how to reproduce this problem?

Jenö
Ranorex Team

balajichandan
Posts: 24
Joined: Tue Apr 14, 2009 12:29 pm

Re: Ranorex could not identify any controls after sometime

Post by balajichandan » Thu Jun 25, 2009 7:30 am

This exception is seen randomly in our Automation Suite. Our Automation suite is a .NET class library (dll) and is called from NUnit. NUnit is front end for us. Automation suite is developed for our product which is integrated with Outlook. We support multiple versions of Outlook like 2003, 2007 and Office XP. We support multiple OSs like Vista, XP also. So, I could not specify the exact scenario where it throws this access violation exception.

But I already provided a sample application to the support team earlier. It has code the way Ranorex is used.