Null Pointer Exception

Class library usage, coding and language questions.
dave0989
Posts: 3
Joined: Thu Jul 12, 2007 4:45 pm

Null Pointer Exception

Post by dave0989 » Mon Jul 16, 2007 4:29 pm

I have been working through the examples you have listed for .net testing. The real only change I have made is the name of the control and the caption text.


Control seekButton = form.FindChildText("Seek Device");
Mouse.ClickControl(seekButton);

I get a Null Pointer Exception when I run the application. and it points to the first line in the code above. I ran the example almost the same way with the exception of a few name changes. What object am I supposed to instantiate in this example?

webops
Site Admin
Site Admin
Posts: 349
Joined: Wed Jul 05, 2006 7:44 pm

Post by webops » Mon Jul 16, 2007 7:05 pm

Code: Select all

I get a Null Pointer Exception when I run the application. and it points to the first line in the code above.
This can happen if the form object reference is null (e.g. Application.FormFindTitle cannot find a form with the specified title and returns null):

Form form = Application.FindFormTitle("RanorexTestedApp");

Please check your form object, which sample do you mean?

Jenö
Ranorex Team