Issue 5919 in selenium: Can't send Control+key to Chrome when using Mac OSX

1,101 views
Skip to first unread message

sele...@googlecode.com

unread,
Jul 12, 2013, 9:54:01 AM7/12/13
to selenium-develope...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium Status-Untriaged

New issue 5919 by c...@realvnc.com: Can't send Control+key to Chrome when
using Mac OSX
http://code.google.com/p/selenium/issues/detail?id=5919

Selenium version: v33.0
OS: Mac OSX 10.8 (Mountain Lion)
Browser: Chrome
Browser version: 28.0.1500.71

The browser never receives the keys when I send control (or command) and
another key. I am using the Java bindings. Here is some sample code:

import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;

import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;

public class ExamplePasteFailure {

@Test
public void testPaste()
{
WebDriver chrome = new ChromeDriver();
chrome.get("http://www.google.com");
WebElement element = chrome.findElement(By.name("q"));

Clipboard clipboard =
Toolkit.getDefaultToolkit().getSystemClipboard();
StringSelection clipboardtext = new StringSelection("Hello world");
clipboard.setContents(clipboardtext, null);

element.sendKeys(Keys.chord(Keys.CONTROL,"v"));
element.sendKeys("abc");

Thread.sleep(1000);


chrome.close();
}

}

I can guarantee that "Hello world" is placed in the computer's clipboard!
This bug doesn't exist on Ubuntu 12.04 and I think it might be related to
issue .



--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

sele...@googlecode.com

unread,
Jul 15, 2013, 2:15:32 PM7/15/13
to selenium-develope...@googlegroups.com

Comment #1 on issue 5919 by williama...@gmail.com: Can't send Control+key
if you are just lloking for a way around this you could try something like
this , it should simulate a user right clicking and selecting paste

final WebElement e = driver.findElement( By.name( "q" ) );
new Actions( driver ).contextClick( e ).sendKeys( "p" ).perform();

sele...@googlecode.com

unread,
Jul 23, 2013, 8:48:28 AM7/23/13
to selenium-develope...@googlegroups.com
Updates:
Status: WorkingAsIntended
Labels: -Status-Untriaged

Comment #2 on issue 5919 by jmle...@gmail.com: Can't send Control+key to
Control+V doesn't paste on OSX. Use Keys.chord(Keys.COMMAND, "v")

sele...@googlecode.com

unread,
Jul 23, 2013, 9:10:50 AM7/23/13
to selenium-develope...@googlegroups.com

Comment #3 on issue 5919 by c...@realvnc.com: Can't send Control+key to
Command-v doesn't work either.

sele...@googlecode.com

unread,
Jul 17, 2014, 6:19:54 AM7/17/14
to selenium-develope...@googlegroups.com

Comment #4 on issue 5919 by shahme...@gmail.com: Can't send Control+key to
Did you find a solution for this? I have the same problem

sele...@googlecode.com

unread,
Sep 2, 2014, 4:00:03 AM9/2/14
to selenium-develope...@googlegroups.com

Comment #5 on issue 5919 by friedhoe...@gmail.com: Can't send Control+key
to Chrome when using Mac OSX
https://code.google.com/p/selenium/issues/detail?id=5919

I have the same issue. Neither command-t or command-a seems to work, but
they do when I use the firefox driver.

sele...@googlecode.com

unread,
Sep 2, 2014, 4:01:23 AM9/2/14
to selenium-develope...@googlegroups.com

Comment #6 on issue 5919 by hoe...@hsac.nl: Can't send Control+key to

sele...@googlecode.com

unread,
Oct 7, 2014, 9:25:16 AM10/7/14
to selenium-develope...@googlegroups.com

Comment #7 on issue 5919 by nicgra...@gmail.com: Can't send Control+key to
Same for me, works in Firefox but not in Chrome
element.sendKeys(Keys.chord(Keys.COMMAND, "v"));

sele...@googlecode.com

unread,
Jan 15, 2015, 2:28:17 PM1/15/15
to selenium-develope...@googlegroups.com

Comment #8 on issue 5919 by bregens...@gmail.com: Can't send Control+key to
I think this is a duplicate of
https://code.google.com/p/chromedriver/issues/detail?id=30
Reply all
Reply to author
Forward
0 new messages