0

I have done the below steps, it is working fine on my local machine but when I worked with TFS solution explore below error display (newlines added for clarity):

Error: The character encoding for the file D:\Testcase\data.csv has changed.
Your source control provider may have problems managing files with this type of encoding.
For example, if you save an ANSI-encoded file as UTF-8 you may not be able to merge or show differences.

Steps:

  1. Created data.csv file.
  2. Advance save as a unicode (utf-8 without signature Codepage-65001).
  3. Make data.csv file as copy if new

Code:

[DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", "|DataDirectory|\\data.csv", "data#csv", DataAccessMethod.Sequential), DeploymentItem("data.csv"), TestMethod]
    public void CodedUITestMethod1()
    {
        Console.WriteLine(TestContext.DataRow["firstname"].ToString());
        // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
    }
AdrianHHH
  • 13,492
  • 16
  • 50
  • 87
Niraj
  • 53
  • 1
  • 9
  • possible duplicate of [CodedUI test does not read data from CSV input file](http://stackoverflow.com/questions/24735579/codedui-test-does-not-read-data-from-csv-input-file) – barakcaf Jun 10 '15 at 11:17

1 Answers1

0

Set the Copy to Output Directory in the properties window for that file to Copy Always or Copy if Newer.

Jamie Rees
  • 7,973
  • 2
  • 45
  • 83