title: Passing the data stored in Json format from excel sheet to UI of application using Selenium Webdriver
body: <p>1.I have an excel sheet that has Two columns one is Usecase, and second is Parameters.</p>
  
  <p>2.In Usecase column cell Login data is given.</p>
  
  <p>3.In Parameters cell the following values are given in Json format Application URL;element xpath;element Username; Password xpath and Password is given.</p>
  
  <pre><code>{https://ui.freecrm.com/, "usernamexpath":"//input[@id = 'UserName']", "username":"admin", "password xpath" = ''//input[@id = 'Password']", "password": "Pass_123", "loginButton":"//input[@value = 'Log in']"}
  </code></pre>
  
  <p>4.Now I need to read the excel sheet cell values using Selenium Webdriver, and then Login the application by fetching the data from Parameter cell one by one.
  I am not able to find any solution till yet please support if anyone has idea.
  here is code which i have written:</p>
  
  <pre><code>                  import java.io.FileReader;
                    import java.io.IOException;
                    import java.io.Reader;
                    import java.util.LinkedHashMap;
                    import org.json.simple.JSONArray;
                    import org.json.simple.JSONObject;
                    import org.json.simple.parser.JSONParser;
                    import org.json.simple.parser.ParseException;
  
  
                    public class JSONDataExample {
                    String n;
  
                    public String readJSONData(String keyword) throws IOException, ParseException{
  
                    Reader reader = new FileReader("./data/testdata.xlsx");
  
                    JSONParser parser = new JSONParser();
  
                    JSONArray jsonArr = (JSONArray)parser.parse(reader);
  
                    for(Object obj : jsonArr){
  
                    JSONObject jo = (JSONObject)obj; 
                    n = (String)jo.get(keyword);
  
                   }
  
         return n;
  
          }
  
                    public static void main(String[] args) throws IOException, ParseException{
                    JSONDataExample e = new JSONDataExample();
                    String a = e.readJSONData("URL");
                    System.out.println(a);
                    String b = e.readJSONData("usernamexpath");
                    String c = e.readJSONData("username");
                    String d = e.readJSONData("password xpath");
                    String e = e.readJSONData("password");
                    String f = e.readJSONData("loginButton");
                   }
  
           }
  </code></pre>