我浏览过互联网以获取相关信息,但没有运气。下面的示例代码给出:在Page Factory设计模式中返回对象的用例是什么?
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);
}
}
我想知道同时呼吁fillFormDetails(String firstname, String emailid)
方法,为什么我们正在返回的对象?
什么可能是用例,所以我们可以用它来管理我们的代码效率?
感谢您的回答 – NarendraR