title: Selenium Button Click() or Submit()?
body: <p>Need help on following scenario(using Java):</p>
  
  <p>Doing it manually like this: after filling in some info in a parent page, clicking Continue button on it, </p>
  
  <pre><code>&lt;INPUT TYPE='button' VALUE='Continue' onClick='sendForm()'&gt;
  </code></pre>
  
  <p>A child window(UserConfirmationPage) pops up with those info from its parent window, clicking the Continue button on the child page, posting the data to server.</p>
  
  <pre><code>&lt;FORM NAME='userConf' ACTION='user.jsp' METHOD='post'&gt; 
  Do you want to continue?&lt;BR&gt;
  &lt;INPUT TYPE='button' VALUE='Continue' onClick='createUser()'&gt; 
  &lt;/FORM&gt;
  </code></pre>
  
  <p>However, when I do it using Selenium Web Driver, on the parent page,  </p>
  
  <pre><code>btnContinue.submit() 
  </code></pre>
  
  <p>a child page pops up with those info from parent page just like what I got when I do it manually but parent does not exist any more. While using</p>
  
  <pre><code>btnContinue.click() 
  </code></pre>
  
  <p>a blank child page is opened without getting any info from parent page and it also complains "session is lost". </p>
  
  <p>I also tried:</p>
  
  <pre><code>JavascriptExecutor jse = (JavascriptExecutor) driver;
  jse.executeScript("arguments[0].click();",btnContinue);
  </code></pre>
  
  <p>and</p>
  
  <pre><code> new Actions(driver).moveToElement(driver.findElement(By.xpath("//input[@value='Continue']"))).click().perform();
  </code></pre>
  
  <p>but nothing works.</p>
  
  <p>It seems that neither Submit() nor Click() could simulate what was done manually. Any idea?</p>
  
  <p>Thanks a lot in advance!</p>