Unable to get text from ListItem in a StatusBar

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
rka
Posts: 17
Joined: Fri Jul 03, 2015 7:54 am

Unable to get text from ListItem in a StatusBar

Post by rka » Tue Jul 21, 2015 9:47 am

Hello Ranorexians,

I have a problem getting the text out of a ListItem inside a Statusbar.
The StatusBar has several ListItems which are inside my repository.
To get the text I created the following example code:

Code: Select all

ListItem li = new ListItem(repo.path.to.listitem);
Report.Info(li.Text);
All I get is (null), alltough there is text inside. The spy is also returning null, but the screenshot it is using has a value inside (see the attached png).

How can I get ranorex to recognise the text?

Btw: I opened the editor.exe inside windows and try to spy on the statusbar. In this case it worked!

Thank you in advance for your help,
kind regards,
Rafael
Attachments
ranorex_listitem_text.png
ranorex_listitem_text.png (15.33 KiB) Viewed 923 times

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

Re: Unable to get text from ListItem in a StatusBar

Post by odklizec » Tue Jul 21, 2015 9:55 am

Hi,

To be able to help you, we need some more details...
What's your Ranorex version?
What's the technology behind the status bar/listitem (wpf, qt, java, etc...?)
What's your OS?
Please upload the Ranorex snapshot of the status bar in question. Screenshot is unfortunately not enough for evaluating what could be the cause of your problem ;)
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

rka
Posts: 17
Joined: Fri Jul 03, 2015 7:54 am

Re: Unable to get text from ListItem in a StatusBar

Post by rka » Tue Jul 21, 2015 11:03 am

Hi,

here is the screenshot of the statusbar.
statusbar.png
statusbar.png (2.15 KiB) Viewed 918 times
Technology is unknown, unfortunately. But it is using msvcr100 und mfc100 (so maybe it's WPF?). Additionally I can tell you that the Class of the StatusBar is msctls_statusbar32.

The first text on the left is the only one I can access (ListItem id=0). All other elements have attribe Text=NULL.

We used v5.1.1, but I just updated to v5.4.0 which has the same problem.

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

Re: Unable to get text from ListItem in a StatusBar

Post by odklizec » Tue Jul 21, 2015 11:29 am

Hi,

Thanks for more details. Unfortunately, what you've posted is screenshot, not Ranorex snapshot.
Please check this page how to create Snapshot.
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

rka
Posts: 17
Joined: Fri Jul 03, 2015 7:54 am

Re: Unable to get text from ListItem in a StatusBar

Post by rka » Tue Jul 21, 2015 11:40 am

Ok, thank you for the hint. Here it is.
Attachments
statusbar.rxsnp
(128.98 KiB) Downloaded 65 times

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

Re: Unable to get text from ListItem in a StatusBar

Post by odklizec » Tue Jul 21, 2015 11:54 am

Thanks for the snapshot. OK, the bad news is, that there is really no text stored in ListItems you want to use. What you can try, is to add the status bar to the GDI Capture List. This is something primarily used for the legacy apps, but it may help also with controls with poorly/not implemented accessibility.

Please follow the instructions from this link:
http://www.ranorex.com/support/user-gui ... tions.html

Once the control is added to the GDI capture list, refresh or restart Spy. If you are lucky, you should be able to see some rawtexts containing the texts you want to use.
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

rka
Posts: 17
Joined: Fri Jul 03, 2015 7:54 am

Re: Unable to get text from ListItem in a StatusBar

Post by rka » Tue Jul 21, 2015 11:56 am

Thank you for your help. Rawtext elements are added and I can work with them :)

Best regards,
Rafael

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

Re: Unable to get text from ListItem in a StatusBar

Post by odklizec » Tue Jul 21, 2015 12:03 pm

You are welcome! ;)
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