WPFImproved plugin changing xpaths

Ask general questions here.
rsudhak
Posts: 72
Joined: Fri Jan 04, 2019 1:38 pm

WPFImproved plugin changing xpaths

Post by rsudhak » Mon Jul 08, 2019 2:12 pm

Recently tried automating an application which has Telerix controls, using uiprefred plugin.
searching the element takes too long both in spy and studio.
So wanted to swtich to wpfimprovedonly plugin, to check the same.....yesterday most the elements I was able to find, but today looks like xpath have changed, nothing has been changed on the AUT, but still it fails. Yester we had lists in an element, now there are containers. also I was having issues
with identifying the data grid elements
Snapshot attached for reference
Any idea, why this could be
Keep getting error like this Failed to find item 'PD3DRepoRepository.Revit.Treeitem_CableCPC_E'. Please check that your whitelist allows Ranorex to access the process.

Also any tips on how I should be writing the xpath for these, I have gone through the tips from the Ranorex blog though
Thanks in Advance
Attachments
revit_today.rxsnp
todays repo
(1.53 MiB) Downloaded 5 times
WpfImprovedRevit_Yesterday.rxrep
yesterdays repo
(38.23 KiB) Downloaded 3 times

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

Re: WPFImproved plugin changing xpaths

Post by odklizec » Mon Jul 08, 2019 2:27 pm

Hi,

I believe that this is a pretty normal behavior. WPFImprovedOnly generates different xpaths, which are not compatible with other WPF modes. This is because WPFImprovedOnly uses different (rewritten) WPF plugin. So if you want to use WPFImprovedOnly mode, you need to adapt existing repository xpaths. There is no way around, except dynamically switching WPF modes during runtime. This can be done from code.
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

rsudhak
Posts: 72
Joined: Fri Jan 04, 2019 1:38 pm

Re: WPFImproved plugin changing xpaths

Post by rsudhak » Mon Jul 08, 2019 2:49 pm

ok, what would be the preffered plugin then using controls like telerix, dynamic data tables? any suggestions

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

Re: WPFImproved plugin changing xpaths

Post by odklizec » Mon Jul 08, 2019 2:55 pm

I'm afraid, there is no universal answer to this question ;) Just explore the UI with Spy and different WPF settings and select the one, which provides the best results. Generally speaking, WPFImprovedOnly should be the best one.
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

rsudhak
Posts: 72
Joined: Fri Jan 04, 2019 1:38 pm

Re: WPFImproved plugin changing xpaths

Post by rsudhak » Mon Jul 08, 2019 3:08 pm

I really liked WPFImproved, as it was quite faster comparatively. But just dont know how can this be used if the element keeps changing, how can this problem be sorted incase If I want to use WPFImproveonly plugin?

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

Re: WPFImproved plugin changing xpaths

Post by Support Team » Mon Jul 08, 2019 9:54 pm

Hi rsudhak,

Dynamic attributes/elements is not really a plugin specific issue, just an automation challenge that can occur with any plugin. Fortunately, we have lots of documentation on how to work around dynamic content that I have linked below. Depending on how frequent Ranorex uses a dynamic attribute in the auto-generated RxPath, it may be worth looking into adjusting the RxPath weight rules (also documented in the links below).
If you need any further assistance with this, please provide two Ranorex Snapshots of the same element but at different times so we can compare what is changing between both iterations. Once we know what is dynamic and what is static, we can help you build a better RxPath and potentially recommend some RxPath weight rule changes that should help when mapping elements.

Cheers,
Ned
.
Image

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

Re: WPFImproved plugin changing xpaths

Post by odklizec » Tue Jul 09, 2019 7:51 am

Hi,

I was under the impression, that you complained about different xpaths, generated by WPFImprovedOnly and those already stored in repo, just with different WPF plugin settings. That's normal. However, xpaths coming from WPFImprovedOnly should not change on a daily basis. The only problem could be dynamic attributes, mentioned by Ned. And dynamic attributes in generated xpath could be handled either by removing them or by changing the xpath weight, which could change the way the xpath is generated. Hope the links, provided by Ned, will show you the way, how to handle dynamic content.
Last edited by odklizec on Tue Jul 09, 2019 2:11 pm, edited 1 time in total.
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

rsudhak
Posts: 72
Joined: Fri Jan 04, 2019 1:38 pm

Re: WPFImproved plugin changing xpaths

Post by rsudhak » Tue Jul 09, 2019 2:10 pm

Thanks Ned and Odklizec, I will look into this and try focusing on WpfImprovedOnly plugin, now that I know the paths shouldnt change