0

I have tried the code below for opening a link in new tab. It is opening a tab but the focus remains in the old tab itself.

Actions act= new Actions(driver);
WebElement element= driver.findElement(By.partialLinkText("Selenium"));
act.contextClick(element).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ENTER).perform();

How to change focus to new tab?

Dinu
  • 845
  • 3
  • 13
  • 27

0 Answers0