I am writing a selenium code.
Unless I put the Thread.Sleep in a try catch block it won't work. It actually throws a compile time error.
Why so?
 public void test() {
  
  System.out.println("in the test method");
  achromeDriver.get(abaseUrl);
  
  try {
   Thread.sleep(6000);
  } catch (InterruptedException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }
  
  WebElement benzRadioBtn = achromeDriver.findElement(By.id("benzradio"));
  benzRadioBtn.click();
  
  WebElement benzCheckBox = achromeDriver.findElement(By.id("benzcheck"));
  benzCheckBox.click();
  
  System.out.println("Is ben radio button selected ? "+  benzRadioBtn.isSelected());
  
 } 
    