mercredi 27 juillet 2016

Failed to get the file for deployment item while run test case in MTM

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'.'."

Aucun commentaire:

Enregistrer un commentaire