Page 1 of 1

Object recognition mismatch (Container/Element)

Posted: Fri Jul 30, 2021 12:07 pm
by enrico.milani
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

Re: Object recognition mismatch (Container/Element)

Posted: Fri Jul 30, 2021 1:42 pm
by odklizec
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']

Re: Object recognition mismatch (Container/Element)

Posted: Tue Aug 03, 2021 7:38 am
by enrico.milani
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!