Unable to Unlock the pin code in Android

Hi All,
Iam trying to unlock the pincode of the app, but is not working as expected
Following are the simple way i tried

@FindBy(how = How.ID, using =“com.wallet.client:id/pin_code_button_4”)
private WebElement number4;

@FindBy(how = How.ID, using ="com.wallet.client:id/pin_code_button_3")
private WebElement number3

public void Unlock()
{
number3.click();
number4.click();
}
iam getting null pointer exception whenever i invoke the method

I tried with Tap method of touch action, but it throws null pointer exception error

Attaching screenshot for the same.

Appreciate for the support
Thanks

Did you check if the driver is initialized properly?

Hi Hemanth,

Thanks for the respond … yea i ininialized the driver

this is the entire code used for the above action
private WebDriver driver;
//TouchAction action = new TouchAction(this.driver);*/
@FindBy(how = How.ID, using =“com.wallet.client:id/pin_code_button_4”)
private WebElement number4;

@FindBy(how = How.ID, using ="com.wallet.client:id/pin_code_button_3")
private WebElement number3;

@FindBy(how = How.ID, using ="com.wallet.client:id/pin_code_button_2")
private WebElement number2;

@FindBy(how = How.ID, using ="com.wallet.client:id/pin_code_button_1")
private WebElement number1;

public UnlockKeypad(WebDriver driver)
{
	this.driver = driver;
}

public void Unlock()
{
	
	number4.click();

Where did you create AndroidDriver() instance ? Can you post that code too ?

Hi Hemanth,

Please look at the following code

public class UnlockKeypad

{
private AndroidDriver driver;
//TouchAction action = new TouchAction(this.driver);*/
@FindBy(how = How.ID, using =“com.wallet.client:id/pin_code_button_4”)
private WebElement number4;

@FindBy(how = How.ID, using ="com.wallet.client:id/pin_code_button_3")
private WebElement number3;

@FindBy(how = How.ID, using ="com.wallet.client:id/pin_code_button_2")
private WebElement number2;

@FindBy(how = How.ID, using ="com.wallet.client:id/pin_code_button_1")
private WebElement number1;

public UnlockKeypad(AndroidDriver driver)
{
	this.driver = driver;
	PageFactory.initElements(driver, this);
}

public void Unlock()
{
	
	number4.click();	
}

}