form.findChildText return null

Bug reports.
cherry
Posts: 5
Joined: Wed Jun 06, 2007 3:15 am

form.findChildText return null

Post by cherry » Wed Jun 06, 2007 3:13 pm

I run the program many times. sometime it can return the control, but sometime it just returns null. And at every first time when I open the VS2005 I run the program, it returns null.

admin
Site Admin
Site Admin
Posts: 350
Joined: Wed Jul 05, 2006 7:44 pm

Post by admin » Thu Jun 07, 2007 3:35 pm

You should consider that the tested app runs in an other process space. In some cases you should wait a little bit after finding the form. This is required if the controls in the tested app needs some time to be generated.

Please try following:

Code: Select all

Form form = Application.FindFormTitle("MiniView");
Application.Sleep(200);
Control menuStrip = form.FindChildText("MenuStrip"); 
Best Regards

Gabor
Ranorex Team