@Add User Scenario: Add a new User profile in the System Given user is on the Add User profile page Then Add a new user profile in the system Then verify that user has been added successfully
Now, for example, i want call the methods of "Login" over here. If i dont initialize the elements using the page factory in this scenario itself, then i get null pointer exception.
Login login = PageFactory.initElements(driver, Login.class);
if i have initialized the class in some other scenario, then also i get null pointer error. Should i initialize the class globally outside of any methods?