Selenium WebDriver code being used.
FreeToPay is class representing Home Webpage of http://www.royalmail.com/
getWebDriver is get method to get webdriver instance.
WebElement Menu=FreeToPay.getWebDriver().findElement(By.linkText("Receiving mail"));
//Sub menu
WebElement MenuItem=FreeToPay.getWebDriver().findElement(By.linkText("Redelivery"));
Actions builder = new Actions(driver);
Actions hoverOverRegistrar = builder.moveToElement(Menu);
hoverOverRegistrar.build().perform();
MenuItem.click();
Since I cannot see the link in the page, there are my tips:
Try that manually and exactly follow whats in the script. If you cannot do it manually, you will probably have to update the script
There is possibly typo in the code:
you define WebElement called
MenuItembut later on you try to hover over something which is calledMenuonly:Maybe try to replace it by
BTW one last advice: The variables should start with lowercase letter – see this advice