Ranorex 1.0.0 (.Net2.0)
In their infinite wisdom, our developers have created a form with Buttons as children of another button.
RanorexSpy can show me details of the child buttons, however the libraries cannot/donot detect this situation.
As it's our license agreement form, this poses a major problem for us.
(well there is XY coords - for a functional test)
O I agree
O I disagree
These two RadioButtons are children of a 'placeholder' button (I'm told something to do with enabling/disabling the [Next] button - that's their story)
--Is this a bug, or an enhancement? (feel free to move post)
Cheers
Gryphyn
Buttons within Buttons
If RanorexSpy can show you details, then you can find the button with the Find() functions.Gryphyn wrote:RanorexSpy can show me details of the child buttons
Find first the placeholder button in the form with the Form.FindButton() function.Gryphyn wrote:These two RadioButtons are children of a 'placeholder' button
You can then find the children with the Element.FindChild() functions.
Read the state with Element.GetState, check or uncheck the radio button with Element.DoDefaultAction or with Mouse.ClickElement.
See also the sample RanorexVS2005Sample3 in the Samples directory.
Jenö Herget
Ranorex Team
This is the point. The Find() functions are not finding the child-buttons.
I've done a full cascade of Element.FindChild(n) into Element.FindChild(n)
traversing from the main-form to every accessable child.
The Radio buttons do not appear in the list.
Even finding the 'container' button, then checking only for its decendants does not discover the RadioButtons. The container has a ChildCount of 0(zero)
Cheers
Gryphyn
I've done a full cascade of Element.FindChild(n) into Element.FindChild(n)
traversing from the main-form to every accessable child.
The Radio buttons do not appear in the list.
Even finding the 'container' button, then checking only for its decendants does not discover the RadioButtons. The container has a ChildCount of 0(zero)
Cheers
Gryphyn
I think you should wait a little bit after clicking the Next button on the first wizard page (until the next page is ready).
The pages have the same title text and the same class name, so you should search every single page after cllicking the Next button.
I could automate the wizard as follows:
(Code without error handling)
Jenö Herget
Ranorex Team
The pages have the same title text and the same class name, so you should search every single page after cllicking the Next button.
I could automate the wizard as follows:
(Code without error handling)
Code: Select all
try
{
// Searching the first wizard page
Form form = Application.FindFormTitle("Title of the wizard page");
// Searching and clicking the "Next" button
Control nextButton = form.FindChildText("&Next >");
Mouse.ClickControl(nextButton);
// Waiting 1 sec for the second wizard page
Application.Sleep(1000);
form = Application.FindFormTitle("Title of the wizard page");
// Searching and clicking the "I accept ..." button
Control iAcceptButton = form.FindChildText("I &accept the license agreement");
Mouse.ClickControl(iAcceptButton);
// Waiting 1 sec until next button ready (enabled)
Application.Sleep(1000);
// Searching and clicking the "Next" button
nextButton = form.FindChildText("&Next >");
Mouse.ClickControl(nextButton);
...
Application.Sleep(2000);
return 0;
}
catch (RanorexException e)
{
Console.WriteLine("\nEXCEPTION\nSource={0}\nSender={1}\nMessage={2}\nStackTrace={3}\n",
e.Source, e.Control, e.Message, e.StackTrace);
return 1;
}
Ranorex Team
A delay was prudent.admin wrote:I think you should wait a little bit after clicking the Next button on the first wizard page (until the next page is ready).
The pages have the same title text and the same class name, so you should search every single page after cllicking the Next button.
I could automate the wizard as follows:
(Code without error handling)
<snip>
Jenö Herget
Ranorex Team
The 'page' in question also has a .RTF document that gets loaded into a RichEdit control. This I/O was delaying the button creation. (~50-60ms)
I'm not happy placing 'generic' sleeps within my code, but I have managed to isolate this particular case, so the effect is now negligable.
Issue resolved - no further action.
Cheers
Gryphyn