RE: How to click the option of the menu which the right click pop up?

currently ,I study selenium web driver and learn a lot of tips&tricks from your website page (http://www.toolsqa.com/), very helpful ,so thanks a lot. As a beginner , I met many problems ,I appreciate it if you can help me to solve this problem.
Here is the thing:
I want to right click specific download button when pop up menu, click the one of the options(such as save ,in Chinese character it’s “另存为” ). let me show you ,please see the picture as following:

RE: How to click the option of the menu which the right click pop up?


my problem is I can’t click the “save” option by webdriver,please help me. thanks in advance !!!
I also try some code from other guys, but doesn’t work at all.

Actions act = new Actions(driver);

WebElement link = driver.findElement(By.id("xpath"));

act.moveToElement(link).contextClick().sendKeys(Keys.ArrowsDown).build().perform();


please help !!!

Young Train Asked on September 10, 2014 in Selenium WebDriver.
Add Comment
3 Answers

very helpful, cool.
one more thing ,I run your code but not every time succeed.I just don’t know Why?
maybe the browser currently not set focus? or maybe robot can’t get the right click menu.

Train Answered on September 12, 2014.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.