繁体   English   中英

编码的用户界面:当在本地计算机上正常工作时,无法在TFS解决方案资源管理器的脚本中使用CSV文件

[英]Coded UI: Not able to use CSV file in script in TFS solution explorer while it is working fine on the local machine

我已经完成了以下步骤,在我的本地计算机上工作正常,但是当我使用TFS解决方案时,请浏览以下错误显示(为清楚起见添加了换行符):

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.

脚步:

  1. 创建了data.csv文件。
  2. 提前另存为unicode(不带签名Codepage-65001的utf-8)。
  3. 如果新创建data.csv文件作为副本

码:

[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.
    }

在属性窗口中将该文件的“ Copy to Output Directory设置为Copy AlwaysCopy if Newer

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM