I'm running two tests that on their own succeed without any issues, however when I run them both together I get a null pointer exception in the Telerik framework code.
The tests both use a custom build framework that uses the following structure:
and achieve this by exposing the sub elements of the application structure using properties with the following code:
MyPanel : CustomPanelWrapper
subPanel ?? (subPanel =
CustomPanelWrapper : FrameworkElement
The application is being started up in a separate process for each test and then closed afterwards using the following code:
var appProcess =
appProcess.StartInfo.FileName = <filePath>;
appProcess.StartInfo.WorkingDirectory= <App Directory>;
TelerikWpfTestRunner : BaseWpfTest
TelerikWpfTestRunner (Process appProcess,
Application = Manager.ConnectToApplication(appProcess);
(I've omitted some code for clarity that just deals with catching null values in our code)
The exception occurs when I try to do anything with the elements themselves (i.e. User.Click(), Refresh()) and I get the following error when trying to set a value in a comboBox:
Object reference not set to an instance of an object.
at ArtOfTest.WebAii.Messaging.Process.PipeCommunication.WriteCommandToPipe(PipeCommand command, PipeStream pipe, Boolean waitForDrain)
at ArtOfTest.WebAii.Messaging.Process.BrowserRemoted.ProcessBrowserRequest(BrowserCommand command, String requestId)
at ArtOfTest.WebAii.Wpf.WpfProxy.ExecuteSLCommand(SilverlightCommand cmd)
at ArtOfTest.WebAii.Wpf.WpfProxy.SetProperty(AutomationProperty property, IAutomationPeer peer, Object value)
at ArtOfTest.WebAii.Silverlight.AutomationObject`1.SetProperty(AutomationProperty property, Object value)
at ArtOfTest.WebAii.Controls.Xaml.Wpf.ComboBox.set_IsDropDownOpen(Boolean value)
at ArtOfTest.WebAii.Controls.Xaml.XamlControlHelper.OpenComboBoxDropDown(IComboBox combo, Boolean simulateRealUser)
at ArtOfTest.WebAii.Controls.Xaml.Wpf.ComboBox.OpenDropDown(Boolean simulateRealUser)
....(rest of our code)
I get the same error popup when also dealing with other controls on the second test only and when I run that test in isolation again the test passes with no exceptions.
Any ideas why this is happening?
I've tried adding some wait code in between tests to make sure the last test exits before the next one starts but this doesn't seem to do the trick.
Also both tests run one after the other and we are using MSTest as our test runner with Resharper 7.1 and Visual Studio 2012.