Page 1 of 1

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

Posted: Sat Feb 23, 2019 8:19 pm
by Ethan
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!

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

Posted: Tue Feb 26, 2019 4:15 pm
by Support Team
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

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

Posted: Wed Feb 27, 2019 9:50 am
by Ethan
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,

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

Posted: Wed Feb 27, 2019 10:15 am
by Ethan
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.

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

Posted: Wed Feb 27, 2019 10:24 am
by odklizec
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.

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

Posted: Thu May 02, 2019 5:51 pm
by martinacceo
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

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

Posted: Fri May 03, 2019 8:07 am
by odklizec
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 ;)