标题翻译
Data driven framework
问题
我在Excel中有10个测试用例,如果我对每个测试用例运行Selenium,应该会上传一个文件并将结果写入同一个Excel。有人知道如何做到这一点吗?
我知道如何读取Excel文件,但是对于每个测试用例上传一个文件,我不知道如何做。
File file = new File(filePath + "\\" + fileName);
//创建FileInputStream类的对象以读取excel文件
FileInputStream inputStream = new FileInputStream(file);
Workbook guru99Workbook = null;
//通过将文件名拆分为子字符串并仅获取扩展名来找到文件扩展名
String fileExtensionName = fileName.substring(fileName.indexOf("."));
英文翻译
I have 10 test cases in Excel, if I run Selenium for each test case, one file should upload and write the result in same Excel. Does anyone know how to do that?
I know how to read Excel file, but for one test case one file upload I don't know how to do that.
File file = new File(filePath+"\\"+fileName);
//Create an object of FileInputStream class to read excel file
FileInputStream inputStream = new FileInputStream(file);
Workbook guru99Workbook = null;
//Find the file extension by splitting file name in substring and getting only extension name
String fileExtensionName = fileName.substring(fileName.indexOf("."));
专注分享java语言的经验与见解,让所有开发者获益!
评论