title: How can I press the alert ok button programmatically?
body: <p>How can I press the OK button in a JS alert programmatically?</p>
  
  <p>What I want to do: every time after the alert is created, the OK button is pressed.</p>
  
  <p>This is for a UI test using Selenium RC.</p>
  
  <p>Also, I have already checked: <a href="https://stackoverflow.com/questions/1348937/click-in-ok-button-inside-an-alert-selenium-ide">Click in OK button inside an Alert (Selenium IDE)</a>.</p>
  
  <p>Edit: I had already used <code>chooseOkOnNextConfirmation()</code> and placed it before clicking the button the generated the alert. I also tried placing it after. Nothing worked!</p>