I have initialized the page factory elements, but it is throwing null pointer error
Login page code:
public class LoginPage extends BaseClass
{
public WebDriver driver;
@FindBy(id="inputusername|input")
public WebElement username;
@FindBy(id="inputppassword|input")
WebElement password;
@FindBy(id="loginbtn")
WebElement loginbutton;
public LoginPage(WebDriver driver)
{
this.driver = driver;
PageFactory.initElements(driver, this);
}
public void Login()
{
System.out.println(username);--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/40c3e0a5-e77c-4f5d-8810-038fd95bd34c%40googlegroups.com.
What is the "it" that is throwing NullPointerException?
On Fri, 14 Feb 2020 at 14:08, Madhurya A N <anmadh...@gmail.com> wrote:
--I have initialized the page factory elements, but it is throwing null pointer error
Login page code:
public class LoginPage extends BaseClass
{
public WebDriver driver;
@FindBy(id="inputusername|input")
public WebElement username;@FindBy(id="inputppassword|input") WebElement password; @FindBy(id="loginbtn") WebElement loginbutton; public LoginPage(WebDriver driver) { this.driver = driver; PageFactory.initElements(driver, this); } public void Login() { System.out.println(username);
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seleniu...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/2fd383a9-8be6-4d49-a5c1-948517519d68%40googlegroups.com.