Object identification on Win 7 (x64) with Ranorex runtime

Ask general questions here.
christof
Posts: 19
Joined: Thu Feb 18, 2010 10:58 am

Object identification on Win 7 (x64) with Ranorex runtime

Post by christof » Mon Oct 31, 2011 10:25 am

Hi.

I am having the following problem, which is proving a little tricky to solve.
I am currently coding and building tests on a Windows 7 (x64) machine with Ranorex Studio installed. I can execute the test(s) fine on this machine - no problems there.

However, my plan is to 'push' the built .exe to a VM (on Hyper-V) with the exact same config, Windows 7 (x64) but with only the Ranorex runtime installed.

However, when I execute the tests on that machine I get the following object recognition/security issue;

Code: Select all

Ranorex.ElementNotFoundException: Failed to find item 'TestRepository.FormLogin.TextUser_name'. ---> Ranorex.ElementNotFoundException: No element found for path 'text[@accessiblename='uixUserNameTextBox']' within 10s.
--- End of inner exception stack trace ---
at Ranorex.Core.Repository.RepoItemInfo.Find[T](Boolean findSingle, Boolean throwException)
at Ranorex.Core.Repository.RepoItemInfo.CreateAdapter[T](Boolean throwException)
at 
So, I have gone through what I thought would be the obvious solutions to this, for example;
  • Ensured that the AUT and Ranorex .exe files all have permission to run as Admin
    Ensured that the 64/32 bit debug bridge is activated on the dev machine.
    Switched off UAC on both machines (completely)
    Ensure that the tested is compiled to 32 bit (as the AUT is 32 bit) and that it is compiled to .NET 4.0 (as per AUT)
    Added an app.config file and ensured that the respective .exe is in the build folder.
So I have pretty much switched off and on anything that I can think of that might effect this with no change. The AUT is a Win Forms app, and after messing around a bit I have determined that this only happens with Win Forms apps. WPF and Web are fine on the VM. If I quickly build a Win Forms interface and test that, then exact same problem occurs as with does the 'proper' AUT.
Any thoughts or ideas you could provide would be appreciated. I've run out of them.

Chris

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

Re: Object identification on Win 7 (x64) with Ranorex runtime

Post by Support Team » Mon Oct 31, 2011 11:17 am

Hi,

Did you check the troubleshooting section for WinForms?
http://www.ranorex.com/support/user-gui ... html#c3250

Please take a look to this section. I guess you have installed the full .Net 4.0 Framework on your machine and only the client framework on the vm.

Regards,
Peter
Ranorex Team
.
Image

christof
Posts: 19
Joined: Thu Feb 18, 2010 10:58 am

Re: Object identification on Win 7 (x64) with Ranorex runtime

Post by christof » Mon Oct 31, 2011 11:32 am

Hi.

Yes - I have reviews the file that you have posted a link to. I have gone through all the items given as reasons and eliminated them all as far as I can tell.

Both the physical host and the VM on which the test is being pushed to, have exactly the same setup in that it's same OS, architecture, AUT, both have .NET 4.0 Client Profile and Extended installed and security settings are exactly the same on both.

The only differences is that one is a VM and has the Ranorex runtime installed and the other is a physical machine with the full Ranorex Studio installed.

The only thing that I haven't really had chance to explore yet is whether the AUT is a mixed-mode application.
But then even if it was, I don't see why the test .exe should work fine on one machine but not on the other. Given they are the same except one is virtualised and the other not.

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

Re: Object identification on Win 7 (x64) with Ranorex runtime

Post by Support Team » Mon Oct 31, 2011 11:45 am

christof wrote:The only thing that I haven't really had chance to explore yet is whether the AUT is a mixed-mode application.
But then even if it was, I don't see why the test .exe should work fine on one machine but not on the other. Given they are the same except one is virtualised and the other not.
That is strange. Normally there shouldn't be a difference, because the Ranorex Runtime uses the sames DLLs as the Ranorex Studio. Would it be possible to post us two Ranorex Snapshot? One of the success machine and one of the failing one?

Regards,
Peter
Ranorex Team
.
Image

christof
Posts: 19
Joined: Thu Feb 18, 2010 10:58 am

Re: Object identification on Win 7 (x64) with Ranorex runtime

Post by christof » Mon Oct 31, 2011 12:43 pm

Hi.

Thanks for the prompt reply. I have posted a snapshot of the 'Logging in' form for the AUT for both the physical machine (which works fine), which I have taken with the Ranorex Spy tool.
I have also posted another snapshot which I had to get programatically using the CreateSnapshotOfElement.cs tool. This is from the VM that only has the runtime installed and has the issue.

I have had a quick peek at both the snapshots myself, and there seems to be a difference the hierarchy of the controls. The form has only simple text, button elements etc for logging into the AUT.
In the VM version of the snapshot, all of these controls seem to have an generic element parent between them and the base form.

Anyhow, I'll let you guys take a look and see what you think.

Thanks in advance.
Attachments
TestSnapshot_Win7_VM.rxsnp
No object recognition.
(299.1 KiB) Downloaded 156 times
TestSnapshot_Win7_Physical_machine.rxsnp
All fine and works.
(802.54 KiB) Downloaded 131 times

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

Re: Object identification on Win 7 (x64) with Ranorex runtime

Post by Support Team » Mon Oct 31, 2011 12:47 pm

Hi,

Thank you for the snapshots. According to your snapshots, the VM is running on .Net v 2.0.50727.5448. Did you install the .Net Framework 4.0 Full after or before you installed Ranorex?

Regards,
Peter
Ranorex Team
.
Image

christof
Posts: 19
Joined: Thu Feb 18, 2010 10:58 am

Re: Object identification on Win 7 (x64) with Ranorex runtime

Post by christof » Mon Oct 31, 2011 1:00 pm

Good question. I can't give you a definitive answer on that one, as I cannot remember the order of install.

Should I reinstall the Ranorex runtime? Or uninstall both (runtime and .NET 4.0) and if so which order would be best? According to the programs and features part of the control panel, on this VM there is not .NET 2.0 installed - just .NET 4.0. Weird.

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

Re: Object identification on Win 7 (x64) with Ranorex runtime

Post by Support Team » Mon Oct 31, 2011 1:02 pm

Hi,

Please just re-install the Ranorex Runtime, because it seems that you have installed the framework afterwards.

Regards,
Peter
Ranorex Team
.
Image

christof
Posts: 19
Joined: Thu Feb 18, 2010 10:58 am

Re: Object identification on Win 7 (x64) with Ranorex runtime

Post by christof » Mon Oct 31, 2011 1:37 pm

Hi Peter.

The reinstall of the Ranorex runtime seems to have done the trick. I didn't realise the order of installation (runtime, .NET 4.0) was so important, but I guess you learn a new thing every day.

Thanks for the help.

Chris.

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

Re: Object identification on Win 7 (x64) with Ranorex runtime

Post by Support Team » Mon Oct 31, 2011 6:46 pm

christof wrote: I didn't realise the order of installation (runtime, .NET 4.0) was so important, ...
If .NET 4.0 is not installed, Ranorex cannot install assemblies specifically compiled for .NET 4.0, simply because there is no framework we could install these assemblies to. That's why you have to re-install Ranorex after adding the .NET Framework 4.0.
christof wrote:...on this VM there is not .NET 2.0 installed - just .NET 4.0. Weird.
The 4.0 version includes the 2.0 version of the .NET Framework :)

Regards,
Alex
Ranorex Team
.
Image