I'm running into situations where debugging tests causes Visual Studio to restart. A very simple code selection that causes this is (using NUnit framework):
- Code: Select all
[Test]
public void DialogTest()
{
var myHelper = new HelperMethods();
myHelper.CloseDialogs();
}
- Code: Select all
using Ranorex;
namespace NextGen.HelperClasses
{
class HelperMethods
{
public void CloseDialogs()
{
var myGenericForm = Host.Local.FindSingle<Form>("/form[@active='True']");
}
}
}
The intent of the test was to find the currently active dialog and see how I could go about closing it. This isn't the only time Visual Studio restarts, but this one is very consistent. If I put a break point in the CloseDialogs method to see what the value of myGenericForm is and then start the test in Debug mode (I have ReSharper installed to do this) the code gets to my CloseDialogs method, waits a couple seconds and then restarts VisualStudio.
Is there a solution to this problem? We're close to purchasing and I don't want this to throw a wrench in things. I'm hoping there is just a config issue I need to deal with to correct this problem.
Thanks,
Jason