form.Text throws exception if window has no title

Bug reports.
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


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

Code: Select all

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


User avatar
Support Team
Site Admin
Site Admin
Posts: 12173
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA

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.

Ranorex Support Team