create a file named as config.properties
(Project > right click > new File > name file as "config.properties")


//create Class Variable 

 1.  Properties prop;
 2. FileInputStream fis;

//then inside @BeforeClass use this below code

 3. fis = new FileInputStream(System.getProperty("user.dir")+"\\config.properties");
 4. prop = new Properties();
 5. prop.load(fis);

//Now access the value of Properties File 
6. prop.getProperty("key")


Post a Comment

Facebook

QA Artifacts for Advanced Learning