Ranorex

How to use old controls without control name?

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


Joined: 05 Jul 2006
Posts: 351

PostPosted: Tue Aug 15, 2006 12:05 am    Post subject: How to use old controls without control name?
Some user asked me per Mail how to find and automate older controls without a control name with RanorexNet.

We will implement overloaded methods to find controls in a form with ControlId and ClassName in the next Version 0.9.3.
In the actual RanorexNet Version (or in older ones) you can do the following:

1. Get the ControlId with RanorexSpy
2. Find the control with form.FindControlId()
3. Check the control type and cast to the desired type

For example, you can check the Hex radio buttom of the calc application (see first sample) as follows:

Code: click into code to enlarge
Control control = form.FindControlId(306);
if (control is RadioButton)
{
    RadioButton hexRadio = (RadioButton)control;
    Mouse.MoveToControl(hexRadio);
    hexRadio.Checked = true;
}

Jenö Herget
Ranorex Team
Back to top
View user's profile Send private message Visit poster's website
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