In POM model getting NullPointerException | Selenium Forum
A
ajit Posted on 19/04/2019

I am using POM model with PageFactory.

While executing tets case I am gettin Nullpointer Exception.

If I use driver.findElement for WebElement then it works fine but for @FindBy annotation it does not work.

Please see the attachment.

Regards

Ajit Choudhari

 

 


A
Avinash Vijaykumar Mahamuni Replied on 20/04/2019

put 

homePage(webdriver driver){

this.driver=driver;

}

in homePage constaructor


A
Ashish Thakur Replied on 20/04/2019

Yes... Try this