Force a button to open in a new window
I'm using Selenium Webdriver with Java and trying to force a click to open a new window. I can't use a contextClick because the option to open the link doesn't exist if I right-click the image button. Any ideas on how this can be done using Wedbriver?
You can consider pressing the Ctrl button and later performing the click activity. Code Example
WebElement element = driver.findElement(By.xpath("CHOOSE_YOUR_XPATH_HERE")); //Choose best way of selecting WebElement element.sendKeys(Keys.CONTROL); element.click();
Hope this works for you