title: Java / Android: simulate click on submit button (HTML)
body: <p>I want to <strong>simulate</strong> a <strong>click</strong> <strong>on</strong> a website on a <strong>submit-type</strong> <strong>button</strong></p>
  
  <p>this is the code for now, but apparently it does not work:</p>
  
  <pre><code>                                 String id = "x";
                                   String pw = "y";
  
                                   web.getSettings().setDomStorageEnabled(true);
  
                                   web.loadUrl("javascript: {" +
                                           "document.getElementsByName('authid')[0].value = '"+id +"';" +
                                           "document.getElementsByName('authpw')[0].value = '"+pw +"';" +
                                           "var submit = document.getElementsByClassName('inputbutton');" +
                                           "submit[0].submit(); };");
  </code></pre>
  
  <p><strong>and this is how it looks like: <a href="https://i.stack.imgur.com/Z42vQ.png" rel="nofollow noreferrer">Screenshot of Emulator</a></strong></p>
  
  <p>the code for the button on the website:</p>
  
  <pre><code>&lt;input type="submit" value="OK" class="inputbutton"&gt;
  </code></pre>
  
  <p>thanks in advance :)</p>