java selenium - hidden input value <p>First Stack post, so don't be harsh if I get it wrong.</p> <p>Im using selenium and java for some automated testing. All was going well until I tried to set the value of a hidden input.</p> <p>When using 'type' in the Firefox IDE, it works a treat, but when I use the line below, it doesn't play at all. It just fails. </p> <pre><code>// This line doesnt like to run because its hidden selenium.type("name=startDate_submit", "2015-09-25"); </code></pre> <p>Can anyone point me in the right direction. </p> <p>Many Thanks.</p> <p><strong>Edit:</strong></p> <pre><code>WebDriver driver = new ChromeDriver(); JavascriptExecutor jse = (JavascriptExecutor)driver; jse.executeScript("$([name=startDate_submit]).attr('type', 'text');"); Thread.sleep(3000); // This line doesnt like to run because its hidden selenium.type("name=startDate_submit", "2015-09-25"); </code></pre> <p>Should this be the way I do this? I just cannot get it working.</p>