0

I want to get input at runtime using selenium ide. could any one help me?

Dinesh Kumar
  • 71
  • 1
  • 2
  • 8

2 Answers2

6

You can put break command or input-box

1.By input-box
Command 1
Command 2
Command 3
4th command will be
storeEval | prompt(“Enter input”); |variable
type | locator of field where you want to put value| ${variable}
continue with your next commands

2.By break command

Command 1
Command 2
Command 3
4th command will be
Break
Enter input manually and resume execution of test
continue with your next commands

Sample Script for you

Rohit Ware
  • 1,982
  • 1
  • 13
  • 29
  • storeEval | prompt(“Enter input”); |variable... could u plz explain how to use that? – Dinesh Kumar Jul 13 '12 at 07:23
  • i have attached sample image for you – Rohit Ware Jul 13 '12 at 08:07
  • @RohitWare, can you please explain how this question differs from https://stackoverflow.com/questions/8921929/manual-input-from-user-while-running-selenium-ide-script that you yourself asked before this was created? I think they are basically the same. – Petr Bodnár Nov 16 '19 at 20:04
0

you can use java.util.scanner for entering user input during runtime.

import java.util.Scanner;

public class UserInputExample(){
  Scanner inputText = new Scanner(System.in);
  public static void main(String[] args ){
    String search= inputText.next();
 driver.findElement(By.xpath("//body/div[@id='searchform']/form[@id='tsf']/div[2]/div[1]/div[2]/div[1]/div[2]/input[1]")).clear().sendKeys(search);

  }
}