Validate Inner Text Issues (after Update)

Ranorex Spy, Recorder, and Studio.
Lyuba Boerma
Posts: 33
Joined: Mon Apr 01, 2019 12:12 pm

Validate Inner Text Issues (after Update)

Post by Lyuba Boerma » Tue Oct 22, 2019 10:30 am

HI)
i have an old test with validation step for inner text, which was always running without issues. After i updated to 9.2.0 i have issues with inner text validation in several places.
Via Ranorex Spy i see correct text.
Also during Maintenance mode , on a debug popUp if i click open in a Spy - i also see correct inner Text.
but Ranorex always fail this step. He validate empty value to my text value.
i added A Snapshot of of example element. But also a screenshot for make it more visual.
Don't be confused with "Unspecified" , this is correct string value :)
Smoke_Testing - Ranorex Studio - (32bit) (Administrator) 2019-10-22 11.15.29.png
Smoke_Testing - Ranorex Studio - (32bit) (Administrator) 2019-10-22 11.15.29.png (86.34 KiB) Viewed 90 times

I hope you could help me to salve this issue
Attachments
Location_Unspecified.rxsnp
(153.26 KiB) Downloaded 3 times

Lyuba Boerma
Posts: 33
Joined: Mon Apr 01, 2019 12:12 pm

Re: Validate Inner Text Issues (after Update)

Post by Lyuba Boerma » Tue Oct 22, 2019 10:36 am

during running in Maintenance mode
Maintenance mode 2019-10-22 11.32.44.png
Maintenance mode 2019-10-22 11.32.44.png (73.32 KiB) Viewed 88 times

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

Re: Validate Inner Text Issues (after Update)

Post by odklizec » Tue Oct 22, 2019 10:40 am

Hi,

Are you using Validate action in recording table or custom code? Could you please show us the problematic recording or code module?
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

Lyuba Boerma
Posts: 33
Joined: Mon Apr 01, 2019 12:12 pm

Re: Validate Inner Text Issues (after Update)

Post by Lyuba Boerma » Tue Oct 22, 2019 10:46 am

i am using a Recording module
I attached it (hoop you can open)
All_test_Cases - Ranorex Studio - (32bit) (Administrator) 2019-10-22 11.45.42.png
All_test_Cases - Ranorex Studio - (32bit) (Administrator) 2019-10-22 11.45.42.png (11.66 KiB) Viewed 88 times
Attachments
Add_Sample_Check_LocationUnspecified.UserCode.cs
(1.13 KiB) Downloaded 2 times
Add_Sample_Check_LocationUnspecified.rxrec
(4.3 KiB) Downloaded 3 times

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

Re: Validate Inner Text Issues (after Update)

Post by odklizec » Tue Oct 22, 2019 11:07 am

Hi,

Please post also entire xpath for CurrentLocation element. My guess is, that the xpath returns more than just one unique element?

PS: I just again examined the snapshot you posted, and it's exactly what I thought. There are two elements with the same ID, where one of them is invisible and has empty InnerText.
storageLocation.png
storageLocation.png (50.91 KiB) Viewed 86 times
To fix the problem, you must add [@visible='True'] at the end of 'CurrentLocation' xpath in repository.
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

Lyuba Boerma
Posts: 33
Joined: Mon Apr 01, 2019 12:12 pm

Re: Validate Inner Text Issues (after Update)

Post by Lyuba Boerma » Tue Oct 22, 2019 12:33 pm

Hmmm interesting)
Thanks your solution helps.
Just wonder why i never faced it before. ))

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

Re: Validate Inner Text Issues (after Update)

Post by odklizec » Tue Oct 22, 2019 12:42 pm

Most probably a pure luck you did not experience this problem before? ;) Either this, or the invisible element has been added recently?

Anyway, in case of xpath returning multiple elements, Ranorex always picks the first one found. And I’m afraid, the order of returned elements could be completely random. So you should always evaluate each recorded xpath and assure it returns just one unique element.
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