Manual input from user while running selenium IDE script

Rohit Ware picture Rohit Ware · Jan 19, 2012 · Viewed 17.3k times · Source

can user is able to give manual input while running selenium IDE script? For ex. If there is name field then can we open input box everytime script runs so that user can give his input for name field?

Let me know whether it is possible or not..

If yes then please suggest me a solution.

Thanks in advance

Answer

Stephen Binns picture Stephen Binns · Jul 13, 2012

You can use the following script to invoke a javascript prompt in order to get the value

<tr>
    <td>storeEval</td>
    <td>prompt(&quot;Please enter your FirstName&quot;)</td>
    <td>firstName</td>
</tr>

Then accessing the value is a case of using ${firstName}.

EDIT: Since Selenium IDE 2.5.0, the script needs to look like this:

<tr>
    <td>storeEval</td>
    <td>javascript{prompt(&quot;Please enter your FirstName&quot;)}</td>
    <td>firstName</td>
</tr>