I am trying to verify a functionality as a guest user and logged in user. In order to do that I log out form the system and verify the guest user actions then login again and verify logged in user actions. I am using login page object to login again to the system reusing login page script. I'm getting this.searchContext is null error when trying to pass the user name. Even though username input web element is found, value is not passed to input field.
Below is page class script for passing username
As you can see even though element is found it gives element not found as a result. What is wrong in this script?