Bricks Exception on running two tests

May 5, 2012 at 1:24 PM

I have Mstest test methods that run a WPF application and do database snapshot restore in the teardown method so that the next test starts fresh. The problem is that when I run one of the tests individually, the test passes and the restore of the database completes successfully. however, running any two of the tests together results in the first one being successfully while the other throws an exception after crashing the application. the following exception is thrown by the second test:

Test method TestProject.Windows.Consumers.SubscriberSevices.MobileSubscriberProfile.Prepaid.PrepaidMobileSubscriberAdditionTests.AddNewPrepaidMobileSubscriberProfile_8CharsLongSubscriberName_ShouldBeSavedSuccessfully threw exception:
Bricks.BricksException: Error invoking TextBox.SetValue ---> System.InvalidOperationException: Value is read-only.

I am using Textbox.BulkText in entering text into the textboxes. I tried to use Textbox.SetValue() and TextBox.Text and Keyboard.Enter() but all did not work.

Does anyone have an idea what is cooking in here and if there is any work around?


May 6, 2012 at 4:47 AM

What you described fits the label of intermittent tests - hence check for state changes that the passing test isn't resetting on its way out.

The error message seems to indicate that the Textbox is ReadOnly when you're trying to write to it. Can you run the test scenario manually to eliminate issues in the AUT ?