Select an Option from the Right-Click Menu in Selenium Webdriver - Java

Select an Option from the Right-Click Menu in Selenium Webdriver - Java

To select the item from the contextual menu, you have to just move your mouse positions with the use of Key down event like this:-

Actions action= new Actions(driver);
action.contextClick(productLink).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.RETURN).build().perform();

hope this will works for you.
Have a great day :)

Unable to select an option from right click menu in selenium using java

Just use the below snippet

Actions action= new Actions(driver);
action.contextClick(hotSpot).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ENTER).build().perform();


Related Topics



Leave a reply



Submit