Hello,
we are using Ranorex 3.0.2 for automated testing. The application that is tested uses Elegant.Ui controls in stead of Windows.System.Forms controls. Although (most of) the controls are correctly identified by Ranorex the values of their "Enabled"-property aren't right. The Ranorex Spy shows the value "true" for all of them, no matter what state the property actually has. I get the same results when accessing the values with code in Ranorex.
Is there a way to get the "real" state of the property?
Thanks
Surs
Ranorex Spy shows wrong Enabled-state of Elegant.Ui-buttons
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Ranorex Spy shows wrong Enabled-state of Elegant.Ui-buttons
Hi,
Peter
Ranorex Team
Would it be possible to send us a Ranorex Snapshot of your entire application? This snapshot is very useful for further analyses. You can also try following methods for a WinForms Regards,surszer wrote:Is there a way to get the "real" state of the property?
Peter
Ranorex Team
Re: Ranorex Spy shows wrong Enabled-state of Elegant.Ui-buttons
Hi there,
unfortunately I can't send you a snapshot.
So I'll try to tell you some details:
I actually try to get all the applications controls and check the "Enabled"-state of each. I use the generic "FindChildren"-method on the top-level form and afterwards on all its children and so on.
I got no results while using FindChildren<Ranorex.Control>() so I had to look for each type of control (buttons, textboxes, checkboxes...) individually like this:
Thanks
Surs
unfortunately I can't send you a snapshot.
So I'll try to tell you some details:
I actually try to get all the applications controls and check the "Enabled"-state of each. I use the generic "FindChildren"-method on the top-level form and afterwards on all its children and so on.
I got no results while using FindChildren<Ranorex.Control>() so I had to look for each type of control (buttons, textboxes, checkboxes...) individually like this:
private void assembleControls(Ranorex.Adapter a){ foreach(Ranorex.TabPageList tbl in a.FindChildren<Ranorex.TabPageList>()){ if(!_tabPageLists.Contains(tbl)){ assembleControls(tbl); _tabPageLists.Add(tbl); } } foreach(Ranorex.Container co in a.FindChildren<Ranorex.Container>()){ if(!this._containers.Contains(co)){ assembleControls(co); _containers.Add(co); } } //same for all other control-types }So all types of controls are saved in separate lists. As far as I know there is no possibility to cast from Ranorex.Button (or a similar class like Ranorex.CheckBox) to Ranorex.Control so the solution you mentioned in your reply is unfortunately not an option for me. Can it be done differently?
Thanks
Surs
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Ranorex Spy shows wrong Enabled-state of Elegant.Ui-buttons
Getting a list of Controls only works for Windows Forms application. Does your application use Windows Forms controls? If so, use the FindDescendants to get all WinForms controls in your application:surszer wrote:I got no results while using FindChildren<Ranorex.Control>()
IList<Ranorex.Control> allControls = myForm.FindDescendants<Ranorex.Control>();
Otherwise, if it is not a WinForms application, it's much easier to just search for all elements using the generic Unknown adapter that will accept any element, then you don't need all the if/else clauses or for loops:surszer wrote:so I had to look for each type of control (buttons, textboxes, checkboxes...) individually like this
IList<Ranorex.Unknown> allElements = myForm.Find<Ranorex.Unknown>(".//");
You cannot "cast", but you can use different adapter types for the same element. However, using the Control adapter will only work if the element corresponds to a Windows Forms Control, thereby supporting this adapter type. See following section in the Ranorex User Guide for more information:surszer wrote:As far as I know there is no possibility to cast from Ranorex.Button (or a similar class like Ranorex.CheckBox) to Ranorex.Control
http://www.ranorex.com/support/user-gui ... x-spy.html
Without a Ranorex snapshot or sample application it is difficult for us to analyze the issue. If you don't want (or are not allowed) to share a snapshot in the forum, could you send one to support_at_ranorex.com?surszer wrote:unfortunately I can't send you a snapshot.
And can you tell us some more about the automated application? Which UI technology/framework does it use?
Regards,
Alex
Ranorex Team