XPath - How to read text from all child div

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
darpro
Posts: 4
Joined: Tue Sep 25, 2018 10:15 am

XPath - How to read text from all child div

Post by darpro » Thu Oct 17, 2019 9:46 am

Hi,

Is there possibility to read InnerText from all children elements with one query xpath

Structure
div [id=A]
- div
- div
- div

General in xpath we can do this with div[#A]//text()
Can we do the same in ranorex? I can't use method text() - in ranorex repository

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

Re: XPath - How to read text from all child div

Post by odklizec » Thu Oct 17, 2019 11:06 am

Hi,

I'm afraid, there is no such option in Ranorex xpath. The only way to achieve what you want is with user code. You can use something like this...
https://www.ranorex.com/forum/getvalue- ... tml#p48113
Just replace <Ranorex.Button> with <Ranorex.DivTag> and 'Caption' with 'InnerText' or 'Text'.
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