How to open a new tab using Selenium WebDriver with Java?

0
0

How to open a new tab in the existing Firefox browser using Selenium WebDriver (a.k.a. Selenium 2)?

  • You must to post comments
0
0

The code below will open the link in new Tab.

String selectLinkOpeninNewTab = Keys.chord(Keys.CONTROL,Keys.RETURN); 
driver
.findElement(By.linkText("urlLink")).sendKeys(selectLinkOpeninNewTab);

The code below will open empty new Tab.

String selectLinkOpeninNewTab = Keys.chord(Keys.CONTROL,"t");
driver
.findElement(By.linkText("urlLink")).sendKeys(selectLinkOpeninNewTab);
  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website