Skip to main content
deleted 14 characters in body
Source Link
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
    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
    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.

added 7 characters in body; deleted 3 characters in body
Source Link
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 itis to assign this object to the classan attribute.

this.signinPage = new SigninPage();

AttributeAttributes 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.

  • List item
    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.

    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
Source Link
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.