First of all, thanks so much for providing Ranorex for free.
Now for the question: Is there an easier way to find a form element than to use Element.FindChild()? Here's my situation:
I'm using Ranorex to parse information from a Windows form. I can access most of the form elements and output their Value properties, or Controls and their Text properties. However, I'm having trouble accessing a graphic on the form.
I've used DumpElementTree() from your sample code to output every single element from a Windows form into flat-file and imported it into Excel to analyze. (I tried using RanorexSpy but I couldn't all the elements in the form.) Looking at the data, I can see every element's Role, Name, Value, State, Class, etc. properties. However, there are numerous elements that have missing Name, Value, and other properties.
The element I'm trying to access is a Role.Graphic, but I can't use any of the overloaded Element.FindChild() methods because the element doesn't have a unique Role, it has no Name, and doesn't have a unique Class. It does, however, have a unique location. Is there any chance another overloaded Element.FindChild() method can be created that also takes the location as a parameter?
Or maybe there's some way to uniquely identify every single element in a form? Looks like Control Id doesn't always work because according to RanorexSpy, not every single element has a Control Id. I guess I could just interate through every element (like what DumpElementTree() does) and find the element manually, but it seems like there should be an easier way to do it.
Of course, once I do get access to the graphic element, is there a way to see what image it's displaying? Something like an ImageSource property for the graphic? I'm trying to find out the type of image that's being displayed without resorting to Optical Character Recognition.
Easier way to find elements than Element.FindChilld()?
> Is there any chance another overloaded Element.FindChild() method can be created that also takes the location as a parameter?
Some other users posted also the problem with Elements they have no Name, but a unique position. We will implement some functions in a future version ( >= V0.9.4 ) to retrieve the Element object at a specified position in a control or in a form.
For example, the control class will have a method:
> Is there a way to see what image it's displaying?
It's no problem if your company develop the application.
The developer should set the value property of the image to the image name and you can read the property of the element if you automate or test the application with Ranorex.
Jenö Herget
Ranorex Team
Some other users posted also the problem with Elements they have no Name, but a unique position. We will implement some functions in a future version ( >= V0.9.4 ) to retrieve the Element object at a specified position in a control or in a form.
For example, the control class will have a method:
Code: Select all
public Element GetElementFromPoint(Point point);
> Is there a way to see what image it's displaying?
It's no problem if your company develop the application.
The developer should set the value property of the image to the image name and you can read the property of the element if you automate or test the application with Ranorex.
Jenö Herget
Ranorex Team
One of the overloaded methods already takes:admin wrote:We will implement some functions in a future version ( >= V0.9.4 ) to retrieve the Element object at a specified position in a control or in a form.
Code: Select all
public Element FindChild(
Role role,
string name,
string className
);
Code: Select all
public Element FindChild(
Role role,
string name,
string className,
Point location
);
Unfortunately, it's 3rd party application. The value property of the image is blank. Are there any other Element properties that can be exposed in addition to the current ones (Class, DefaultAction, Description, GetChildCount, Help, Location, Name, Role, Size, State, Value) that might help find out the image source?admin wrote:> Is there a way to see what image it's displaying?
It's no problem if your company develop the application.
The developer should set the value property of the image to the image name and you can read the property of the element if you automate or test the application with Ranorex.
Thanks
You are right, we will implement a new overloaded FindChild method with location:
RanorexCore identifies the elements internally also by Name, Role, ClassName and Location, it's the only possibility to identify uniquely an element.
Is your 3rd party application a managed application?
Code: Select all
public Element FindChild(
Role role,
string name,
string className,
Point location
);
Not at the moment, but there are some other possibilities to get information from an other process (in which your 3rd party application runs). We are just working on a new feature, but this will work only for managed code.pizzaguy wrote:Are there any other Element properties that can be exposed in addition to the current ones (Class, DefaultAction, Description, GetChildCount, Help, Location, Name, Role, Size, State, Value) that might help find out the image source?
Is your 3rd party application a managed application?
No, unfortunately it's not a managed application. Do you have an estimate on when the next version will be out? Thanks.admin wrote:Not at the moment, but there are some other possibilities to get information from an other process (in which your 3rd party application runs). We are just working on a new feature, but this will work only for managed code.pizzaguy wrote:Are there any other Element properties that can be exposed in addition to the current ones (Class, DefaultAction, Description, GetChildCount, Help, Location, Name, Role, Size, State, Value) that might help find out the image source?
Is your 3rd party application a managed application?
I'm sorry, but i don't know at the moment.pizzaguy wrote:Do you have an estimate on when the next version will be out? Thanks.
We have made a V0.9.4-Beta1 last week:
http://www.ranorex.com/download/Ranorex ... -Beta1.zip
We are working on some new features at the moment and we have also some feature requests.
I hope we can make the next Beta 'V0.9.4-Beta2' with the new overloaded FindChild function next week.
Jenö Herget
Ranorex Team