Null Reference Exception when trying to start a WPF app.

3 posts, 0 answers
  1. Paul
    Paul avatar
    6 posts
    Member since:
    Apr 2008

    Posted 10 Mar 2016 Link to this post

    I have downloaded the latest version of the Testing Framework and I am trying to create my first test on a WPF application.

    I get a the following error when I try to run the test.

    Test Name: TestMethod1
    Test FullName: UnitTestProject1.UnitTest1.TestMethod1
    Test Source: c:\Dev\PARM\UnitTestProject1\UnitTest1.cs : line 15
    Test Outcome: Failed
    Test Duration: 0:00:00.0284715

    Result Message:
    Test method UnitTestProject1.UnitTest1.TestMethod1 threw exception: 
    System.NullReferenceException: Object reference not set to an instance of an object.
    Result StackTrace: at UnitTestProject1.UnitTest1.TestMethod1() in c:\Dev\PARM\UnitTestProject1\UnitTest1.cs:line 16


    My test method is:

    using System;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using ArtOfTest.WebAii.Core;
    using ArtOfTest.WebAii.TestTemplates;

    using ArtOfTest.WebAii.Wpf;

    namespace UnitTestProject1
        public class UnitTest1
            public void TestMethod1()
                WpfApplication wpfApp2 = Manager.Current.LaunchNewApplication(@"C:\Dev\PARM\PARM\bin\Debug\PARM.exe");

  2. Paul
    Paul avatar
    6 posts
    Member since:
    Apr 2008

    Posted 10 Mar 2016 in reply to Paul Link to this post

    I have figured this out. I needed to create the test using the xUnit_WPF using Add->New Item and then select from the Telerik framework options.
  3. Ivaylo
    Ivaylo avatar
    775 posts

    Posted 14 Mar 2016 Link to this post

    Hеllo Paul,

    Glad to hear you have figured it out.

    I am closing this case.

    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top