Just a information : Automation API

Just a information

Class library usage, coding and language questions.

Just a information

Postby arishahsan » Mon Mar 05, 2007 9:12 am

Can we get the three things programatically using ranorex
1. Active window
2. Focused Control in a form
3. Focused Element in a Control or in a form
If you have any direct command to do so plzz let me know.
arishahsan
 
Posts: 26
Joined: Thu Jan 18, 2007 1:04 pm

Postby admin » Mon Mar 05, 2007 11:42 pm

arishahsan wrote:1. Active window

The static get property Form.Active retrieves the currently active top level form.
(Works only in V1.1.0 or above)

arishahsan wrote:2. Focused Control in a form


The static get property Form.GetFocus returns the control that has the keyboard focus.

arishahsan wrote:3. Focused Element in a Control or in a form


We don't support this functionality directly at the moment.
But you can read the selected items of the controls or you can use the Focused or Selected flag of the State enumeration.

Jenö
admin
Site Admin
 
Posts: 351
Joined: Wed Jul 05, 2006 8:44 pm

Postby anujakulkarni » Wed Feb 11, 2009 4:07 pm

Hi,

I am not able to use the
Form.Active
method while coding in C# using Ranorex.I am using Ranorex evaluation version 2.0.

Please let me know how I can check if a window/dialogbox is active ?

Cheers,
anujakulkarni
 
Posts: 29
Joined: Wed Jan 07, 2009 2:15 pm

Postby Support Team » Wed Feb 11, 2009 4:14 pm

What do you mean with "I am not able"?

The Form adapter provides an Active property that is true if the form is the currently active window.

Regards,
Alex
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Postby anujakulkarni » Wed Feb 11, 2009 4:18 pm

Well I have a form called FormEnquiry. If I add a statement like
Code: Select all
if(repo.FormEnquiry.Active)
"repo" is an instance of the GlobalRepository, I am geting a compile time error which says
'ACBS2201.GlobalRepositoryFolders.FormEnquiryAppFolder' does not contain a definition for 'Active' and no extension method 'Active' accepting a first argument of type 'ACBS2201.GlobalRepositoryFolders.FormEnquiryAppFolder' could be found (are you missing a using directive or an assembly reference?) (CS1061) - D:\Projects\ACS\Ranorex Projects\ACBS2201\ACBS2201\Program.cs:361,24


Am I missing something?

Cheers,
anujakulkarni
 
Posts: 29
Joined: Wed Jan 07, 2009 2:15 pm

Postby Support Team » Wed Feb 11, 2009 4:45 pm

anujakulkarni wrote:Am I missing something?

Yes, the word "Self" :-)

To access the adapter corresponding to a repository folder, use the Self property of the folder:
Code: Select all
if (repo.FormEnquiry.Self.Active)


Regards,
Alex
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Postby anujakulkarni » Wed Feb 11, 2009 5:00 pm

thanks..that was really helpful :D

Is there any documentation where I can check for such missing things rather than bothering you guys every now and then :roll: :P ?

Cheers,
anujakulkarni
 
Posts: 29
Joined: Wed Jan 07, 2009 2:15 pm

Postby Support Team » Wed Feb 11, 2009 5:10 pm

There is a documentation for the repository browser, but it does not explain the Self property of rooted folders. We will add that :-)

Regards,
Alex
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests