Getting the text inside a button's icon

Ranorex Spy, Recorder, and Studio.
Machisperer
Posts: 7
Joined: Wed May 02, 2018 3:48 pm

Getting the text inside a button's icon

Post by Machisperer » Wed May 02, 2018 4:00 pm

I have a button that displays a number which is dynamically set by the application under test. I need the number to do some validations with it. However, I tried pretty much all the properties of the button to try and get number but so far couldn't. Please see a snapshot of the button in the attachment. Any idea/tips/hint would be much appreciated.
Attachments
FilesButton.rxsnp
Ranorex Snapshot of the button
(46.37 KiB) Downloaded 14 times

qwertzu
Posts: 178
Joined: Wed Jan 25, 2017 11:08 am

Re: Getting the text inside a button's icon

Post by qwertzu » Thu May 03, 2018 11:38 am

Hi,
You could try to add the classname to the GDI capture list and see if Ranorex is able to identify a text element from which you can retrieve data.
GDI_Capture_List.png
GDI_Capture_List.png (21.69 KiB) Viewed 274 times
However, it's quite hard to tell how the text is implemented on the button since there are no screenshots visible in the snapshot.
regards, qwertzu

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

Re: Getting the text inside a button's icon

Post by odklizec » Fri May 04, 2018 8:17 am

Hi,

If the text you want to extract from button is a part of image, then I'm afraid, you are out of luck here. The only help could be some kind kind of OCR code, which may eventually help with extracting text from image. But I'm afraid, there is no built-in feature like this in Ranorex.
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

Machisperer
Posts: 7
Joined: Wed May 02, 2018 3:48 pm

Re: Getting the text inside a button's icon

Post by Machisperer » Thu May 10, 2018 11:13 pm

Thanks guys for the replies. I will play with the GDI capture and see.