I used driver.Quit();
in TeardownTest method.
But the browser is closed only if the test passed.
If a test failed, the browser is still open.
Why browser is not closed in this case?
We have Microsoft Visual team services builds, Visual Studio Test Agent is deployed to virtual machine. On the virtual machine is installed MS Agent for Visual studio 2015 Update 3. This problem, with closing the browser, happens only on virtual machine. If I run tests from Visual Studio on local machine, browser is closed if test passed or failed, in this case it works.