Ranorex can't find wpf textbox in runtime but spy can

Ask general questions here.
hsarmah2021
Posts: 16
Joined: Tue Oct 27, 2020 1:43 pm

Ranorex can't find wpf textbox in runtime but spy can

Post by hsarmah2021 » Tue Apr 13, 2021 1:38 pm

Hi everyone,
I am using Ranorex 9.4.1 and trying to fill a textbox in a wpf application. While inspecting with Spy I can find a proper path for it, but when I run a test this element is not found. While recording the step, the recorder gives a different path for the same element which is also not stable and might fail in runtime. Does anyone know why the Spy can find the element but it can't be found in runtime?

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

Re: Ranorex can't find wpf textbox in runtime but spy can

Post by odklizec » Tue Apr 13, 2021 2:00 pm

Hi,

Without seeing the app under test, or, at very least, a Ranorex snapshot (NOT screenshot) of the AUT, it's impossible to tell what's wrong.

Please create the snapshot of problematic element, ideally from standalone Spy. Additionally, please share a snapshot of AUT, created from recording (using Create Snapshot action). Then share both snapshots (zipped) here. Eventually, share them via a file sharing service, like dropbox or google drive.

And of course, don't forget to share the xpath you are using. 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

mrt
Posts: 88
Joined: Mon Mar 16, 2020 11:31 am

Re: Ranorex can't find wpf textbox in runtime but spy can

Post by mrt » Thu Apr 15, 2021 7:58 am

I don't know if this is related to your issue, but I have a similar issue for nearly all custom tags in my AUT.

Let's say I have a custom tag, something like:

Code: Select all

<body>
  <my-very-own-tag>Some text</my-very-own-tag>
</body>
If I copy the full xpath from browser, like:
/body/my-very-own-tag
and put it into Spy, then it finds the element.

But when I run the recording, it does not find the element.
I have to change the path to:
/body/tag[@tagname='my-very-own-tag']
then also the recording finds the element.

This makes it impossible to just copy&paste xpaths from browser,
every single Rxpath has to be adjusted manually if it is not done by recording,
but I haven't found any other solution for the non-standard tags.