Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can't open the NEW TAB in google Chrome Using selenium

this is my line to open the new tab

 driver.findElement(By.cssSelector("body")).sendKeys(Keys.CONTROL +"t");
like image 393
user3080885 Avatar asked Jan 23 '26 02:01

user3080885


1 Answers

((JavascriptExecutor)driver).executeScript("window.open();");

This JavaScript code opens a new tab for the Chrome browser.

like image 77
user7181273 Avatar answered Jan 25 '26 17:01

user7181273



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!