Page 1 of 1

Unable to get text from ListItem in a StatusBar

Posted: Tue Jul 21, 2015 9:47 am
by rka
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

Re: Unable to get text from ListItem in a StatusBar

Posted: Tue Jul 21, 2015 9:55 am
by odklizec
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 ;)

Re: Unable to get text from ListItem in a StatusBar

Posted: Tue Jul 21, 2015 11:03 am
by rka
Hi,

here is the screenshot of the statusbar.
statusbar.png
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.

Re: Unable to get text from ListItem in a StatusBar

Posted: Tue Jul 21, 2015 11:29 am
by odklizec
Hi,

Thanks for more details. Unfortunately, what you've posted is screenshot, not Ranorex snapshot.
Please check this page how to create Snapshot.

Re: Unable to get text from ListItem in a StatusBar

Posted: Tue Jul 21, 2015 11:40 am
by rka
Ok, thank you for the hint. Here it is.

Re: Unable to get text from ListItem in a StatusBar

Posted: Tue Jul 21, 2015 11:54 am
by odklizec
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.

Re: Unable to get text from ListItem in a StatusBar

Posted: Tue Jul 21, 2015 11:56 am
by rka
Thank you for your help. Rawtext elements are added and I can work with them :)

Best regards,
Rafael

Re: Unable to get text from ListItem in a StatusBar

Posted: Tue Jul 21, 2015 12:03 pm
by odklizec
You are welcome! ;)