admin Site Admin
Joined: 05 Jul 2006 Posts: 351
|
Posted: 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 |
|