Page 1 of 1

Execution is blocked when a new window opens

Posted: Mon Aug 28, 2006 4:46 pm
by ranettix
When opening a dialogue window from within an application,
e.g for opening a file (OpenFileDialog), the Ranorex automation
hangs. After a while, a window comes up, asking for "Repeat"
or "Cancel". When pressing cancel, the automation exits with
"Process is terminated due to StackOverflowException.".

Are there special actions to be taken for additional dialogue
frames ?
:evil:

Posted: Wed Aug 30, 2006 11:25 am
by webops
> Are there special actions to be taken for additional dialog frames?

Yes, dialogs within an application are also top-level windows like the application itself.
If you open a modal dialog (e.g OpenFileDialog) you cannot automate the application form, you should automate and close the dialog first and than you can continue to automate the application.

You can find the dialog the same way as an application, but please always use a timeout, windows needs a little bit time to open a dialog:

Form openFileDialog = Application.FindFormTitle("DialogTitle",SearchMatchMode.MatchExact,true,2000);

Use the Form.Find or the Element.FindChild functions to find the elements of the dialog:

Element fileEditControl = openFileDialog.Element.FindChild(Role.Text,"TextElementName");
if( fileEditControl != null)
fileEditControl.Value = "D:\\Ranorex\\Bin\\RanorexNet.dll";

Element openButton = openFileDialog.Element.FindChild(Role.PushButton,"ButtonElementName","Button");
if (openButton != null )
openButton.DoDefaultAction();

The title of the dialogs and the names of the elements are language-specific, use RanorexSpy to get the correct name text.

You can continue with automating the application, after you closed the dialog.

Jenö Herget
Ranorex Team

Posted: Wed Aug 30, 2006 1:44 pm
by ranettix
Thanks for your hints. Anyway, this issue came up because of a
problem with toolbar button use - I'll post a bug report about that.

Execution is blocked when a new window opens

Posted: Mon Feb 05, 2007 5:43 pm
by KaiB
Hi,

I've got the same problem as described above. I tried the proposed solution but it didn't work. When I open the FileDialog manually before the test starts it is found by ranorex and the test goes on. But when I try to open the dialog by a ToolBarButton or the according MenuItem within the test-script the dialog appears and nothing happens. Is there still a bug in Ranorex or do I need the Professional version? I'm using .NET 2.0.50727.

Thanks for support!

Posted: Mon Feb 05, 2007 5:46 pm
by KaiB
Another question: Is it possible to get trial licence for the Professional version? I'm evaluating the software...

Posted: Mon Feb 05, 2007 10:39 pm
by webops
KaiB wrote:Is there still a bug in Ranorex or do I need the Professional version? I'm using .NET 2.0.50727.
We have no known issues similar like this in V1.0.0 and this should also work in the trial version.

You should find the Form with a timeout and activate it after you opened the dialog:

Code: Select all

Form openFileDialog = Application.FindFormTitle(
        "DialogTitle",SearchMatchMode.MatchExact,true,2000);

Please check the return value of the FindFormTitle function, post or send us your sample code if it doesn't work.
KaiB wrote:Is it possible to get trial licence for the Professional version? I'm evaluating the software...
Yes, we can send you a trial license, please write us an email with your company information.

Jenö