0
這是我的腳本代碼。我正在試圖從Excel工作表中的數據,但有filenullXlxs filenull讀取異常
public class TC003_VerifyLoginWithDifferentRecords extends testbase {
public static final Logger log =
Logger.getLogger(TC003_VerifyLoginWithDifferentRecords.class.getName());
HomePage homepage;
@DataProvider(name = "logindata")
public String[][] getTestData()
{
String[][]testRecords = getData("TestData.xlsx","LoginTestData");
return testRecords;
}
@BeforeClass
public void setUp()
{
init();
}
@Test(dataProvider = "logindata")
public void TestLogin(String emailAddress, String Password)
{
log.info("================Starting VerifyLogin with Different
Records===================");
homepage = new HomePage(driver);
homepage.loginApplication(emailAddress,Password);
log.info("================Ending VerifyLogin with Different Records===================");
}
@AfterTest
public void endTest()
{
// driver.close();
}
這裏我所提供的excel表我的
public String[][] getData(String workbookname, String sheetname)
{
String path = "H:/JAVA TESTING CODES/UIAutomation/src/main/java/com/test/automation/UIAutomation/data"+workbookname;
excel = new ExcelReader(path);
String[][] data = excel.getDataFromSheet(workbookname, sheetname);
return data;
}
'「H:/ JAVA測試代碼/ UIAutomation/src/main/java/com/test/automation/UIAutomation/data「+ workbookname;'假設'data'是一個文件夾,你不需要尾隨'/'嗎? –
我試着跟蹤/但有一個相同的錯誤 – sp4
請提供更多的細節。例如,哪條線給出了錯誤。傳遞給函數的值是什麼?這似乎是你自己可以很容易地調試的東西 - 我不認爲有什麼棘手的問題意味着[SO]問題是解決問題的最佳方式。 –