【发布时间】:2016-12-01 09:29:43
【问题描述】:
我们在代码中部署xml文件,语句如下:
[DataSource("Microsoft.VisualStudio.TestTools.DataSource.XML", "|DataDirectory|\\Scripts\\SmokeTestSuite2016Q1\\TestData\\RPSmokeTestData.xml", "SM_Test_012",DataAccessMethod.Sequential),DeploymentItem("RPSmokeTestData.xml"), TestMethod]
在本地运行良好,但即使在运行时我们收到如下警告:
Test Run deployment issue: Failed to get the file for deployment item 'RPSmokeTestData.xml': System.IO.FileNotFoundException: Could not find file 'D:\Automation\xxx\bin\Debug\RPSmokeTestData.xml'.
Warning: Test Run deployment issue: Failed to get the file for deployment item 'RPSmokeTestData.xml' specified by the test 'xxx.Scripts.SmokeTestSuite2016Q1.SmokeTest.RPSmokeTestUITest.SM_Test_012': System.IO.FileNotFoundException: Could not find file 'D:\Automation\RPSmokeTestData.xml'.
Warning: Test Run deployment issue: The assembly or module 'Microsoft.Practices.ServiceLocation' directly or indirectly referenced by the test container 'd:\automation\xxx\bin\debug\xxx.dll' was not found.
但测试运行成功。
现在我们将代码签入到我们在不同环境中维护的 TFS 服务器并排队构建。
完成构建后,我们尝试从本地机器上的 MTM 运行测试,测试控制器和代理都在本地运行。
- 没有 xml 文件的测试用例运行成功,但是如果我们尝试运行需要 xml 文件中的测试数据的测试用例,我们会收到以下错误。
TestOutcome '警告';消息'警告:测试运行部署问题: 无法获取部署项“RPSmokeTestData.xml”的文件 由测试指定 'demo.SmokeTestSuite2016Q1.SmokeTest.SmokeTestUITest2016Q1.SM_Test_004': System.IO.FileNotFoundException:找不到文件 'C:\Users\deepan\AppData\Local\VSEQT\QTController\RPSmokeTestData.xml'.'."
【问题讨论】:
标签: c# testing tfs automation mtm