Can I configure Watin to leave the browser window open when the test completes?
I've just begun trying out WatiN as part of my testing platform for web projects. For ease of setting up tests and also for allowing some "manual" intervention I'd like to set an option so that the browser window remains open when the test completes. I'm using the simple quick start with the following code...
public void Should_start_google()
{
using (var browser = new IE("google.com"))
{
browser.TextField(Find.ByName("q")).TypeText("Hello WatiN");
browser.Button(Find.ByName("btnG")).Click();
}
}
It runs perfectly fine however when its complete the brow开发者_开发百科ser shuts down with the test. Is there any way to have the browser window remain open? I think it will be useful for developing my tests.
Thanks, Justin
You should set the AutoClose property to false
.
In your case, you would just need to add the following line:
browser.AutoClose = false;
精彩评论