I've browsed over internet to get the relevant info but no luck. The example code is given below :
public class HomePage
{
@FindBy(id = "fname")
WebElement name;
@FindBy(id = "email")
WebElement email;
@FindBy(id = "password")
WebElement password;
@FindBy(id = "passwordConf")
WebElement confPassword;
public HomePage fillFormDetails(String firstname, String emailid)
{
name.sendKeys(firstname);
email.sendKeys(emailid);
return this;
}
public void fillPass(String pass)
{
password.sendKeys(pass);
}
}
I want to know why we are returning the object while calling fillFormDetails(String firstname, String emailid)
method ?
What could be the usecases so we can use this to manage our code efficiency ?