I am not able to read values from csv file in a maven projects. Works perfectly when it is done using testng. Can Some one help me in knowing what else I am missing
Here's my code: import java.io.FileReader; import com.opencsv.CSVReader;
public static void Test() throws Exception
{
@SuppressWarnings("resource")
CSVReader reader = new CSVReader(new FileReader("File"));
String [] csvCell;
while ((csvCell = reader.readNext()) != null)
{
String A = csvCell[0];
String B = csvCell[1];
}
Maven Dependency
<dependency>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>3.9</version>