Skip to main content
1 of 3
João Farias
  • 11k
  • 2
  • 20
  • 40
    public void setup() {
        initialization();
        SigninPage signinPage = new SigninPage();
    }

Here, you are assigning a SiginPage object to a singinPage local variable. This object is eligible to be destroyed as soon as the method ends.

What you probably want to do it to assign this object to the class attribute.

this.signinPage = new SigninPage();

Attribute last as long as the object which holds them exists.

TestNG will instantiate the a SigninPageTest object, call each one of the @Test methods, along with the hooks @Before/@After and only after the tests destroy the SigninPageTest object.

João Farias
  • 11k
  • 2
  • 20
  • 40