Page 1 of 1

How to identify MFC application buttons

Posted: Thu Sep 20, 2018 7:47 am
by mohan.pentyala
Hi Team ,

I am working on a MFC application and trying to identify a button on the header , which i am not able to .When i track it through spy it is identifying as complete toolbar instead of single button ,

I have tried adding GDi capture list as well but still i am not able to , Can you please help me with this ?

Re: How to identify MFC application buttons

Posted: Thu Sep 20, 2018 11:39 am
by odklizec
Hi,

It's hard to suggest something reliable, without seeing the app under test (AUT) or at very least Ranorex snapshot (which I think would be useless this time). Sadly, if GDI capture list does not return rawtexts for individual buttons, there is probably not much else you can try. Your only hope is screenshot-based automation, which is unfortunately not very reliable in a long-term run. Another possibility is a proper implementation of MSAA, which must be done by the AUT developers.

Re: How to identify MFC application buttons

Posted: Thu Sep 20, 2018 2:21 pm
by Stub
I have a similar controls in our Windows desktop MFC application. Individual text items appear in the control and I simply must use GDICapture for exactly this circumstance. The rawtext elements are absolutely critical to my being able to automate these individual controls which feature a decent bit of text.

However, we also have icon buttons in some places, and these are toggleable. To control these I've had to resort to finding the control by image comparison. I saved a compact bitmap image of the control and search for that to find an area I can click on to toggle state. It's not great, I know, but it's worked well here for the past 2y or so through Ranorex v6, v7 and now v8.

Re: How to identify MFC application buttons

Posted: Thu Sep 20, 2018 2:43 pm
by mohan.pentyala
Hi ,

Thank you for the reply , Please find the atatched snapshot of my application , Can you check and help me if i can do from my end aprt from screen shot based automation
odklizec wrote:
Thu Sep 20, 2018 11:39 am
Hi,

It's hard to suggest something reliable, without seeing the app under test (AUT) or at very least Ranorex snapshot (which I think would be useless this time). Sadly, if GDI capture list does not return rawtexts for individual buttons, there is probably not much else you can try. Your only hope is screenshot-based automation, which is unfortunately not very reliable in a long-term run. Another possibility is a proper implementation of MSAA, which must be done by the AUT developers.

Re: How to identify MFC application buttons

Posted: Thu Sep 20, 2018 2:46 pm
by mohan.pentyala
Thank you for the reply ,

Can you please share any blogs or link which i can go through for bitmap image based automation

Stub wrote:
Thu Sep 20, 2018 2:21 pm
I have a similar controls in our Windows desktop MFC application. Individual text items appear in the control and I simply must use GDICapture for exactly this circumstance. The rawtext elements are absolutely critical to my being able to automate these individual controls which feature a decent bit of text.

However, we also have icon buttons in some places, and these are toggleable. To control these I've had to resort to finding the control by image comparison. I saved a compact bitmap image of the control and search for that to find an area I can click on to toggle state. It's not great, I know, but it's worked well here for the past 2y or so through Ranorex v6, v7 and now v8.

Re: How to identify MFC application buttons

Posted: Fri Sep 21, 2018 7:29 am
by odklizec
mohan.pentyala wrote:
Thu Sep 20, 2018 2:43 pm
Hi ,

Thank you for the reply , Please find the atatched snapshot of my application , Can you check and help me if i can do from my end aprt from screen shot based automation
I'm afraid, there seems to be no snapshot attached to your post. But to be quite honest, I doubt the snapshot will be useful in this particular case. And if adding parent control (or entire form) to GDI capture did not help with extracting RAW texts, there is most probably nothing you can do, except using screenshot-based automation. Definitely nothing without the help of app developers and implementing proper accessibility support.

Re: How to identify MFC application buttons

Posted: Tue Sep 25, 2018 5:31 am
by mohan.pentyala
HI ,

Yes as you said i was discussing with my Team , to make sure I am attaching my snapshot as well . Can you please have a look and help me if we can do anything else .

Sure attached the snapshot this time :)
Application.rxsnp

Re: How to identify MFC application buttons

Posted: Tue Sep 25, 2018 8:02 am
by odklizec
Hi,

At first, there is issued a technology limitation warning in the snapshot you posted. Which means the Ranorex element identification capabilities are limited for your app. So you should fix this problem first. Follow the steps mentioned here:
https://www.ranorex.com/help/latest/int ... plications
BTW, have you tried to run both Ranorex Studio/Spy as Administrator?

At second, after the above problem is cleared (and Ranorex is still not able to extract buttons from toolbar), try to add the parent form to GDI capture list...
GDICaptureList.png
Then refresh the Spy and see, if there are any raw texts available in the UI tree. These should help you with identification of the toolbar buttons (texts). If there are no raw texts, then I'm afraid, screenshot-based automation is your only hope. Either this, or the application developers must properly implement msaa.

Re: How to identify MFC application buttons

Posted: Wed Sep 26, 2018 10:22 am
by mohan.pentyala
Hi ,

Thanks for the help .Though i added to GDI capture list still i didn't see any raw text for the buttons .i will discuss with developer to place proper ID for the same.