2

We deploy xml file in the code with below statement:

[DataSource("Microsoft.VisualStudio.TestTools.DataSource.XML", "|DataDirectory|\\Scripts\\SmokeTestSuite2016Q1\\TestData\\RPSmokeTestData.xml", "SM_Test_012",DataAccessMethod.Sequential),DeploymentItem("RPSmokeTestData.xml"), TestMethod]

In local its running fine, but even though while run we getting a warning as below:

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.

But the test runs successful.

Now we check-in the code to TFS server which we maintain in different environment and queue a build.

After complete build we try to run the test from MTM from local machine where both test controller and agent running locally.

  1. The test case without xml file is running successfully but if we try to run a test case which required test data from xml file we getting the following error.

TestOutcome 'Warning'; Message 'Warning: Test Run deployment issue: Failed to get the file for deployment item 'RPSmokeTestData.xml' specified by the test 'demo.SmokeTestSuite2016Q1.SmokeTest.SmokeTestUITest2016Q1.SM_Test_004': System.IO.FileNotFoundException: Could not find file 'C:\Users\deepan\AppData\Local\VSEQT\QTController\RPSmokeTestData.xml'.'."

NSNoob
  • 5,548
  • 6
  • 41
  • 54
PI1 RPG2_
  • 21
  • 1
  • 2

1 Answers1

0

According to the error info. It seems you are looking for the wrong place of the .xml file.

TFS Build by default places the build outputs in a different location then when you build locally in VS.

When you use TFS Build it has a folder structure like so:

[workspace dir]\Sources\[projectdir]
[workspace dir]\Binaries\

TFS Build redirects the build outputs to the Binaries folder. So if you have custom actions looking in C:\Users\deepan\AppData\Local\, it won't find them.

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62