Ranorex

Recognition of the Class Name

 
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexNet
View previous topic :: View next topic  
Author Message
CookieMonster



Joined: 14 Aug 2006
Posts: 6

PostPosted: Wed Aug 16, 2006 8:41 am    Post subject: Recognition of the Class Name
I made an application in VS2005 to test ranorex, for e.g I couldn't use the Form.FindClassName("Form1") I hade to use Form.FindClassName("WindowsForms10.Window.8.app.0.378734a"). Is there a possibility to make the class name visible?

Thanks
Dan
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 05 Jul 2006
Posts: 351

PostPosted: Wed Aug 16, 2006 10:22 pm    Post subject:
The class name you see in RanorexSpy is not the name of the class in your source code.
Handle, Class name and ControlId are old properties of a window.
See also: http://windowssdk.msdn.microsoft.com/en-us/library/ms632596.aspx

Use these properties only if you want to automate an old windows application.
In .NET applications the ControlId is different every time you launch the form, so you cannot use this as your identifier. The class name is also dynamically generated.
Use the Control name property to find a control in a .NET application.

See also: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwin forms/html/autowforms.asp

Jenö Herget
Ranorex Team
Back to top
View user's profile Send private message Visit poster's website
puyopuy



Joined: 26 Jul 2007
Posts: 2

PostPosted: Thu Jul 26, 2007 8:02 am    Post subject:
Hi admin,

I'm developing a new application using .NET what property should I use for identifier? My new application will support multiple languages, so I cannot use Form Title as identifier?

Thanks
Jeff
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 05 Jul 2006
Posts: 351

PostPosted: Thu Jul 26, 2007 7:02 pm    Post subject:
Quote:
...what property should I use for identifier?


You can use the Name of the Form, we have no Application.FormFindName at the moment, but you can find the Form by Name easily as follows:

Code: click into code to enlarge
foreach (Form form in Application.Forms)
{
    if (form.Name == "SearchedForm" )
    {
        form.Activate();
        break;
    }
}

Jenö
Ranorex Team
Back to top
View user's profile Send private message Visit poster's website
puyopuy



Joined: 26 Jul 2007
Posts: 2

PostPosted: Fri Jul 27, 2007 1:24 am    Post subject:
Thanks Jenö, you help is much appreciated
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexNet All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum