title: I am getting an error java.lang.ClassCastException:
body: <p>it is an hospital application and my selenium test adds a new facility.The data required for adding the facility (eg: name of the facility, address of the facility etc)is stored as JSON file, till here it is good. I have managed to add the facility, but now after adding the facility i have to verify that the added facility is correct and the names and address of the facility matches the data in the JSON file. I have written a code but it errors as</p>
  
  <p>" java.lang.ClassCastException: class org.json.simple.JSONArray cannot be cast to class org.json.JSONObject (org.json.simple.JSONArray and org.json.JSONObject are in unnamed module of loader 'app') "</p>
  
  <pre><code>My verification method is  :
  
       public void verifyNewFacility2() throws FileNotFoundException, IOException,ParseException {
   String Name,Description;
   JSONParser parser = new JSONParser();
   Object obj=parser.parse(new FileReader("C:\\selenium-protect\\src\\test\\resources\\scripts\\Facility\\AddNewFacilityDetailsSection.json"));
  
  JSONObject jsonObject = (JSONObject) obj;
  Name = (String) jsonObject.get("Selenium-Facility");
  Description = (String) jsonObject.get("Test Facility created by Selenium");
  WebElement nameElement =driver.findElement(By.xpath("//div[@class='col-12']//following::div[1]//following::h3"));
  
  String message = nameElement.getText();
  Assert.assertEquals(message, Name);
  
  WebElement descriptionElement =driver.findElement(By.xpath("//div[@class='col-12']//following::div[1]//following::p"));
  
  
  String message1 = descriptionElement.getText();
  Assert.assertEquals(message1, Description);
  
          }
  </code></pre>