Ranorex

Execution is blocked when a new window opens

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



Joined: 28 Aug 2006
Posts: 16

PostPosted: Mon Aug 28, 2006 5:46 pm    Post subject: Execution is blocked when a new window opens
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 or Very Mad
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 05 Jul 2006
Posts: 351

PostPosted: Wed Aug 30, 2006 12:25 pm    Post subject:
> 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,tru e,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
Back to top
View user's profile Send private message Visit poster's website
ranettix



Joined: 28 Aug 2006
Posts: 16

PostPosted: Wed Aug 30, 2006 2:44 pm    Post subject:
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.
Back to top
View user's profile Send private message
KaiB



Joined: 05 Feb 2007
Posts: 2

PostPosted: Mon Feb 05, 2007 6:43 pm    Post subject: Execution is blocked when a new window opens
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!
Back to top
View user's profile Send private message
KaiB



Joined: 05 Feb 2007
Posts: 2

PostPosted: Mon Feb 05, 2007 6:46 pm    Post subject:
Another question: Is it possible to get trial licence for the Professional version? I'm evaluating the software...
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 05 Jul 2006
Posts: 351

PostPosted: Mon Feb 05, 2007 11:39 pm    Post subject:
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: click into code to enlarge
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ö
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