title: Clicking css buttons in selenium
body: <p>I'm working on a test case in Java and am using selenium to record a set of events and "replay" them to an app. The code is:</p>
  
  <pre><code>// *The app opens a new window*
  // Get handle of the main window
          String mainWindowHnd = webDriver.getWindowHandle();
          // Get all open window handlers
          Set openWindows = webDriver.getWindowHandles();
  
      Iterator ite=openWindows.iterator();
      // Select the new windows (there are two that are open)
      while(ite.hasNext())
      {
          String popupHandle=ite.next().toString();
          if(!popupHandle.contains(mainWindowHnd))
          {
              webDriver.switchTo().window(popupHandle);
          }
      }
  
      WebElement liveId = webDriver.findElement(By.id("c_clogoc"));
  </code></pre>
  
  <p>The id of the last statement is valid but inaccessible due to a css banner that is shown when the new window is opened. Running selenium IDE gives the following events:</p>
  
  <p><code>Command</code> :: <code>Target</code></p>
  
  <p>click      css=a.close</p>
  
  <p>How can I replay the command in Java so that the web driver closes the banner?</p>