当远程计算机中的测试用例失败时如何使用snapsot [英] How to take a snapsot when test case failed in remote machine

查看:76
本文介绍了当远程计算机中的测试用例失败时如何使用snapsot的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我正在通过构建测试程序集将测试部署到远程计算机上。


我想要一个每当我的测试失败时快照。


任何人都可以给我一些想法天气,我们可以打印一个屏幕,如果有,请给我一些示例代码。


谢谢




PV

解决方案

Hi PV,


 



请参阅您的描述,在构建和测试中使用测试程序集(Visual Studio Test)程序集调用VSTest.Console.exe来运行测试。但是,
VSTest.Console.exe中没有这样的选项,可以打印截图
。当远程机器中的测试通过构建失败时,我们无法拍摄快照。


 


作为解决方法,我们可以使用带有"/ 设置:[文件名]"用于收集屏幕截图的选项。


请在测试项目中使用测试设置文件。然后,我们可以启用
屏幕和录音机 测试设置中的数据收集器,以获取测试运行的屏幕视频。




测试运行后,有一个
ScreenCapture.wmv 在项目路径下生成文件"... \ TestResults \ [vm name] 2017-08-15 13_39_32\In\df558ae4-5a5b-44d6-b5bb-2d7dbf67bee8 \ [vm名称]"


希望它有所帮助。感谢您的理解。



 


< p style ="margin:0in 0in 0pt"> 最好的问候,


Fletcher





Hello,

I am deploying my test into remote machine through Build - test assemblies.

I would like to take a snapshot whenever my test fails.

Could anyone please give me some idea weather we can take a print screen, if so please give me some sample code.

Thank you


PV

解决方案

Hi PV,

 

Refer to your description, you use test assemblies (Visual Studio Test) in your build and test assemblies call VSTest.Console.exe to run test. However, there is  no such option in VSTest.Console.exe which can print screenshot. We could not take a snapshot when test failed in remote machine through build.

 

As a workaround, we could use VSTest.Console.exe with "/Settings:[file name]" options to collect screenshot.

Please use test settings file in your test project. Then, we could enable Screen and Voice Recorder data collector in test settings to get screen video for the test run.

After test run, there’s a ScreenCapture.wmv file generate under project path "…\TestResults\[vm name] 2017-08-15 13_39_32\In\df558ae4-5a5b-44d6-b5bb-2d7dbf67bee8\[vm name]"

Hope it helps. And thanks for your understandings.

 

Best regards,

Fletcher


这篇关于当远程计算机中的测试用例失败时如何使用snapsot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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