form.Text throws exception if window has no title

Bug reports.
p.zott
Posts: 18
Joined: Sat Jul 22, 2006 6:35 pm

form.Text throws exception if window has no title

Post by p.zott » Mon Feb 04, 2008 7:12 pm

Hi,

The following code throws an exception if the forms title is empty:

Code: Select all

foreach (Form form in Application.Forms)
{
    try
    {
        if (form.Text.Contains("Microsoft Word"))
        {
            // do something
        }
    }
    catch (CommandFailedException)
    { }
}
I use the version V1.3.

Peter

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 05, 2008 9:28 am

You're right, Form.Text throws a CommandFailedException if Application.ErrorAsException is enabled and the form got no title (i.e. only an empty one). An empty string should be returned instead.

This is a known bug in RanorexNet V1.3.1 and will be fixed in V1.4.

Regards,
Alex
Ranorex Support Team