1

I'm using below line of code

driver.findElement(By.cssSelector("Body")).sendKeys(Keys.CONTROL + "t");

this is not working.

I'm using Selenium with Java.

I need to open two websites parallelly in the same browser chrome or Firefox.

I have used below line to create new tab but not working

driver.findElement(By.cssSelector("Body")).sendKeys(Keys.CONTROL + "t")

If not this then what is the correct way to do so.

Kuldeep Kamune
  • 169
  • 2
  • 10
  • Can you post error if any thrown by code? also have you tried out below javaScript `((JavascriptExecutor) driver).executeScript("window.open()");` – Kuldeep Kamune Sep 22 '20 at 17:15
  • No error is thrown...((JavascriptExecutor) driver).executeScript("window.open()"); this worked...thanks!!! – user13987365 Sep 29 '20 at 13:27

0 Answers0