Can't find GUI Elements

Ask general questions here.
huan
Posts: 6
Joined: Thu Sep 10, 2009 9:26 am

Can't find GUI Elements

Post by huan » Thu Sep 10, 2009 9:31 am

Hello

I used the code following to the support code base:

Code: Select all

Form ABBControlTerminal = Host.Local.FindChild<Ranorex.Form>("ABB Control Terminal");
ABBControlTerminal.Activate();
			
Button button = repo.FindSingle<Button>("Login");
But I get the following errors:
Cannot implicitly convert type 'Ranorex.Form' to 'System.Windows.Forms.Form' (CS0029) - C:\Documents and Settings\chsobut\My Documents\RanorexStudio

Have I forgot something... ?

Best greetings

chrisgeorge
Posts: 49
Joined: Thu Aug 20, 2009 11:28 am

Re: Can't find GUI Elements

Post by chrisgeorge » Thu Sep 10, 2009 10:27 am

Perhaps you're referencing System.Windows.Forms? If so, try qualifying "Form" with Ranorex.

so ...

Code: Select all

    
    Ranorex.Form ABBControlTerminal = Host.Local.FindChild<Ranorex.Form>("ABB Control Terminal");
    ABBControlTerminal.Activate();
             
    Ranorex.Button button = repo.FindSingle<Button>("Login");
Chris George
Test Engineer

Red Gate Software Ltd
Cambridge

huan
Posts: 6
Joined: Thu Sep 10, 2009 9:26 am

Re: Can't find GUI Elements

Post by huan » Thu Sep 10, 2009 10:31 am

OK i found something în the forum that i need. It's the following code fragment:

Code: Select all

Form m_MessageBox = Application.FindFormTitle(AppTitle); 
Button bt_login = m_MessageBox.FindButton("FormLogin");
The Error Message I get says that Application has not such a method like FindFormTitle()
I'm relativley new to C# and I'm glad to receive some help...

I'm using Ranorex version 2.1.4

Hope somebody has a clue...

Best greetings!

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Can't find GUI Elements

Post by Support Team » Thu Sep 10, 2009 3:05 pm

chrisgeourge already posted the answer to your original question!

Application.FindFormTitle is an old API function only valid for Ranorex 1.X! Please, have a look at the samples delivered with the Ranorex setup, they should be a good starting point.

Regards,
Alex
Ranorex Support Team