每次编码的ui测试执行后,Closign浏览器.仅在我的测试失败时才想关闭浏览器. [英] Closign browser after every coded ui test execution. Would like to close browser when my test failed only.

查看:92
本文介绍了每次编码的ui测试执行后,Closign浏览器.仅在我的测试失败时才想关闭浏览器.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用2012年和2013年创建了一些测试脚本.我的测试清理方法如下.

I created some test scripts using 2012 and some in 2013. my test clean up method has below one.

如果

(TestContext.CurrentTestOutcome.ToString()== )

(TestContext.CurrentTestOutcome.ToString() == "Failed")

{             

{              

this.UIMap1.CloseBrowser();

}

我正在使用2013执行测试.每次测试执行结束时,浏览器都会关闭.请帮我解决这个问题.

I am executing my tests using 2013. browser is closing at the end of each test execution. Please help me how to solve this.

推荐答案

您应该能够使用http://msdn.microsoft.com/zh-CN/library/microsoft.visualstudio.testtools.uitesting.applicationundertest.closeonplaybackcleanup(v = vs.110).aspx

You should be able to use CloseOnPlaybackCleanup property the http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.uitesting.applicationundertest.closeonplaybackcleanup(v=vs.110).aspx

类似的东西:

browserWindow.CloseOnPlaybackCleanup = false;

希望这会有所帮助,


这篇关于每次编码的ui测试执行后,Closign浏览器.仅在我的测试失败时才想关闭浏览器.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