title: Handling print window in selenium webdriver
body: <p>There is a print button in my application. When I click on the button print windows open with cancel and print button. </p>
  
  <p>I want to click on cancel button in the print window.</p>
  
  <p>I know handling print window is not possible using selenium webdriver alone. I tried using Robot class. But it is not working. </p>
  
  <pre><code>WebDriver driver = (WebDriver) new ChromeDriver();
  driver.get("https://www.joecolantonio.com/SeleniumTestPage.html");
  driver.manage().window().maximize();
  Thread.sleep(2000);
  //clicking on the print button      
  driver.findElement(By.id("printButton")).click();
  //print window opens 
  //creating robot class object    
  Robot r = new Robot();
  r.delay(1000);
  r.keyPress(KeyEvent.VK_ESCAPE);
  r.keyRelease(KeyEvent.VK_ESCAPE);
  </code></pre>
  
  <p>The print window opens but nothing happens after that. I was expecting escape button will make the window exit but its does not happens. But manually when I press escape button print window disappears. </p>