Selenium webdriver 默认构造函数无法处理隐式超级构造函数引发的异常类型IOException。Fileinputstream的定义
我有两个java文件:Selenium webdriver 默认构造函数无法处理隐式超级构造函数引发的异常类型IOException。Fileinputstream的定义,selenium-webdriver,Selenium Webdriver,我有两个java文件: 1) Readfiledata.java public class ReadFileData { protected Properties prop = new Properties(); public ReadFileData() throws IOException { FileInputStream inputStream= new FileInputStream(System.getProperty("user.dir") + "\\Resources\
1) Readfiledata.java
public class ReadFileData {
protected Properties prop = new Properties();
public ReadFileData() throws IOException {
FileInputStream inputStream= new FileInputStream(System.getProperty("user.dir") + "\\Resources\\config.properties");
prop.load(inputStream);
}
}
2) Login.java
ReadFileData data= new ReadFileData();
在这个创建readfiledata对象的文件中,我看到了错误。
请帮助解决此问题。无论您在何处调用此方法,请将其放入try-and-catch块中。 请尝试{ReadFileData data=new ReadFileData();}catch(IOException异常){System.out.println(exception.getMessage());}可能的重复