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

Hope this works for you

Need Your Help

Can't catch null_value_not_allowed exception in postgresql 9.3

postgresql exception-handling plpgsql

I was wondering if I am missing something obvious here. I have a function that defines a table name and then goes to query that table in an execute clause. However if there are no data in the main ...