Coded UI Test: ApplicationUnderTest close after test complete
<p>I have seen lot of answered for same question on stakeoverflow but nothing is working for me. </p>

<p>I am using Visual studio 2013. I have a very simple Test</p>

<pre><code>[CodedUITest]
public class CodedUITest1
{
     static ApplicationUnderTest _application;
    [TestMethod]
    public void CodedUITestMethod1()
    {
        var mainWindow = ApplicationUnderTest.Launch(@"C:\Program Files (x86)\Notepad++\notepad++.exe");
        mainWindow.CloseOnPlaybackCleanup = false;
        _application = mainWindow;                 
    }
}
</code></pre>

<p>I am setting  CloseOnPlaybackCleanup to false as mentioned below.</p>

<pre><code> mainWindow.CloseOnPlaybackCleanup = false;
</code></pre>

<p>But whenever i run/debug test, application get close after test is completed. I have noticed that for browser window if we set CloseOnPlaybackCleanup to false then it work fine and browser window do not close. I am expecting same behavior for my this test.</p>

<p>can anyone please help me to identify if anything is missing?</p>

<p>Regards.</p>