Skip to main content
2 of 3
added 7 characters in body; deleted 3 characters in body
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 is to assign this object to an attribute.

this.signinPage = new SigninPage();

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

TestNG will instantiate 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.

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