In my class file I have used to read a excel file from my local drive
public static void main(String[] args) throws InterruptedException, IOException {
driver = new ChromeDriver();
driver.manage().deleteAllCookies();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
FileInputStream file = new FileInputStream(new File("C:\\Expiration.xlsx"));
workbook = new XSSFWorkbook(file);
XSSFSheet sheet = workbook.getSheetAt(0);
Cell cell;
Row row = null;
.....
.....
}
after that I converted this class file into an jar file, when I executed in my machine its working fine, but executed other machine exception raised, because file not available on that location
clarification let me know how can we avoid this situation?
my expectation jar file along with excel file (package level), while executing file should be read in the package