Struggling with finding the right solution, I have attempted various methods. Apologies for any formatting errors, but the element that requires clicking is:
<button href="javascript:void(0)" id="payNewBeneficiary" class="button-new-payee">
<div class="icon">
<div></div>
</div>
<h2>Someone new</h2>
<p>Make a once-off payment or pay someone new</p>
</button>
I have experimented with locating the element by ID, cssSelector, and xpath. Additionally, I have tried the following approaches:
Actions act = new Actions(driver);
act.moveToElement(payNewBeneficiaryButton);
act.click(payNewBeneficiaryButton);
act.build().perform();
As well as:
((JavascriptExecutor)driver).executeScript("document.getElementById('payNewBeneficiary').click()");
And also:
JavascriptExecutor exec = (JavascriptExecutor) driver;
exec.executeScript("arguments[0].click()", payNewBeneficiaryButton);