Hi Ranorex,
I try to use Ranorex to detect the button insite a ToolStrip control:
Please refer to my picture:
1) Press "Show All", four button will visible in the application.Spy work fine, it can detect four button
2) Press "Hide Button3", and the button3 in the ToolStrip will be hide.
3) Ranorex Spy can not detect button3 in ToolStrip anymore.
I think the right behavior should be: Button3 is detected in the ToolStrip, and the property "Visible" = "False"
If following this way, I can not verify status of button3 in my application.
Best regards,
HoangLX.
Ranorex Spy: Issue with Toolstrip control in .Net 2005
Ranorex Spy: Issue with Toolstrip control in .Net 2005
You do not have the required permissions to view the files attached to this post.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Ranorex Spy: Issue with Toolstrip control in .Net 2005
Hi hoanglz again!
The visible property can only be validated for controls i.e. we don`t show unvisible toolstrip buttons (non control elements) in the Element Tree because of structure representation and performance reasons.
Check the button visibility by using the Find("relativePathToButton") method from the Ranorex toolstrip element. If the element is invisible (or doesn`t exist), the method returns an empty list - so you can check if the returned list is empty.
Regards,
Christian
Support Team
The visible property can only be validated for controls i.e. we don`t show unvisible toolstrip buttons (non control elements) in the Element Tree because of structure representation and performance reasons.
Check the button visibility by using the Find("relativePathToButton") method from the Ranorex toolstrip element. If the element is invisible (or doesn`t exist), the method returns an empty list - so you can check if the returned list is empty.
Regards,
Christian
Support Team
Re: Ranorex Spy: Issue with Toolstrip control in .Net 2005
hi Christian,
humm, I think Ranorex should list all control in ToolStrip.
"Hidden button" is different from "Not exist button".
Thank you for fast support.
Best regards,
HoangLX.
humm, I think Ranorex should list all control in ToolStrip.
"Hidden button" is different from "Not exist button".
Thank you for fast support.
Best regards,
HoangLX.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Ranorex Spy: Issue with Toolstrip control in .Net 2005
We would like to show all the elements inside the .NET ToolStrip, however, the currently used technology (MSAA) for getting elements inside that tool strip does not report invisible buttons. So, not Ranorex is filtering the invisible button, but the control is by not conveying information about invisible buttons to Ranorex.hoanglz wrote:humm, I think Ranorex should list all control in ToolStrip.
"Hidden button" is different from "Not exist button".
In general, that is the default behavior for all technologies. Only visible elements are reported by Ranorex, since these are the only elements a user can interact with. So, instead of validating whether your button is visible, you should check whether the button exists by searching for it (like Christian posted).
Regards,
Alex
Ranorex Support Team
Re: Ranorex Spy: Issue with Toolstrip control in .Net 2005
hi Alex,
Ranorex Spy can still detect some hidden control in my form (visilbe = false)
Maybe the issue is Toolstrip control itself.
My question is: with toolstrip control:
GetItemCount will return number of Item (visible = true)
or
GetItemCount will return number of Item (visible = true) + (visible = false)
HoangLX.
Ranorex Spy can still detect some hidden control in my form (visilbe = false)
Maybe the issue is Toolstrip control itself.
My question is: with toolstrip control:
GetItemCount will return number of Item (visible = true)
or
GetItemCount will return number of Item (visible = true) + (visible = false)
Best regards,Support Team wrote: In general, that is the default behavior for all technologies. Only visible elements are reported by Ranorex, since these are the only elements a user can interact with.
HoangLX.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Ranorex Spy: Issue with Toolstrip control in .Net 2005
The usage of the visible property depends on the used technologie(MSAA,WinForms,WPF) of the tested control. Some technologies provide information about invisible items and some don't.
Children.Count which gives you the count of all items (visible + invisible) as in Ranorex Spy. If you want to get e.g. all underlying Buttons you can use FindDescendands<Ranorex.Button>()
To get all visible buttons use the following RanoreXPath:
Christian
Ranorex Support Team
In Ranorex.Toolbar class there`s no GetItemCount method.My question is: with toolstrip control:
GetItemCount will return number of Item (visible = true)
or
GetItemCount will return number of Item (visible = true) + (visible = false)
Children.Count which gives you the count of all items (visible + invisible) as in Ranorex Spy. If you want to get e.g. all underlying Buttons you can use FindDescendands<Ranorex.Button>()
To get all visible buttons use the following RanoreXPath:
IList<Ranorex.Button> visibleButtons = toolStrip.Find<RanorexButton>("button[@visible='true']");Best regards,
Christian
Ranorex Support Team