Detect a new window is opened

Ask general questions here.
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Detect a new window is opened

Post by atom » Tue Feb 17, 2009 8:51 pm


I have an MDI application
I perform some menu select, that opens a new MDI child form
How can i detect and get a reference to the new MDI child form, without knowing its Title ?


User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Post by Support Team » Tue Feb 24, 2009 2:22 pm


First of all I need to know how do you want to search for the form.
- using a RanoreXPath expression or
- some sort of FindChild methods?

In case of RanoreXPath based search you have to consider the following:

If you have only one MDI child form within your application there is no need to specify the title with RanoreXPath.

Code: Select all

/form[@title='MDI Windows Application']/container/form
If you have two or more MDI child forms opened at the same time you should use the controlid within your RanoreXPath expression.

Code: Select all

/form[@title='MDI Windows Application']/container/form[@controlid='65282']
When using the FindChild or FindChildren method you'll have to distinguish between different MDI children manually in code.

RanoreXPath would be the more comfortable way to identify a MDI child form without knowing its title.

best regards,

Ranorex Support Team