Page 1 of 1

form.Text throws exception if window has no title

Posted: Mon Feb 04, 2008 7:12 pm
by p.zott
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

Posted: Tue Feb 05, 2008 9:28 am
by Support Team
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