public void buildConfig()
      throws IOException, KiteInsufficientValueException, BadEntityException {
    this.jsonConfigObject = readJsonFile(configFilePath);

    this.name = jsonConfigObject.getString("name", "")  + " [" + timestamp() + "]" ;
    this.name = name.contains("%ts") ? name.replaceAll("%ts", "") + " (" + timestamp() + ")" : name;
    this.reportPath = jsonConfigObject.getString("reportFolder", null);

    // for CI testing purpose, the report path will be the default one: pwd/kite-allure-reports
    if (System.getProperty("kite.custom.config") != null) {
      reportPath = "";
    }

    String callbackURL = jsonConfigObject.getString("callback", null);

    JsonArray jsonArray = jsonConfigObject.getJsonArray("matrix");
    if (jsonArray != null) {
      for (int i = 0; i < jsonArray.size(); i++) {
        JsonArray jArray = jsonArray.getJsonArray(i);
        List<Integer> tuple = new ArrayList<>();
        for (int j = 0; j < jArray.size(); j++) {
          tuple.add(jArray.getInt(j));
        }
        this.matrix.add(tuple);
      }
    }

    this.testObjectList = (List<JsonObject>)
        throwNoKeyOrBadValueException(jsonConfigObject, "tests", JsonArray.class, false);

    if (testObjectList.size() < 1) {
      throw new KiteInsufficientValueException("Test objects are less than one.");
    }

    List<JsonObject> clientList = new ArrayList<>();

    // for testing with custom client (1 only)
    if (System.getProperty("kite.custom.config") != null) {
      JsonObject customBrowser = readJsonFile(System.getProperty("kite.custom.config"));
      logger.info("Running test on custom browser config: \n" + customBrowser.toString());
      clientList.add(customBrowser);
    } else {
      clientList = (List<JsonObject>) throwNoKeyOrBadValueException(jsonConfigObject, "clients", JsonArray.class, false);

      int size = (clientList != null ? clientList.size() : 0);

      if (size < 1) {
        throw new KiteInsufficientValueException("Less than one browser or app object.");
      }

      if (clientList != null) {
        clientList = new ArrayList<>(new LinkedHashSet<>(clientList));
        if (clientList.size() != size) {
          logger.warn("Duplicate browser configurations in the config file have been removed.");
        }
      }
    }

    if (jsonConfigObject.get("grids") == null) {
      throw new KiteInsufficientValueException("There need to be at least one grid for this version of KITE Engine to work, please check!");
    }

    JsonArray gridArray = jsonConfigObject.getJsonArray("grids");
    if (gridArray.isEmpty()) {
    }

    for (int index = 0; index < gridArray.size(); index++) {
      gridList.add(new Paas(gridArray.getJsonObject(index)));
    }
    configHandler =
      new ConfigHandler(testObjectList, clientList);

    if (jsonConfigObject.containsKey("networkInstrumentation")) {
      try {
        NetworkInstrumentation networkInstrumentation =
            new NetworkInstrumentation(
                jsonConfigObject.getJsonObject("networkInstrumentation"), this.getRemoteAddress());

        for (TestConfig testConfig: configHandler.getTestList()) {
          testConfig.setNetworkInstrumentation(networkInstrumentation);
        }

      } catch (Exception e){
        logger.error(getStackTrace(e));
      }
    }
    
    if (jsonConfigObject.containsKey("email")) {
      try {
        EmailSender sendEmailSMTP = new EmailSender(jsonConfigObject.get("email"));
        logger.debug(sendEmailSMTP.toString());
        for (TestConfig testConfig: configHandler.getTestList()) {
          testConfig.setEmailSender(sendEmailSMTP);
        }
      } catch (Exception e){
        logger.error(getStackTrace(e));
      }
    }
    
    skipSame = jsonConfigObject.getBoolean("skipSame", skipSame);
    logger.info("Finished reading the configuration file");
  }
Builds itself based on the content of the config file.

@throws IOException                    the io exception
@throws KiteInsufficientValueException if the number of grids, tests and browsers is less than 1.
@throws BadEntityException             the bad entity exception
KITE-Engine/src/main/java/org/webrtc/kite/config/Configurator.java