Ranorex crashing application in Virtual Machine

Ask general questions here.
tallahassee101
Posts: 169
Joined: Thu Jan 13, 2011 2:06 pm

Ranorex crashing application in Virtual Machine

Post by tallahassee101 » Mon Mar 07, 2011 6:20 pm

Hi,

I have an application that I am running a set of Ranorex tests on with Windows 7 and Windows XP. Whenever I run the tests on my local machine it does not crash. However when I run the ranorex tests on a Virtual Machine the application crashes after about 5 minutes of testing. Going through the exact same set of tests by hand on the virtual machine does not crash the application.

Thank you for your help

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Ranorex crashing application in Virtual Machine

Post by Ciege » Mon Mar 07, 2011 8:16 pm

Is it your AUT that is crashing, Ranorex crashing or just the automated script failing?

If actual AUT/Ranorex crashes, have you checked your Windows logs for anything out of the ordinary?
If script failing, have you surrounded your tests in try/catch blocks to catch exceptions? Also, since moving to a VM machine, things tend to run a little to a lot slower than on actual hardware so you may need to tailor your code a little to check for AUT ready states and valid elements before "doing stuff".
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

tallahassee101
Posts: 169
Joined: Thu Jan 13, 2011 2:06 pm

Re: Ranorex crashing application in Virtual Machine

Post by tallahassee101 » Tue Mar 08, 2011 8:07 pm

The Application software that is being tested is what is crashing. However under manual testing (human entering the commands and clicking the buttons ) of the same set of tests, the crash does not occur.
I'm not sure what you mean by checking for AUT ready states every time we "do stuff". Its pretty unfeasible to double our test code size by adding a ready check before each ranorex command.

The other problem is that not only does the Application crashes, but Ranorex freezes on checking for the item it was trying to click on as well, searching for it indefinitely. I have code that will handle an application crash, but Ranorex never gets to it because it won't fail to find the item it was trying to click (even though there are 10-30s timeouts on the objects.

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Ranorex crashing application in Virtual Machine

Post by Ciege » Wed Mar 09, 2011 5:53 pm

tallahassee101 wrote:I'm not sure what you mean by checking for AUT ready states every time we "do stuff". Its pretty unfeasible to double our test code size by adding a ready check before each ranorex command.
Well that all depends on how you've structured your automation code. If you've setup a framework of common methods (i.e. a click method that you call passing in a parameter denoting what object to click) then you need only put the ready state check one time in that method to solve each potential click issue. If on the other hand you have strewn about several specific clicks in your automation code, then indeed it would be a pain to solve each potential issue. (Note I am using click as an example, this is true for any reputed interaction with your AUT - You can create generic methods for each type of interaction then when/if you need to maintain or modify that code you only do it once in one place.)

However, by checking the status of your AUT before doing something is one thing that needs to be done. You do it manually (subconsciously you look at your AUT and do not click a button unless it exists, in test automation you need to teach the automated code to also "look before it leaps".


Again, I ask, have you checked your logs for reasons behind the crash?
Have you surrounded your test code with try/catch blocks to catch any potential errors or exceptions?
Are you changing OS from the physical machine to the VM (i.e. from XP to W7)?
Do you know the line or block of code that is causing the failure? Can you share it?
Have you run your tests in debug mode and stepped through to the failure to determine where the issue is originating?
Etc...
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

Re: Ranorex crashing application in Virtual Machine

Post by sdaly » Wed Mar 09, 2011 7:38 pm

Are you using RawText in any of your scripts?

tallahassee101
Posts: 169
Joined: Thu Jan 13, 2011 2:06 pm

Re: Ranorex crashing application in Virtual Machine

Post by tallahassee101 » Wed Mar 09, 2011 7:42 pm

I have checked our output logs and the ranorex logs and have not found anything helpful.
The test code is not surrounded by try/catch as the code is located inside the generated CS files.
I am using Windows 7 on both my local machine and the VM
Two of the crashes I witnessed just today happened while trying to click a button that is in our toolbar (always visible in the AUT).
So the code in the CS file is:
Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'Form.Button_Center_on_Site' at Center.", repo.Form.Button_Center_on_SiteInfo, new RecordItemIndex(0));
repo.Form.Button_Center_on_Site.Click();
Delay.Milliseconds(200);
Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'Form.ButtonSet_Range' at Center.", repo.Form.ButtonSet_RangeInfo, new RecordItemIndex(1));

Our ranorex log will show the first line and then the AUT crashes with a windows error dialog box popping up and the AUT being grayed out. Ranorex then will sit forever trying to run the second line of code and the next log does not print out. I let it sit for over 10 minutes before manually dismissing the windows error dialog which closed the AUT. The ranorex script then starts back in as if it had never stopped and returns an error on finding the Button_Center_On_Site it was trying to click on.

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

Re: Ranorex crashing application in Virtual Machine

Post by Support Team » Thu Mar 10, 2011 10:47 am

Are you using the GDI/RawText plugin?
Does your application crash when you track that toolbar button with Ranorex Spy?
What version of Ranorex do you use?

Could this issue be related to the MSAA implementation of your application like in your previous forum post?
What happens if you use a screen reader (like the Narrator included in Windows) on the toolbar button?

Regards,
Alex
Ranorex Team
.
Image

tallahassee101
Posts: 169
Joined: Thu Jan 13, 2011 2:06 pm

Re: Ranorex crashing application in Virtual Machine

Post by tallahassee101 » Thu Mar 10, 2011 8:52 pm

No we do not use the GDI/RawText plugin.
No the application does not crash when tracking the button with Spy.
I am using Ranorex 3.0.

I do not think this relates to the MSAA implementation, because it does not happen every time.
Screen reader read off the tool tips on our buttons when I hovered over them, no crashes.

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Ranorex crashing application in Virtual Machine

Post by Ciege » Thu Mar 10, 2011 10:00 pm

Hmmm, curiouser and curiouser...

Does this happen to be a web app? I.e. accessed through a browser?
Can you try disabling UAC on the machine that it is crashing on?

The "Ranorex freeze" sounds like it has tried to interact with the AUT but the AUT is in a busy state and has not responded so Ranorex is tied up waiting for the AUT to respond, thus the freeze.

Before your click can you do a Find on that element first and verify it can be found.
Also surround your code snippet with a try/catch and check for any thrown exception.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...