GetValue from a Dynamic Element

Ask general questions here.
jarhead1973
Posts: 1
Joined: Fri Oct 04, 2019 3:37 am

GetValue from a Dynamic Element

Post by jarhead1973 » Fri Mar 13, 2020 3:12 am

Hi,

I need help on how to get the value of a dynamic element in a website. It is an application number and it changes everytime a successful application is submitted. When I capture the element the attribute @innertext stores the text. I did the normal GetValue action but then on the next application, the value changed and my element no longer able to find the value (as has changed).

Any idea on how to do this? I may have missed some existing solution so please forgive me in advance.
Attachments
Capture.JPG
Capture.JPG (13.5 KiB) Viewed 113 times
ApplicationNumber.rxsnp
(101.61 KiB) Downloaded 4 times

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

Re: GetValue from a Dynamic Element

Post by odklizec » Fri Mar 13, 2020 9:43 am

Hi,

This xpath should return the element you are interested in...

Code: Select all

/dom[@domain='eforms.uatonline.immigration.govt.nz']//div[#'confirmation']/p[@innertext~'We received']/strong
Basically, you must find the element via nearest ancestor. Hope this helps?
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