This project is read-only.
1
Vote

ApplicationUnderTest.Launch ("WpfTestApplication.exe") threw an exception

description

When try to lunch the WpfTestApplication.exe, the Visual Studio threw an exception :

Test Name: ResultBanner_CompareImages
Test FullName: AcceptEmail.ResultBanner.ResultBanner_CompareImages
Test Source: d:\Automation Tests\AcceptEmail\AcceptEmail\AcceptEmail\Templates\ResultBanner.cs : line 93
Test Outcome: Failed
Test Duration: 0:00:19.6240658

Result Message:
Test method AcceptEmail.ResultBanner.ResultBanner_CompareImages threw exception:
Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToLaunchApplicationException: The following error occurred when this process was started: Object reference not set to an instance of an object. File: D:\Automation Tests\AcceptEmail\AcceptEmail\AcceptEmail\bin\Debug\WpfTestApplication.exe. ---> System.NullReferenceException: Object reference not set to an instance of an object.
Result StackTrace:
at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindFromWindowHandle(IntPtr windowHandle)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl..ctor(IntPtr windowHandle)
at Microsoft.VisualStudio.TestTools.UITesting.ApplicationUnderTest.SetCurrentProcessPrivate(Process value)
at Microsoft.VisualStudio.TestTools.UITesting.ApplicationUnderTest.<>c__DisplayClassb.<set_Process>b__a()
at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction)
at Microsoft.VisualStudio.TestTools.UITesting.ApplicationUnderTest.set_Process(Process value)
at Microsoft.VisualStudio.TestTools.UITesting.ApplicationUnderTest.Start(ProcessStartInfo startInfo)
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.TestTools.UITesting.ApplicationUnderTest.Start(ProcessStartInfo startInfo)
at Microsoft.VisualStudio.TestTools.UITesting.ApplicationUnderTest..ctor(String fileName, String alternateFileName, String arguments)
at Microsoft.VisualStudio.TestTools.UITesting.ApplicationUnderTest.<>c__DisplayClass1.<Launch>b__0()
at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction)
at Microsoft.VisualStudio.TestTools.UITesting.ApplicationUnderTest.Launch(String fileName, String alternateFileName, String arguments)
at Microsoft.VisualStudio.TestTools.UITesting.ApplicationUnderTest.Launch(String fileName)
at AcceptEmail.ResultBanner.CompareTheImages() in d:\Automation Tests\AcceptEmail\AcceptEmail\AcceptEmail\Templates\ResultBanner.cs:line 380
at AcceptEmail.ResultBanner.VerifyRessultBannerImagesUploaded() in d:\Automation Tests\AcceptEmail\AcceptEmail\AcceptEmail\Templates\ResultBanner.cs:line 284
at AcceptEmail.ResultBanner.ResultBanner_CompareImages() in d:\Automation Tests\AcceptEmail\AcceptEmail\AcceptEmail\Templates\ResultBanner.cs:line 96



If I used CodedUI test, this application is working , but if I try to use with a project with Unit Test, is not working

comments