Skip to main content

I found the solution forto the problem. I just had to add single line of code to make this work.

MyClass object= PageFactory.initElements(driver, MyClass.class);       
 

I had to add this code to the class where I was creating the test and tried. It worked. The Error wasn't in using of "@FindBy"@FindBy. So I guess this will help someone in the future.

I found the solution for the problem. I just had to add single line of code to make this work.

MyClass object= PageFactory.initElements(driver, MyClass.class);       
 

I had to add this code to the class where I was creating the test and tried. It worked. Error wasn't in using of "@FindBy". So I guess this will help someone in future.

I found the solution to the problem. I just had to add single line of code to make this work.

MyClass object= PageFactory.initElements(driver, MyClass.class);       
 

I had to add this code to the class where I was creating the test and tried. It worked. The Error wasn't in using of @FindBy. So I guess this will help someone in the future.

Source Link
Syrus
  • 1.2k
  • 4
  • 17
  • 32

I found the solution for the problem. I just had to add single line of code to make this work.

MyClass object= PageFactory.initElements(driver, MyClass.class);       
 

I had to add this code to the class where I was creating the test and tried. It worked. Error wasn't in using of "@FindBy". So I guess this will help someone in future.