ericmckean / chromedriver

Automatically exported from code.google.com/p/chromedriver
0 stars 0 forks source link

I can´t open new tab in ChromeDriver #903

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Issue Description:
I can´t open new tab in ChromeDriver

Steps to reproduce 
1. Open a new page "driver.get("https://www.google.com.br");"
2. Send keyboard shortcut CTRL+t 
"driver.findElement(By.cssSelector("body")).sendKeys(Keys.CONTROL + "T");"

Found Result
nothing happens

Expected result:

A New tab is create in ChromeDriver

OBS:

In Firefox (31) and IEDriver(2.42) is working

ChromeDriver = 2.10.267521
Chrome = 37.0.2062.120 m
OS = Windows 7 Professional

Original issue reported on code.google.com by Vanilto...@gmail.com on 15 Sep 2014 at 9:24

GoogleCodeExporter commented 9 years ago
Sorry step 2 is 
"driver.findElement(By.cssSelector("body")).sendKeys(Keys.CONTROL + "t");"

Original comment by Vanilto...@gmail.com on 15 Sep 2014 at 9:41

GoogleCodeExporter commented 9 years ago
This workaround works for me:

new 
Actions(window).keyDown(Keys.CONTROL).click(element).keyUp(Keys.CONTROL).build()
.perform();

In other words, use CTRL+LMB to open links in a new tab. Use CTRL+SHIFT+LMB to 
open links in a new tab, and also shift focus to the new tab.

Original comment by cow...@bbs.darktech.org on 28 Nov 2014 at 4:15

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 21 Feb 2015 at 12:18

GoogleCodeExporter commented 9 years ago
This is a limitation in the way we simulate keyboard input in ChromeDriver. 
Keys get sent directly to the render process, bypassing the browser process. So 
any keyboard shortcut handlers in the browser process will not be invoked by 
sendKeys().

Original comment by samu...@chromium.org on 5 Mar 2015 at 10:42