Forum Discussion

ebudihar's avatar
ebudihar
Occasional Contributor
8 years ago

java.io.FileNotFoundException (No such file or directory)

hi,

I have a SOAP request test case like this

 

import com.eviware.soapui.support.GroovyUtils;
import org.apache.poi.ss.usermodel.*
import org.apache.poi.hssf.usermodel.*
import org.apache.poi.xssf.usermodel.*
import org.apache.poi.ss.util.*  

//myTestCase contains the test case
def myTestCase = context.testCase   

//open an excel file
def fs = new FileInputStream ("/Users/eko/Documents/soapUIworkspace/sky/logindata-2016.xslx")  
//def fs = new FileInputStream()

//def a workbook
Workbook wb = WorkbookFactory.create(fs)  

//def the worksheet location in the excel file
def ws = wb.getSheet("Sheet1")  

//count the rows
///def r = ws.getPhysicalNumberOfRows()  

// get the Property TestStep object
propTestStep = myTestCase.getTestStepByName("Properties - ichain-account-contact")   
project = testRunner.getTestCase().getTestSuite().getProject().getWorkspace().getProjectByName("SkyService")
testSuite = project.getTestSuiteByName("testSuite");
testCase = testSuite.getTestCaseByName("TestCase");   

wb.close()

 

---

when I ran this test, I got an error message, "java.io.FileNotFoundException (No such file or directory)". I checked many times the file and the directory is exist. But when ran another file, logindata.xlsx, it works, only this file works and no error. Other files give the same error, "java.io.FileNotFoundException (No such file or directory)". It is very strange. Please help.

 

No RepliesBe the first to reply