How to Read Data from Properties File in using Java Code

preview_player
Показать описание
Hello

In this tutorial, I will show you how to read data from Properties File in Java and for the Selenium automation.

2. It can be used to get property value based on the property key. The Properties class provides methods to get data from the properties file and store data into the properties file.

3. If any information is changed from the properties file, you don't need to recompile the java class. It is used to store information that is to be changed frequently.

Methods:

Properties(): It creates an empty property list with no default values.

load(): It loads data from the Reader object.

Please do subscribe for more tutorials on selenium automation @SH Study Tech

Please share questions and queries in the comments section.

Follow me on Twitter: shstudy

Рекомендации по теме
Комментарии
Автор

I did like this only, it is running in eclipse....but while running as jar, it shows null pointer exception, the property file not found the location

karthikakr
Автор

I need a program with fixed string of 200 and it should have name like 0-10 chars..address from 10-40 and it should read from property file in java

saipriya
visit shbcf.ru