我正在尝试从csv文件中读取数据。我已使用mm / dd / yyyy输入格式化单元格的日期。我保存它,打开日期后,单元格就像#####。当我尝试从我的代码中读取数据时,它无法读取。我的csv文件读取代码如下所示,
public static List readTestCases(String filename, Class bean) {
CsvToBeanMapper beanReader = new CsvToBeanMapper();
List Testcases;
Testcases = new ArrayList();
Testcases = (List) beanReader.getBeanFromCsv("src/test/resources/testcases/" + filename + ".csv", bean);
return Testcases;
}
编辑:
我有这样的测试用例,
@Test(description="New Project")
public void addSoftwareDefault(AddProjectBean projectBean)
{
softwareName="AutoSoftware11816";
projectName="AutoProject17538";
assertEquals(true,loginpage.gotoSignPage());
assertEquals(true, loginpage.logintoPortal(PropertyMap.getInstance().getName(),PropertyMap.getInstance().getPassword(), "myToday"));
assertEquals(true,addProject(projectBean)
}
由于无法从csv读取数据,selenium正在跳过此测试......
当我在文本编辑器中打开时,数据是这样的
ProjectID,ProjectName,SoftwareName,ProjectDescription,ProjectTags,ProjectStartDate,ProjectFeatureCompletionDate,ProjectProductionReadyDate,ProjectSeverity
,,,,,,,,
AutoProject,AutoProject1224,AutoSoftware23345,This is Sample,Java,12/30/2015,1/30/2016,2/28/2016,High
注意:我有意在标题后从第二行读取数据......第一行是我没有填写的描述......