IList parsing to get innertext data.

Ask general questions here.
User avatar
FelixK98
Posts: 54
Joined: Fri Apr 08, 2016 6:28 am

IList parsing to get innertext data.

Post by FelixK98 » Fri Jul 08, 2016 9:14 am

Hi Everyone,

I got stuck a bit on how can I get innertext attribute values from list I got.
So, I have a list:
IList<Ranorex.WebElement> divList = repo.AuComPlanetinnovationGidget.GidgetApp.ScanSessionContainerInfo.CreateAdapters<Ranorex.WebElement>();
The picture below contains what included in this list:
List-of-elments.PNG
List shown by maroon color rectangle
List-of-elments.PNG (63.21 KiB) Viewed 479 times
I also added snapshot of app.

I have to get data marked by green color. The number of divs marked by yellow color is different for each Div 'sessionWrap" .
The repo element ScanSessionContainer is a single Div 'sessionWrap'.

If someone could give me an example on how to get data marked by green color it would be most appreciated and very helpful for me.

Thanks,
Felix.
Attachments
snapshot6.rxsnp
(124.01 KiB) Downloaded 26 times

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

Re: IList parsing to get innertext data.

Post by odklizec » Fri Jul 08, 2016 9:37 am

Hi,

Try this path (instead of path returning 'seassionWrap'):

Code: Select all

/mobileapp[@title='au.com.planetinnovation.gidget']/form/container[@caption='' and @containertype='']/container//dom[@domain='localhost']//div[@class='sessionWrap']/div[@class~'mdl-card pi-patient-history-witness-session-header|detail-card']/div[1]/span?
This will return all divs with date and all spans with required texts. Try it with spy first if it matches your needs. 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

User avatar
FelixK98
Posts: 54
Joined: Fri Apr 08, 2016 6:28 am

Re: IList parsing to get innertext data.

Post by FelixK98 » Fri Jul 08, 2016 9:46 am

Hi odklizec,

Thank you for reply.

I need get data per sessionWrap because I have to compare it with data from database and it should be equal. If I will get all spans I will not be able to associate it with specific session data from DB.

Thanks,
Felix.