Object recognition mismatch (Container/Element)

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
enrico.milani
Posts: 2
Joined: Fri Jul 30, 2021 11:49 am

Object recognition mismatch (Container/Element)

Post by enrico.milani » Fri Jul 30, 2021 12:07 pm

Hello,
in our team, there are two guys working on the same project/application. We are experiencing a very strange situation: the same object in the application under test is recognized differently on the two machines.


First test environment:
container[@controlname='splitContainerControl']/container[@controlname='panel2']//element[@controlname='RecipeManagementPage']

Second test environment:
container[@controlname='splitContainerControl']/container[@controlname='panel2']//container[@controlname='RecipeManagementPage']

Looking at the differences between the two test environments, we've not found anything relevant (same OS version, same .NET libraries, same project compile parameters, etc), but one thing is evident: on the machine where the item is recognized as an 'element', the item shows an additional property 'controName' under the category "ControlNet11", which is not present on the machine where the item is detected as a 'container'.

We've tried to work on the XPath, using //preceding-sibling::container as the last part of the path to skip the "problematic" object, but still, on the machine recognizing it as a 'container', it doesn't solve the point.

Has anyone met a similar problem and/or have any idea on how to solve this?


Ranorex 9.5.1
Win Server 2016
.NET 4.6.2 SDK
C# 5.0
The application under test is a desktop 64-bit application using DevExpress.

Thanks to anyone that might be able to help on this

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

Re: Object recognition mismatch (Container/Element)

Post by odklizec » Fri Jul 30, 2021 1:42 pm

Hi,

Problem like this is occasionally discussed, unfortunately, it's hard to find the relevant posts ;) However, the root source of issue is either a small difference between problematic machines or different Ranorex settings (if Ranorex Settings are not stored within the solution).

What you can try (aside reinstalling .Net and runtime libs) is to replace Element/Container keyword with '*' character. This will assure that the element is found, regardless it's identified as Element or Container. Hope this helps?

Code: Select all

container[@controlname='splitContainerControl']/container[@controlname='panel2']//*[@controlname='RecipeManagementPage']
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

enrico.milani
Posts: 2
Joined: Fri Jul 30, 2021 11:49 am

Re: Object recognition mismatch (Container/Element)

Post by enrico.milani » Tue Aug 03, 2021 7:38 am

Hello Pavel,
Your suggestion worked properly. I was a bit afraid about the possible slow down that the usage of the wildcard would introduce in the object recognition at runtime, but it appears to be very efficient.

Thanks a lot!