Ranorex.ExcelWorkSheet() function crashes on Windows 2003

Bug reports.
roman.lutsiv
Posts: 4
Joined: Wed Nov 28, 2012 4:54 pm

Ranorex.ExcelWorkSheet() function crashes on Windows 2003

Post by roman.lutsiv » Wed Nov 28, 2012 5:12 pm

Hello Ranorex Support team,

We have faced an issue with Ranorex.ExcelWorkSheet() function that crashes if used in testing scenario that is executed on Windows 2003 box (English locale, x64 bit), with Office 2010 (English, x86 bit).

The following FatalExecutionEngineError is thrown:
The runtime has encountered a fatal error. The address of the error was at 0x7934e109, on thread 0x3b0. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.
We are using the latest version of Ranorex (3.3.4).

The following script may be used to reproduce an issue:

Code: Select all

        public bool TestCase()
        {
            bool result = true;
            string pathToFile = "C:\\workbook_with_rm_formula.xls";

            Process.Start(pathToFile);

            //Initializing excel workSheet
            Ranorex.ExcelWorkSheet sheet = new Ranorex.ExcelWorkSheet("/form[@processname='EXCEL']/element[@class='XLDESK']/workbook/table[@name='model1']");
            //Initializing excel cell
            Cell excelCell = sheet.FindSingle<Cell>(".//cell[@address='I18']");
            excelCell.Click();

            //Verify value in cell
            if (excelCell.Text != "120")
            {
                result = false;
            }


            try
            {
                Process[] excelProcess = Process.GetProcessesByName("excel");

                foreach (Process excelProc in excelProcess)
                {
                    excelProc.Kill();
                }
            }
            catch { logger.Warn("Excell process was not killed"); }

            return result;
        }
"workbook_with_rm_formula.xls" file referenced in this script is provided as the attachment.

Could you please check and let me know if we are doing anything wrong here?

Thank you in advance.

Note: This issue is not reproducible on very similar box: Windows 2003 box (English locale, x64 bit), with Office 2007 (English, x86 bit)
Everything works fine on set of Windows 7 / Windows 2008 / Windows XP machines. Windows 2003 with Office 2010 is the only one affected.
Attachments
workbook_with_rm_formula.zip
zip archive with a model to reproduce the issue
(8.5 KiB) Downloaded 199 times
Last edited by roman.lutsiv on Thu Nov 29, 2012 11:45 am, edited 1 time in total.

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

Re: Ranorex.ExcelWorkSheet() function crashes on Windows 2003

Post by Support Team » Thu Nov 29, 2012 10:49 am

Hi,

The file is unfortunately not attached.
Do you know which line of code throws the FatalError?
Are there also any other problems on that machine?
Is the "Target CPU" set to "32-bit" in the Compiling setting of your Ranorex project?

Regards,
Markus
.
Image

roman.lutsiv
Posts: 4
Joined: Wed Nov 28, 2012 4:54 pm

Re: Ranorex.ExcelWorkSheet() function crashes on Windows 2003

Post by roman.lutsiv » Thu Nov 29, 2012 12:21 pm

Hello,

Sorry for missing an attachment - I did not notice a warning that .xls extension is not allowed. I have attached zip archive containing a file.

