title: How to create a webdriver function which passes parameters for a test script?
body: <p>I am trying to create a function for a login test script which passes parameters such as Username and Password. I am new to this please do elaborate. Here's the code I've written-- </p>
  
  <pre><code>public void portalLogin(String Username, String Password){
  
  driver.get(URL);
  driver.findElement(By.id("UserName")).clear();
  driver.findElement(By.id("UserName")).sendKeys(Username);
  driver.findElement(By.id("Password")).clear();
  driver.findElement(By.id("Password")).sendKeys(Password);
  driver.findElement(By.cssSelector("input.submitBtn")).click();
  driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
  } 
  </code></pre>
  
  <p>I just want to call this weird of a function to another test class, so that I don't have to write this over and over again. Please help!</p>