Get Element Type from RxPath

Ask general questions here.
ankurm.245
Posts: 9
Joined: Fri Dec 14, 2018 5:26 am

Get Element Type from RxPath

Post by ankurm.245 » Mon Jan 14, 2019 9:42 am

Hi,

I have a RxPath which is created at the run-time like below:
"/dom[@domain='cafolmuat-r12-ebs.lb.macbank:16121']//span[#'AdvTableRN']/table/tbody/tr[2]/td/table//tr/td[3]//*[@innertext~'Error']/ancestor::tr/td[2]//*[@innertext~'Functional Constraints']/../.."

This Rxpath would point to a TD or a TR tag depending on the hierarchies under td[2] tag.
Ex. td[2]/span/span or td[2]/span


Is there some way with which i can fetch what is the element type which is recognized by the RXPath?
i.e. i want to get (from above example) either a TDTag or a TRTag (or whatever it is)
I=AM!

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

Re: Get Element Type from RxPath

Post by odklizec » Mon Jan 14, 2019 10:01 am

Hi,

Could you please describe in more details what exactly you want to achieve? I'm somewhat lost from your description ;) Also, please upload a Ranorex snapshot (NOT screenshot) of the problematic element (for given xpath), so we can get better idea about your UI and its structure. 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

ankurm.245
Posts: 9
Joined: Fri Dec 14, 2018 5:26 am

Re: Get Element Type from RxPath

Post by ankurm.245 » Mon Jan 14, 2019 10:17 am

Error Column: td/span/span
The attachment Error Column.rxsnp is no longer available
Description Column: td/span
The attachment Error Column.rxsnp is no longer available
Issue: I am trying to generalize the table search criteria by providing the column and value pair. As a return value, I am trying to fetch the TRTag object.

But in above case, TR tag can be 2 or 3 levels above the span tag.
So I have the Rxpath of the TD Tag (in case of error column) or would have TR Tag in case of Description column.

Hence, i want to know at runtime, that what type of object does the Rxpath is identifying, basis on which I would be taking a logical decision and would move ahead with the code.
Attachments
Error Column.rxsnp
(603.3 KiB) Downloaded 2 times
Desciption Column.rxsnp
(604.8 KiB) Downloaded 2 times
I=AM!

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

Re: Get Element Type from RxPath

Post by odklizec » Mon Jan 14, 2019 11:20 am

Hi,

Maybe I'm still missing something, but what about this xpath?...
/dom[@domain='cafolmuat-r12-ebs.lb.macbank:16121']//span[#'AdvTableRN']/table/tbody//*[@innertext~'Error']/ancestor::tr/td/*[@id~'AdvTableRN:DescItem' and @innertext~'Functional Constraints']/ancestor::tr[][1]
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