Answers for your questions:
Do you know which line of code throws the FatalError?
Yes, that's Ranorex.ExcelWorkSheet sheet = new Ranorex.ExcelWorkSheet("/form[@processname='EXCEL']/element[@class='XLDESK']/workbook/table[@name='model1']"); - the issue is in Ranorex.ExcelWorkSheet() function
Are there also any other problems on that machine?
Windows 2003 proved to be a very special case for us. We had to modify number of scenarios to workaround some specifics of Ranorex behavior on Windows 2003 boxes. All other versions of Windows we use (XP, 2008, 2008R2, Vista and 7) did not have this kind of problems:
1. Load any application that has possibility to Load / Open files. Load "Open File" dialog (standard Window's dialog is opened). Click into "File name" field - Ranorex SPY will hang the system.
Workaround we have implemented was to not click into "File Name" field but enter file name immediately after opening "Open File" dialog because "File Name" field has a focus on it by default
2. The same is true for any combobox field - you can click it, but focusing on it would cause Ranorex to hang up a system.
Is the "Target CPU" set to "32-bit" in the Compiling setting of your Ranorex project?
Nope, "Target CPU" is set to "Any CPU" as we execute testing scenarios on 32/64 bit machines and use appropriate Ranorex instance for that (x32/x64). Do you anticipate any problems because of that?

Thank you

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

Re: Ranorex.ExcelWorkSheet() function crashes on Windows 2003

Post by Support Team » Thu Nov 29, 2012 4:18 pm

Hello,

Unfortunately, we couldn't reproduce your issue.

Please let us know which .NET Framework version is installed on your system.
Have you installed Ranorex with setup.exe?
Are all prerequisites of Ranorex installed (System Requirements)?

Ranorex can as well run as a 32 bit or 64 bit process, both versions are included in the setup. In general, one should use the Ranorex version that matches the bit architecture of the automated application.
If your automated application is a 32-bit application please give it a try to change your Target CPU to use 32-bit in the properties of your project.

Regards,
Markus (T)
.
Image

this_is_ridiculous
Posts: 27
Joined: Tue Apr 27, 2010 10:33 pm

Re: Ranorex.ExcelWorkSheet() function crashes on Windows 2003

Post by this_is_ridiculous » Fri Nov 30, 2012 11:17 am

Hello.
Please let us know which .NET Framework version is installed on your system.
We have all of them installed.
In general, one should use the Ranorex version that matches the bit architecture of the automated application.
Yeah, we are aware of this. However let's consider the next situation. We have a x64 version of Windows and x86 version of tested application. This app uses default Windows dialogs for openning/saving files and browsing for folders. As far as Windows architecture is x64 the dialogs will be the same due to to explorer.exe is x64. So when a 32 bit app invokes open file dialog there should be happening some kind of bitbridging between app and the OS. So we assume that we should use x64 Spy to work with that dialog and its controls. And when actually using it everything is fine. But if using x86 version of Spy system stops responding to any kind of iput. We've been discussing this kind of issue here http://www.ranorex.com/forum/post17093.html#p17093

Targeting the build of application is not an option for us because of CI happnening of TFS so we get solution built automatically and the same output package is used on both architectures of product. However we can try to force it on dev machines. And I assume that this will force Spy to the target build architecture while runtime (please correct me if I'm wrong, just assuming here). So assumming again if we force the Spy runtime to desired architecture will this be the same as forcing build target?

Artem.

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

Re: Ranorex.ExcelWorkSheet() function crashes on Windows 2003

Post by Support Team » Fri Nov 30, 2012 4:01 pm

Hello Artem,

This behavior is weird.
Which Ranorex version are you using?

We would need your application or a sample application in order to reproduce this issue.
Please send it to [email protected]

Could you please post a Snapshot of your application?
Info: Creating Ranorex Snapshot Files
http://www.ranorex.com/support/user-gui ... files.html

Regards,
Markus (T)
.
Image

this_is_ridiculous
Posts: 27
Joined: Tue Apr 27, 2010 10:33 pm

Re: Ranorex.ExcelWorkSheet() function crashes on Windows 2003

Post by this_is_ridiculous » Fri Nov 30, 2012 4:40 pm

Hello.

We're using v.3.3.4

By the way Rroman Lutsiv and me are teammates :). So we share the problem.

I don't think we can send you neither a snaphot of our app nor the app itself. But maybe our dev team could come up with some sort of a very simple application that does the same. However I think this can't happen until monday...

I agree with you concerning weird behavior. This happens on Windows 2003 x64 and 32 bit version of product only.

Artem.

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

Re: Ranorex.ExcelWorkSheet() function crashes on Windows 2003

Post by Support Team » Fri Nov 30, 2012 4:44 pm

Hello,

Thank you for your information.

It would be great if you can provide such a sample application.

Regards,
Markus (T)
.
Image

this_is_ridiculous
Posts: 27
Joined: Tue Apr 27, 2010 10:33 pm

Re: Ranorex.ExcelWorkSheet() function crashes on Windows 2003

Post by this_is_ridiculous » Fri Nov 30, 2012 5:54 pm

Hello again!

So I can provide you some steps to reproduce the behavior.
1) Windows Server 2003 SP2 x64
2) all version of .Net (except v 4.5) with SPs
3) Ranorex 3.3.4 (with all of prerequisities)
4) You can use Adobe Acrobat reader of version 7.0.7 (I assume there's only x86 version available)
5) start Acrobat reader and Spy (32 bit)
6) click File -> Open
7) try detecting File Name combobox
8) see the effect

Also please see the attached screenshot.

Artem.
Attachments
2k3.JPG
2k3.JPG (58.82 KiB) Viewed 1481 times

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

Re: Ranorex.ExcelWorkSheet() function crashes on Windows 2003

Post by Support Team » Mon Dec 03, 2012 1:45 pm

Hello,

Unfortunately, we couldn't reproduce this issue (followed your steps).
I installed Windows Server 2003 x64 SP2, Adobe Reader 7.0.7 and successfully tracked 'File name" textbox.
Please take a look at installed programs on my computer as shown below.
Windows2003_AddedPrograms.JPG
Windows2003_AddedPrograms.JPG (78.36 KiB) Viewed 1459 times
Could you please start 'Accessibility Setup Assistant' in Adobe Reader Help menu?
Please select 'Use recommended settings and skip setup' as shown below.
AdobeReader_AccessibilitySetup.JPG
AdobeReader_AccessibilitySetup.JPG (40.1 KiB) Viewed 1459 times
You could also try to reinstall .NET Framework packages.

Regards,
Markus (T)
.
Image

this_is_ridiculous
Posts: 27
Joined: Tue Apr 27, 2010 10:33 pm

