title: Selenium command ordering for one-after-another JavaScript prompts
body: <p>One script we have asks the user for a few values via successive JavaScript calls to window.prompt().  Selenium records this action, both the prompt texts and the values I typed in, but it doesn't seem to be able to play it back properly.  It 'succeeds' in that no errors occur, but only the first prompt value actually makes it back to my script.  Furthermore, the default ordering Selenium records makes the <em>second</em> value get returned in the first one's spot, and the rest still blank:</p>
  
  <pre><code># [info] Executing: |answerOnNextPrompt | TEXT1 | |
  # [info] Executing: |select | id | label=mychoice |
  # [info] Executing: |answerOnNextPrompt | TEXT2 | |
  # [info] Executing: |assertPrompt | Please enter a value for q1 | |
  # [info] Executing: |answerOnNextPrompt | TEXT3 | |
  # [info] Executing: |assertPrompt | Please enter a value for q2 | |
  # [info] Executing: |answerOnNextPrompt | TEXT4 | |
  # [info] Executing: |assertPrompt | Please enter a value for q3 | |
  # [info] Executing: |assertPrompt | Please enter a value for q4 | | 
  </code></pre>
  
  <p>I reordered it into what seems more sensible to me:</p>
  
  <pre><code># [info] Executing: |answerOnNextPrompt | TEXT1 | |
  # [info] Executing: |select | id | label=mychoice |
  # [info] Executing: |assertPrompt | Please enter a value for q1 | |
  # [info] Executing: |answerOnNextPrompt | TEXT2 | |
  # [info] Executing: |assertPrompt | Please enter a value for q2 | |
  # [info] Executing: |answerOnNextPrompt | TEXT3 | |
  # [info] Executing: |assertPrompt | Please enter a value for q3 | |
  # [info] Executing: |answerOnNextPrompt | TEXT4 | |
  # [info] Executing: |assertPrompt | Please enter a value for q4 | | 
  </code></pre>
  
  <p>After that I get TEXT1 as the first value, but the rest still blank.</p>
  
  <p>I also tried waitForPrompt in place of each assertPrompt, but no dice.</p>
  
  <p>My guess is that Selenium can't actually handle this situation because answerOnNextPrompt seems to need to come before the action that triggers the prompt, but it <em>is</em> the action that triggers the next prompt, so after the first one triggered by select there's no way to do it because they don't stack.</p>
  
  <p>I'd like to be proven wrong, though...any ideas?</p>
  
  <p>(If not, I might report it as a bug / something they need to change in the API, maybe by combining answerOnNextPrompt with assertPrompt: it could just take an optional argument with how the prompt ought to be answered.)</p>
  
  <p>Platform is Selenium IDE 1.0.2 on Firefox 3.5.3 on win32.</p>