title: Can we use Selenium or any other jars to get network response and validate
body: <p>I have a requirement here that I need to verify the network response values using selenium &amp; java.</p>
  
  <p>It would be great if there is any code that could help me out. </p>
  
  <p>The action that I want to perform (which is needed to be automated) is </p>
  
  <ol>
  <li><p>load the application <a href="https://www.ancestry.com" rel="nofollow noreferrer">https://www.ancestry.com</a> </p></li>
  <li><p>press F12 and go to network tab when application is loading</p></li>
  <li><p>select a respective network containing b/ss </p></li>
  <li><p>click on it and get the values in the query parameters </p></li>
  </ol>
  
  <p>I have highlighted them in the below image </p>
  
  <p>Note: I need to perform this action for every click event that happen after the application is loaded.</p>
  
  <p>Is this possible in selenium </p>
  
  <p><a href="https://i.stack.imgur.com/pM2Ny.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pM2Ny.png" alt="Network Request"></a></p>
  
  <p><a href="https://i.stack.imgur.com/Ly2pb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ly2pb.png" alt="Network Request"></a></p>
  
  <p>This is the code that I tried to get the values recorded am I doing it right please help</p>
  
  <pre><code>public static void main(String[] args) throws IOException {
      System.setProperty("webdriver.chrome.driver",
              new File(".").getCanonicalPath() + "\\WebDriver\\chromedriver.exe");
      WebDriver driver = new ChromeDriver();
      driver.get("https://www.ancestry.com");
      //capture(driver);
      driver.quit();
  }
  
  public static void capture(WebDriver driver) throws IOException {
      OutputStream logfile = new FileOutputStream(new File(new 
      File(".").getCanonicalPath() + "\\log.txt"), true);
      PrintStream printlog = new PrintStream(logfile);
      LogEntries logs = driver.manage().logs().get(LogType.PERFORMANCE);
      for (LogEntry entry : logs) {
          if (entry.toString().contains("\"type\":\"Img\""))
              System.out.println(entry.toString());
  
          printlog.append(new Date(entry.getTimestamp()) + " " + entry.toString() + " "
                  + System.getProperty("line.separator"));
          printlog.append(System.getProperty("line.separator"));
          printlog.append(System.getProperty("line.separator"));
      }
      printlog.close();
  }
  </code></pre>