Ranorex Spy cannot read the result control in calc.exe

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
conradb
Posts: 19
Joined: Thu Mar 10, 2016 12:00 pm

Ranorex Spy cannot read the result control in calc.exe

Post by conradb » Thu Apr 21, 2016 9:43 am

Just so I can learn to use Ranorex (please assume I'm not a programmer at all) I decided to test the well known calc.exe program just to build my Ranorex skills and use a well known problem-domain to learn how to create simple suites and organize and learn to have a strategy for managing many suites.

The result control in calc.exe is in fact a fake/empty control or container for a number of other controls:
calc controls.jpg
calc controls.jpg (33.99 KiB) Viewed 824 times
I made a mash here to show all the controls in gray - the inner control is the actual windows control we want to validate. Ranorex only detects the outer control :-(

There is a page with lots of clues as to why, http://www.ranorex.com/support/user-gui ... oting.html but I would have thought that a really old win16 ported application would be typical of many legacy apps that we might want to automate the testing of and then never worry for regressions. Or is there something that I can learn in terms of advanced Validation-point and manual repository editing /xPath techniques here?

I'm only asking this, because the App I've been asked to test is in WPF. But it starts to do similar things and uses control visibility extensively to show status or progress in a wizard. My calc example is a bit obscure I know, because calc is very naughty and uses 2 overlapping controls to display to the user.

/edit
Just spotted this thread : http://www.ranorex.com/forum/no-identif ... t7270.html . which seems to provide an RanorexPath solution...

The xpath is looking ok to me, but Ranorex is not able to find the control, and clues?
pros:Powershell automation guru
cons:UI automation hacker/n00b
Conrad Braam

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Ranorex Spy cannot read the result control in calc.exe

Post by Support Team » Fri Apr 22, 2016 8:53 am

Hello conradb,

I'm not exactly sure what do you mean with the "inner" and "outer" control, but Ranorex is able to recognize the result numbers in the Windows calculator. The generated RanoreXPath for the control is the following: /form[@title='Calculator']/?/?/container[@instance='0']/text[@controlid='150']
CalculatorInSpy.png
CalculatorInSpy.png (26.88 KiB) Viewed 804 times
In order to validate the text within the control you can use the validation action within the Ranorex Recorder.
ValidateCalc.png
ValidateCalc.png (15.34 KiB) Viewed 804 times
I hope I could answer your question.

Regards,
Bernhard
.
Image

conradb
Posts: 19
Joined: Thu Mar 10, 2016 12:00 pm

Re: Ranorex Spy cannot read the result control in calc.exe

Post by conradb » Fri Apr 22, 2016 9:23 am

Sure did. You guys are the boz.
Thanks for your patience, it looks like I had to hit the refresh button in Spy or something, because I was not identifying/finding the edit control because the node (Container) was not probably showing it's child controls. I think I had to hit Refresh and viola, it's perfectly there now, no idea why the node did not want to expand before. (I blame my eyes for this.)
It's so easy to just keep on taking the same wrong turning when stuck.
ranorex spy.png
ranorex spy.png (12.99 KiB) Viewed 801 times
Can someone tell me the significance of some containers being gray and some being black in the browser?
pros:Powershell automation guru
cons:UI automation hacker/n00b
Conrad Braam

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

Re: Ranorex Spy cannot read the result control in calc.exe

Post by odklizec » Fri Apr 22, 2016 9:27 am

Hi,

Gray element means it's in 'invisible' state. If you check properties of such element, you will find 'Visible' attribute set to 'false'.
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