在编码 ui 测试中使用它时,csv 文件的数据中缺少前导 0

Leading 0's missing from the data of csv file while using it in coded ui test

我在数据驱动编码 ui 中使用来自 csv 的数据。

In one of the columns(say "File Code") there are strings like 001, abc123 etc.

我需要使用该列的数据来搜索结果。但是编码 ui 并没有在 TextBox 中输入前导 0,而是跳过 0 并输入数据的后半部分。

How can i make the test enter the 0's as well.

Coded UI 以与 Excel 大致相同的方式读取 CSV 数据。它会尝试正确推断字段类型。所以看起来像数字、日期和时间的字段是这样解释的。

一个解决方案是强制使用不同的解释。可能性包括用双引号将字段括起来或嵌入 space.

示例:

Name,Number,Telephone
Alice,"001",01 234 567890
Brian,"002",01 234 678901