Execution is blocked when a new window opens

Class library usage, coding and language questions.
ranettix
Posts: 20
Joined: Mon Aug 28, 2006 12:07 pm

Execution is blocked when a new window opens

Post by ranettix » Mon Aug 28, 2006 4:46 pm

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:

admin
Site Admin
Site Admin
Posts: 350
Joined: Wed Jul 05, 2006 7:44 pm

Post by admin » Wed Aug 30, 2006 11:25 am

> 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

ranettix
Posts: 20
Joined: Mon Aug 28, 2006 12:07 pm

Post by ranettix » Wed Aug 30, 2006 1:44 pm

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.

KaiB
Posts: 2
Joined: Mon Feb 05, 2007 5:00 pm

Execution is blocked when a new window opens

Post by KaiB » Mon Feb 05, 2007 5:43 pm

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!

KaiB
Posts: 2
Joined: Mon Feb 05, 2007 5:00 pm

Post by KaiB » Mon Feb 05, 2007 5:46 pm

Another question: Is it possible to get trial licence for the Professional version? I'm evaluating the software...

admin
Site Admin
Site Admin
Posts: 350
Joined: Wed Jul 05, 2006 7:44 pm

Post by admin » Mon Feb 05, 2007 10:39 pm

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ö