![](/img/trans.png)
[英]How to rerun failed test cases in the same test run(test run was launched by TFS2015 vNext Run Functional Test task)
[英]How to Run UI Test by TFS2015?
我将 TFS-2013 升级到 TFS-2015,然后用 3 个步骤定义新的构建定义
我为第二步选择了测试组,并为第三步添加了用户名和密码。 我选择了包含测试 DLL 的测试组和测试放置文件夹,并添加了包含编码 UI 测试方法的 DLL 文件名来测试程序集。
当我尝试部署测试代理时,我发现了这个日志:
[debug]调用Invoke-DeployTestAgent DistributedTests:开始在测试机器上部署和配置测试代理。 DistributedTests:提供的输入是: DistributedTests:机器:TestPC3 DistributedTests:用户名:user123 DistributedTests:机器组名称:testui DistributedTests:作为进程运行:True DistributedTests:自动登录:True DistributedTests:禁用屏幕保护程序:True DistributedTests:代理位置:\\user -pc\\drop_Location\\vstf_testagent.exe DistributedTests:更新测试代理:True DistributedTests:仅作为 DataCollection 运行测试代理:False DistributedTests:在远程计算机上安装测试代理的脚本路径:G:\\agentui\\tasks\\DeployVisualStudioTestAgent\\1.0.2 \\TestAgentInstall.ps1 DistributedTests:在远程机器上配置测试代理的脚本的路径:G:\\agentui\\tasks\\DeployVisualStudioTestAgent\\1.0.2\\TestAgentConfiguration.ps1 DistributedTests:检查测试代理是否安装在远程机器上的脚本的路径:G :\\agentui\\tasks\\DeployVisualStudioTestAgent\\1.0.2\\CheckTestAgentInstallation.ps1 DistributedTests:创建 DTL 客户端 DistributedTests:获取名称为 testui 项目 = TestBuildLifeCycle DistributedTests 的机器组:获取名称为 testui 项目 = TestBuildLifeCycle DistributedTests 的机器组 DistributedTests:清除机器上的标签 DistributedTests:删除机器“TestPC3”上的标签“Microsoft-AgentsForVS” DistributedTests:获取机器列表machinename 已完成 DistributedTests:使用 TestAgent 标记更新环境资源 DistributedTests:正在将测试代理复制到:C:\\Users\\userFolder\\AppData\\Local\\Temp\\2c15a489-7765-4a41-b78e-09197ee5d2c8\\vstf_testagent.exe DistributedTests:文件从 C:\\Users\\userFolder\\AppData\\Local\\Temp\\2c15a489-7765-4a41-b78e-09197ee5d2c8\\vstf_testagent.exe 到 $env:SystemDrive\\TestAgent DistributedTests:为代理设置复制任务:TestPC3 DistributedTests:总机器数需要运行任务 CopyFilesToTestAgent:1 DistributedTests:正在运行机器“TestPC3”上的任务“CopyFilesToTestAgent” DistributedTests:任务“CopyFilesToTes” 机器 'TestPC3' 上的 tAgent' 已完成。 DistributedTests:计算机 TestPC3 的任务“CopyFilesToTestAgent” 状态:失败 DistributedTests:计算机 TestPC3 的任务“CopyFilesToTestAgent” 日志:System.AggregateException:无法在计算机上创建工作目录。 有关错误的详细信息,请参阅下面的日志。 指定路径 C:\\Users\\J3CA7~1.JSH 处的对象不存在。
我使用管理员的凭据并通过安装代理手册解决了这个问题,但需要使其能够编辑代理我注意到该过程试图将测试代理复制到 appData 中的临时文件夹,然后尝试将此代理复制到 c:\\ testAgent 但它失败了
如果您正在运行编码的 UI 测试,则必须将构建代理配置为以交互方式运行。 在您尝试使用构建过程运行测试之前,请确保它们可以在您计划使用的构建服务器上运行。
有一些事情你应该注意:
准备
确保您的解决方案和您的测试文件已签入版本控制。
对于以下场景,需要在生成服务器上安装 Microsoft Visual Studio:要运行单元测试或编码的 UI 测试,您必须安装Visual Studio Professional 或更高版本。
许多测试和测试操作(包括代码 UI 测试)要求您在构建代理上安装与您的团队在其开发机器上使用的相同版本的 Visual Studio 。
以交互模式运行构建服务器
确定将充当构建服务帐户的用户帐户。 构建服务帐户必须:
在 Build Service Properties 对话框中,选择Stop the service
。
在 Run the Service as 下,选择Change
,然后指定构建服务帐户的凭据。
选择Run the Service interactively
。
选择Start
,然后选择OK
。
使构建服务帐户保持登录到构建服务器。
有关更多详细信息和屏幕截图: https : //msdn.microsoft.com/en-us/library/ms181712(v=vs.120).aspx#interactive
在第 2 步(部署测试代理),您需要启用“交互式”选项。
有关更多详细信息: https : //github.com/Microsoft/vso-agent-tasks/blob/master/Tasks/DeployVisualStudioTestAgent/README.md
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.