设置脚本失败时,自动化测试仍在运行 [英] Automation tests are still running when setup script is failed

查看:129
本文介绍了设置脚本失败时,自动化测试仍在运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在MTM/Microsoft TestManager中为自动测试创建和配置TestSetting时,高级"部分中有一个脚本"标签,可让您指定"[...]" 在开始自动测试之前和之后在测试计算机上运行的脚本. (请参见

when creating and configuring a TestSetting for automated tests in MTM/Microsoft TestManager, there's a 'Script's tab in the 'Advanced' section that lets one specify "[...] Scripts to be run on the test machine before and after starting automated tests. [...]" (see http://msdn.microsoft.com/en-us/library/vstudio/ee231892.aspx#MTMTestSettingsDeployment).

我创建了一个CMD脚本来安装需要测试的产品,并将其添加到要运行的自动化测试之前要运行的TestSetting中.但是,如果安装脚本失败(ExitCode!= 0),则自动化测试仍会运行,并且自此以来所有操作均失败 未安装该产品.有谁知道如何设置安装脚本失败,自动化测试不运行?

I created a CMD script to install the product needs to be test and added it to the TestSetting to run before automation tests running. However if the setup script is failed (ExitCode!=0), the automation tests still run and all fail since the product is not installed. Does anyone know how to set if the setup script is failed, the automation tests do not run?

我还记得我看到自动化测试不会运行,因为安装程序脚本退出并带有代码!= 0之前在测试运行日志中.但是我现在看不到.

I remembered I saw automation tests do not run because setup script exit with code!=0 in test run log before. But I do not see it now.

我尝试仅添加一个命令"exit 4".在安装脚本中并运行自动化程序,测试运行日志如下所示,没有运行安装脚本.谁能告诉我该如何解决?谢谢

I tried adding only one command "exit 4" in the setup script and run the automation, the test run log is like below, no setup script is motioned. Could anyone tell me how to fix this? Thanks

 

推荐答案

邱秋,

您的TFS和VS版本是什么?

What’re your TFS and VS version?

您得到的完整日志消息是什么? (您提供的日志消息似乎只是一部分)

What’s the complete log message that you get? (the log message that you provided seems just part)

根据我在带有TFS 2013的MTM 2013中进行的测试,如果脚本退出并显示代码4,则不会执行该测试.

Based on my test in MTM 2013 with TFS 2013, the test will not executed if the script exit with code 4.

简单的命令脚本(蝙蝠)

Simple command script (bat)

xcopy /s c:\f1 c:\f2
exit 4

请使用简单的命令脚本尝试,然后重试.

Please try it with a simple command script and try again.

致谢

Starain


这篇关于设置脚本失败时,自动化测试仍在运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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