![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGdlJqGV6xGmvzal-N0MprEZWgyVqIAsou0kV5EwKRJGTbxCkW-zK6eD4ffyBowdr7bZuAGOJz22XbvMTLYIF82LvrLWOnoW5AHZxfF0xbm7eZAP1B7kLe5WRslH5F6_elanJzHVM3KE0/s1600/right-click-icon.png)
Let's see the implementation
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9PXwgpS4QKFkJfOGzObXkmbzcXhyphenhyphengCMTDYMVHt5cJ_8HYKknpCyhfRFGSq9-CwExM9SNLXyaNF-PWvo5pbb4O0KhzTQH6-sATsZFmDkekGf6hwSNwcpChIZNDyLmYBjxVTrX4lGFaby8/s320/contextmenu.jpg)
package testPkg; import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.interactions.Actions; public class RightClick { public static void main(String[] args) { WebDriver driver = new FirefoxDriver(); driver.get("http://www.qavalidation.com/p/demo.html"); WebElement lnk_sel = driver.findElement(By.linkText("Selenium Tutorial!")); Actions action= new Actions(driver); action.contextClick(lnk_sel).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.RETURN).build().perform(); } }
No comments:
Post a Comment