Page 1 of 1

Delphi element Id inconsistent

Posted: Mon Dec 18, 2017 4:14 pm
by Fain
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
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
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

Re: Delphi element Id inconsistent

Posted: Tue Dec 19, 2017 1:56 pm
by odklizec
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.

Re: Delphi element Id inconsistent

Posted: Tue Dec 19, 2017 2:05 pm
by Fain
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.

Re: Delphi element Id inconsistent

Posted: Tue Dec 19, 2017 2:17 pm
by odklizec
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 ;)

Re: Delphi element Id inconsistent

Posted: Tue Dec 19, 2017 2:19 pm
by Fain
Ok, thanks I'll look into the trial.