Element.ChildIndex does not work with JS-based RanoreXPath evaluation.

Bug reports.
Ethan
Posts: 10
Joined: Mon Aug 08, 2016 12:09 pm

Element.ChildIndex does not work with JS-based RanoreXPath evaluation.

Post by Ethan » Sat Feb 23, 2019 8:19 pm

Hi!

Just updated to Ranorex 9. Note that I'm not using Ranorex Studio, just using pure C#/API-bindings (testing with Chrome). After upgrading, my code that uses Element.ChildIndex property stopped working. The property started to return "-1".

Saw hints in the forum that "Enable JS-based RanoreXPath evalution" caused different issue and this was true in this case as well. I guess this is some sort of performance optimization? If so, it's very welcome since faster element finds/evalutions are really needed, but I guess some more work has to be done here.

Thanks for an otherwise great product!

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

Re: Element.ChildIndex does not work with JS-based RanoreXPath evaluation.

Post by Support Team » Tue Feb 26, 2019 4:15 pm

Hello Ethan,

Thank you for reporting this issue. Our developers are already investigating the issue and I hope we can fix it soon.

Thank you!
Bernhard
.
Image

Ethan
Posts: 10
Joined: Mon Aug 08, 2016 12:09 pm

Re: Element.ChildIndex does not work with JS-based RanoreXPath evaluation.

Post by Ethan » Wed Feb 27, 2019 9:50 am

Hi again!

I is it possible to disable this feature through the API?

Background: I generate a C# element repo with the Spy tool. To get my C# based tests to work I had to disable this feature in the Spy tool's settings. However, when I deploy my code to a 'test server' the tests fail and it seems to be due to the same issue. I basically deploy the test-code-dll together with Ranorex dlls and run the tests. There is a Ranorex installation on the machine, but I cannot start Spy there to do any changes since it's a VM with only access to Runtime-licens.

How should I handle this? Need help!

Best regards,

Ethan
Posts: 10
Joined: Mon Aug 08, 2016 12:09 pm

Re: Element.ChildIndex does not work with JS-based RanoreXPath evaluation.

Post by Ethan » Wed Feb 27, 2019 10:15 am

Rearding my post above, I found the Ranorex.settings.exe where I could set it and now it works!

However, it would still be very useful to know if it's possible to set this through API (or another smart way) so there would be no need for 'manual setup' of the environment.

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

Re: Element.ChildIndex does not work with JS-based RanoreXPath evaluation.

Post by odklizec » Wed Feb 27, 2019 10:24 am

Hi,

I don't know API for this particular command. But you can store rxsettings file inside your solution, so once you set settings on dev. machine, they should be used on target machine as well.
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

martinacceo
Posts: 8
Joined: Thu Apr 25, 2019 2:17 pm

Re: Element.ChildIndex does not work with JS-based RanoreXPath evaluation.

Post by martinacceo » Thu May 02, 2019 5:51 pm

Hello,

I have the same issue. 40% of our scripts use childindex (they were working with 8.2)

You have a timeline when this is going to be fixed?

Thank you

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

Re: Element.ChildIndex does not work with JS-based RanoreXPath evaluation.

Post by odklizec » Fri May 03, 2019 8:07 am

Hi,

Issue from the initial post, should already be fixed in 9.0.1. Please check the Ranorex release notes available here:
https://www.ranorex.com/release-notes/

If your problem still happens after updating Ranorex with 9.0.1, please upload a Ranorex snapshot (NOT screenshot) of the problematic element and example of xpath, which fails.

Just a side note. Element indexes and child indexes, should be used only as a last resort, because they are not persistent. Using them in large scale is a sure way to never ending and time consuming debugging and maintenance. You should really consider improving your xpaths, for example na using relationship operators. Basically, you should try to search/link desired element(s) with descendant/ancestor elements. Even RawTexts, coming from GDI Capture approach, is way better solution than indexes ;)
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