Wednesday 13 August 2014

Declare function using Getters and Setters option in eclipse

Declare function using Getters and Setters option in eclipse

public class loginC3dn
{

    @FindBy(id="username")
    @CacheLookup
    private WebElement userIdBox;
   
    @FindBy(id="password")
    @CacheLookup
    private WebElement passwordBox;
   
    @FindBy(id="ipurl")
    @CacheLookup
    private WebElement logInButton;

Put the mouse on statement and right click and choose "Generate Getters and Setters"

Click on select Getters button and click ok button

Now you get the below code automatically

public WebElement getUserIdBox() {
        return userIdBox;
    }

    public WebElement getPasswordBox() {
        return passwordBox;
    }

    public WebElement getLogInButton() {
        return logInButton;
    }
   

No comments:

Post a Comment