Set hidden input value in Selenium?

We have hidden input fields in our form, and we need Selenium to set the value of these fields. What is the best way to set the value of hidden inputs through the Selenium IDE?

+7
source share
2 answers

The easiest way to find:

Command: runScript

Value:

javascript{this.browserbot.getCurrentWindow().document.getElementById('hiddenElementId').value='TheValue'} 
+12
source

Late to the party ...

When you use the IDE, you can add a type command with the target id = yourID and value It seems to work.

Copy the text below and paste it into the IDE to try it

 <tr> <td>type</td> <td>id=yourID</td> <td>field value</td> </tr> 

This seems to work for me (Selenium 2.9.1)

+3
source

All Articles