If you are using UI objects in test consider using UITestMethod attribute instead of TestMethod to execute test in UI thread. ...