I am using selenium with page object pattern. And I am using property file for keeping the test data , not scattering all over the script.

Here is my code

package propertytest;

import org.testng.annotations.Test;
import pageobjects.HomePage;
import steps.LoginSteps;
import util.DriverManager;

import java.io.IOException;

public class ReadFileData extends DriverManager

    public ReadFileData() throws IOException {

    public void initDriver() {
        HomePage page = new LoginSteps().Login(prop.getProperty("nam"), prop.getProperty("pas"));





Is it possible to pass entire test data in one config.properties file. Is it possible ?

closed as unclear what you're asking by Yu Zhang, IAmMilinPatel, Bharat Mane, Shailendra Rathore, NarendraC Feb 2 '17 at 12:18

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Please do not ask near-duplicate questions when your other questions have been put on hold. You would be better off editing the original question to fix the problems that caused it to be put on hold in the first place. – Kate Paulk Feb 2 '17 at 12:32

Yes, it is possible. Have a look at jUnit theories and datapoints.

A theory test is a test that is repeated for each datapoint. In your case you could load your properties into data points in make the test repeat it self for each entry.


Not the answer you're looking for? Browse other questions tagged or ask your own question.