Set hidden input value in Selenium?

a 夏天 提交于 2019-11-30 13:56:49

Easiest way I could find:

Command: runScript

Value:

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

Late to the party...

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

Copy the text below and paste it in the IDE to try it out

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

This seems to work for me (Selenium 2.9.1)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!