
Let's see the implementation

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