Re: Ranorex.ExcelWorkSheet() function crashes on Windows 2003

Post by this_is_ridiculous » Mon Dec 03, 2012 2:12 pm

Hi!

Thanks for the reply.
You could also try to reinstall .NET Framework packages.
I think this should help solving the problem. I will retry the same test on another setup of Win2k3 x64 and will let you know the results.

Also I will completely reinstall all of .Net redists on the previously menchioned machine and try again there.
Could you please start 'Accessibility Setup Assistant' in Adobe Reader Help menu?
This doesn't really help us in any way. We proposed this as the required steps to invoke the problematic (in our case) dialog. So you could try it on your own.

Also settning accessibility option of Adobe Reader doesn't change a thing for Spy.

Regards!
Artem.

rezme
Posts: 15
Joined: Thu Feb 20, 2014 8:40 pm

Re: Ranorex.ExcelWorkSheet() function crashes on Windows 2003

Post by rezme » Wed Apr 09, 2014 2:17 pm

I'm experiencing something similar to the issue above on Ranorex 4.1.5. When my application spawns a file browser dialog, I am unable to interact with the "File Name" dropdown of the file browser object without Ranorex quitting entirely.

Image

Here are the repro conditions:
Machine: VM on VirtualBox 4.3.6 r91406
OS: Server 2003 R2 x64
DotNet versions installed: 2.0 SP2, 3.0 SP2, 3.5 SP1, 4
Ranorex version: 4.1.5

I discovered this while attempting to test the ability to choose a custom tray icon for our application. In the process of performing this action, the application spawns a file browser dialog to allow the user to choose a custom icon. Everything works fine on server 2008, but when I try to run the test project on Server 2003 it hangs at the point that it would be inputting the path to the custom icon file in the file browser dialog.

In troubleshooting this, I attempted to use Spy from within the Ranorex suite to track the "File Name" field on the File Browser dialog. As soon as my mouse cursor hovered over the textbox for the File Name field, Ranorex crashed. When I say crash, I mean that it completely quit out, leaving an event viewer message showing a critical error (text of the event is pasted below)

Image
Event Type: Error
Event Source: Application Error
Event Category: (100)
Event ID: 1000
Date: 4/9/2014
Time: 8:47:31 AM
User: N/A
Computer: WIN2003R2X64
Description:
Faulting application RanorexStudio.exe, version 4.1.5.17134, faulting module clr.dll, version 4.0.30319.1, fault address 0x002b5b8c.

For more information, see Help and Support Center at {URL DELETED BECAUSE I'M NOT ALLOWED TO POST THEM YET}.
Data:
0000: 41 70 70 6c 69 63 61 74 Applicat
0008: 69 6f 6e 20 46 61 69 6c ion Fail
0010: 75 72 65 20 20 52 61 6e ure Ran
0018: 6f 72 65 78 53 74 75 64 orexStud
0020: 69 6f 2e 65 78 65 20 34 io.exe 4
0028: 2e 31 2e 35 2e 31 37 31 .1.5.171
0030: 33 34 20 69 6e 20 63 6c 34 in cl
0038: 72 2e 64 6c 6c 20 34 2e r.dll 4.
0040: 30 2e 33 30 33 31 39 2e 0.30319.
0048: 31 20 61 74 20 6f 66 66 1 at off
0050: 73 65 74 20 30 30 32 62 set 002b
0058: 35 62 38 63 5b8c
To further test where this is occurring, I built a simple C# Windows application that does nothing more than spawn a file browser dialog and pass the resulting file path to a textbox on the form. The behavior when trying to track the same element of the UI on that simple app is exactly the same as with my application under test. I recorded a video using SnagIT to demonstrate this. It's located in the attached zip file.

This issue does not repro when attempting to cause it using the standalone spy. It's only when the spy is used from within the Ranorex test suite that a problem occurs. Interestingly, when I recorded the issue occurring, a dialog displayed for just a couple of seconds at the top right of the screen (see below) stating something about a technology limitation with Ranorex.

Image

I've attempted this with three different versions of my little test app (using DotNet 3.0, 3.5, and 4.0) and the same occurs across all three. I'm attaching all three versions of that application, the video of the issue occurring, and a snapshot of the object in question.
Attachments
file browser dialog issue.rar
Password for the file is "ranorex" with no quotes
(655.75 KiB) Downloaded 98 times

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

Re: Ranorex.ExcelWorkSheet() function crashes on Windows 2003

Post by Support Team » Thu Apr 10, 2014 3:15 pm

Hello rezme,

Please ensure that you build your Ranorex tests with the correct bit version(32 bit, 64 bit), so please check the selected “Target CPU” within the compile option of your test.

When you are tracking elements with the Spy also ensure you use the right bit version(x32, x64).
For further information, please visit: http://www.ranorex.com/support/user-gui ... forms.html

Another error source could be an inconsistent Ranorex installation. Please uninstall Ranorex, restart the machine and re-install Ranorex to ensure a proper installation.

Regards,
Robert
.
Image