Forum Discussion

AngelaToke's avatar
AngelaToke
New Contributor
8 years ago

The error "The system cannot find the file specified" is displayed

I tried with the code below:

//responsible for reading . properties files
Properties prop = new Properties ()
def path = "D:\\SOAPUI\\Files\\application.properties"
FileInputStream fs = new FileInputStream(path)
//def inputFile = new File(path)
prop.load(fs)
log.info prop.getProperty("adminUsername")
log.info prop.getProperty("type")

 

--> The error is displayed

java.io.FileNotFoundException: D:\SOAPUI\Files\application.properties (The system cannot find the file specified) error at line: 6

 

Please advise

 

2 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Error says it all? Please check if the file exists on the system.
    • AngelaToke's avatar
      AngelaToke
      New Contributor

      Thanks, my mistake, the file with extension still .txt so it displayed this error