Quality Testing

Quality is delighting customers

=======================

application.properties

=======================

URL=http://google.com

=====================

ReadFleData Java Class

=====================

public class ReadFileData

{
public static String AppData() 

{

File file = new File("C:\\Users\\eclipse-workspace\\practice\\config\\application.properties");   

FileInputStream fileInput = null;

try

{

fileInput = new FileInputStream(file);

} catch (FileNotFoundException e)

{

e.printStackTrace();

}

Properties prop = new Properties();

//Load properties file

try

{

prop.load(fileInput);

} catch (IOException e)

{

e.printStackTrace();

}

return null;
}
}

=====================================

Calling read file data from another class:

=====================================

public class Google

{

ReadFileData read = new ReadFileData();

driver.get(read.AppData(????));
}

Views: 35

Reply to This

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2019   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service