Coder Social home page Coder Social logo

mfaisalkhatri / configreader Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 15.81 MB

This Utility helps to read the config.properties file in a simplified way.

Java 100.00%
config properties-loader properties-parser selenium-webdriver java utility automation testing testing-tools open-source

configreader's Introduction

ConfigReader

A simple utility framework which can be used to read config.properties file easily.

Getting Started

This page includes all the information you need to get started including setup, usage, advantages, sample test.

What to do when you need help?

  • Discuss your queries by writing to me at:

  • Mail: [email protected]

  • Twitter: @mfaisal_khatri

  • LinkedIn: Mohammad Faisal Khatri

  • If you find any issue which is bottleneck for you, search the issue tracker to see if it is already raised.

  • If not raised, then you can create a new issue with required details as mentioned in the issue template.

What you do if you like the project?

  • Spread the word with your network.
  • Star the project to make the project popular.
  • Stay updated with the project progress by Watching it.

How to use this Framework:

  1. Add the following dependency in your pom.xml file:
<dependency>
    <groupId>com.github.mfaisalkhatri</groupId>
    <artifactId>configreader</artifactId>
    <version>1.0.0</version>
</dependency>
  1. Reading "Config.Properties" is made much simple and easy now. Check the sample code and tests below:
This is the config file extract: 
searchtext=Apple iphone 8
  1. Once the dependency jar is downloaded in project, Use "PropertiesReader" class and get the values from the properties file in below defined way:
@Test
	public void Test() throws FileNotFoundException, IOException, Throwable {

		PropertiesReader prop = new PropertiesReader();
		String srch = prop.getKey("searchtext");
		
		System.out.println("Value of search text key is: " +srch);
		Assert.assertEquals(srch, "Apple iphone 8");

	}

In the above case, Getter/Setter can also be created to get values from the properties file. Exceptions have been handled while reading file or when file is not found, so you don't have to worry, if any thing goes wrong in tests. Appropriate logs will be generated in project folder when exception is caught.

configreader's People

Contributors

mfaisalkhatri avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

configreader's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.