Delphi element Id inconsistent

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Fain
Posts: 3
Joined: Mon Dec 18, 2017 3:28 pm

Delphi element Id inconsistent

Post by Fain » Mon Dec 18, 2017 4:14 pm

I have had this issue with a few different Delphi controls in the past.
It looks like either the control changes or the way Ranorex sees the control changes.

Here's the original XPath that has been working for at least a year now.

Code: Select all

/form[@controlname='SqlCIItemBrowseForm' and @processname='SConsinv']/element[@controlname='Toolbar']/toolbar[@accessiblename='Toolbar']/button[1]
DelphiElement.png
DelphiElement.png (76.04 KiB) Viewed 459 times
In image above, the Element TTenStdToolbar is usually element[@controlname='Toolbar'] for some reason, the controlname is not on the toolbar all the time. (as seen in the image below)
DelphiElement2.png
DelphiElement2.png (81.35 KiB) Viewed 459 times
These two images were taken with the same build of this app within 30 mins of each other.

I solved this instance by taking the element out of the path and searching all descendents under 'SqlCIItemBrowseForm'

Code: Select all

/form[@controlname='SqlCIItemBrowseForm']//toolbar[@accessiblename='Toolbar']/button[1]
In the past I've used an 'or' clause

Code: Select all

/form[@controlname='SqlCIItemBrowseForm']/element[@controlname='Toolbar' or @class='TTenStdToolbar']/toolbar[@accessiblename='Toolbar']/button[1]
This test has been passing for almost a year without any of these failures but the last week its failed almost every run.

I was able to reproduce this issue on a lower resolution than I use to develop the scripts but this is not always the case.

System Info:
Ranorex: 5.2.4.23988
OS: Windows Server 2008 R2 standard
The tests are ran on a VM with
200gb hd
AMD Opteron 4386
8 gb ram
64 bit os

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

Re: Delphi element Id inconsistent

Post by odklizec » Tue Dec 19, 2017 1:56 pm

Hi,

I'm afraid, it's hard to say what's wrong without inspecting your app under test and test solution. Are you sure the Ranorex settings are always the same?

Additionally, Ranorex 5.4.2 is way too old and no longer supported. So even if there is a Delphi-related problem with that version, I seriously doubt Ranorex guys will do anything about it. I would suggest to reproduce the problem with latest Ranorex 8.0 or 7.2.1, which are currently supported versions. Thanks.
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

Fain
Posts: 3
Joined: Mon Dec 18, 2017 3:28 pm

Re: Delphi element Id inconsistent

Post by Fain » Tue Dec 19, 2017 2:05 pm

Yes, the configs are the same. The only thing different in this instance was the resolution. I dont think the resolution is the problem because its been running on this resolution for the past year. I created the screenshots in this post with the exact same automation build and app build within 30 mins of each other.

Unfortunately, I cant upgrade from my current Ranorex version due to licensing.
I would like to know if it is a problem with 5.2.
This would give us more of a reason to purchase an upgrade.

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

Re: Delphi element Id inconsistent

Post by odklizec » Tue Dec 19, 2017 2:17 pm

Well, you can always try the Ranorex Trial version? And if it works as expected, you have your reason to upgrade.

BTW, I would strongly recommend to upgrade Ranorex in one year cycle, because then it's way more expensive and much harder to persuade managers to buy the upgrade ;)
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

Fain
Posts: 3
Joined: Mon Dec 18, 2017 3:28 pm

Re: Delphi element Id inconsistent

Post by Fain » Tue Dec 19, 2017 2:19 pm

Ok, thanks I'll look into the trial.