Hi I am using Telerik Testing Framework and while launching a WPF application I am encountering an exception
Test Name: TestMethod1
Test FullName: TestStudioProject1.UnitTest1.TestMethod1
Test Source: C:\Imran\Code\Emdat\Inscribe-CUIT-automation\CodedUITest_TelerikEditor\TestStudioProject1\UnitTest1.cs : line 23
Test Outcome: Failed
Test Duration: 0:00:07.5626828
Result StackTrace:
at ArtOfTest.Common.Win32.Connector.InjectCode(IntPtr handle, String assemblyAndClass, String pipename, String pid, Boolean waitForDocument, Int32 waitForDocumentTimeout, String navigateUrl)
at ArtOfTest.WebAii.Wpf.WpfWindow.ConnectToWindow(IntPtr handle, String pipename, String pid)
at ArtOfTest.WebAii.Wpf.WpfApplication.get_MainWindow()
at ArtOfTest.WebAii.Core.Manager.LaunchNewApplication(ProcessStartInfo pinfo)
at ArtOfTest.WebAii.Core.Manager.LaunchNewApplication(String path, String[] args)
at TestStudioProject1.UnitTest1.TestMethod1() in C:\Imran\Code\Emdat\Inscribe-CUIT-automation\CodedUITest_TelerikEditor\TestStudioProject1\UnitTest1.cs:line 25
Result Message:
Test method TestStudioProject1.UnitTest1.TestMethod1 threw exception:
System.NullReferenceException: Object reference not set to an instance of an object.
The code is
public void TestMethod1()
{
Manager manager = new Manager(true);
WpfApplication wpfApplication = manager.LaunchNewApplication(@"C:\TelerikWpfApp2\TelerikWpfApp1\bin\Debug\TelerikWpfApp1.exe");
var richtextbox = wpfApplication.MainWindow.Find.ByAutomationId<ArtOfTest.WebAii.Controls.Xaml.Wpf.RichTextBox>("radRichTextBox");
}
Let me know am I missing anything here!!!
Thanks,
Imran