title: Java/Selenium WebDriver: How to get user input and insert it in to a text field?
body: <p>At the moment in Eclipse, I have the following code:  </p>
  
  <pre><code>driver.findElement(By.name("LoginText1")).clear();
  System.out.println("Username: ");
  Scanner scan1 = new Scanner(System.in);
  String input1 = scan1.nextLine();
  System.out.println(input1);
  </code></pre>
  
  <p>and was just wondering, instead of it simply returning the user's input in to the console, is there a way to get it to insert it in to the text field. I want to insert it into a field which has the name <em>LoginText1</em>. This is for website testing with Selenium WebDriver.<br>
  I am new to Java and all help is greatly appreciated.</p>