title: How to close dialog by Selenium?
body: <p>I want close browser file window pop-up (when I upload picture to Wordpress).</p>
  
  <p><a href="https://i.stack.imgur.com/kvxkq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kvxkq.png" alt="enter image description here"></a></p>
  
  <p>I tried</p>
  
  <pre><code>driver.close();
  driver.findElement(By.id("set-post-thumbnail")).sendKeys(Keys.ESCAPE);
  driver.switchTo().alert().dismiss();
  </code></pre>
  
  <p>but it doesn't work. How to close dialog by Selenium?</p>