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 hi
Just a minor modification to Stephen Binns response. I'm running Selenium IDE 2.5.0 and my test looks like this:
<tr>
<td>store</td>
<td>javascript{prompt("password")}</td>
<td>password</td>
</tr>
Without the javascript{} it wouldn't prompt.
You can use the following script to invoke a javascript prompt in order to get the value
<tr>
<td>storeEval</td>
<td>prompt("Please enter your FirstName")</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("Please enter your FirstName")}</td>
<td>firstName</td>
</tr>
none of the accepted answers worked for me. Here is how I solved it:
Create new command (at the top to store my variable that I wanted to use in 30 places.)
then in the 30 places I wanted to use that variable. I put this
In Selenium IDE 2.8.0: Capture the test session entering the login and password. Edit the Command for each and change from "type" to "waitForText" and remove the values in the Value fields previously stored for login and password. Re-run the saved test script from the IDE.
You could use the technique suggested here which uses the Selenium WebDriver and Java's BufferedReader
. I don't think it can be adapted for Selenium IDE, but the technique should work fine with Selenium RC.
The basic idea is:
Call the following code to capture the user input to a BufferedReader.
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
reader.readLine();
(Note, if you are using C#, there is a discussion here on how to use Console.In.ReadLine();
instead of BufferedReader
).
The proposed solution works fine for selenium IDE (tested for 2.5)
<tr>
<td>store</td>
<td>javascript{prompt("password")}</td>
<td>password</td>
</tr>