Comment #1 on issue 8468 by
sadasiva...@gmail.com: Ctrl+q chord does not
public static Keys getKeyFromUnicode(char key)
Get the special key representation, Keys, of the supplied character if
there is one. If there is no special key tied to this character, null will
be returned.
System.out.println(Keys.getKeyFromUnicode('q')) return null.
And our command to system from selenium is below
_driver.findElement(By.tagName("body")).sendKeys(Keys.chord(Keys.CONTROL,
Keys.getKeyFromUnicode('q')));
it will be evaluated as
_driver.findElement(By.tagName("body")).sendKeys(Keys.chord(Keys.CONTROL, "NULL"));
ctrl+N means Open New Tab
ctrl+U means open source code of web page.
Solution:
_driver.findElement(By.tagName("body")).sendKeys(Keys.chord(Keys.CONTROL, "q");
if it doesn't work to quit the browser then it is not binded with OS for
short cut.
Additional info:
_driver.findElement(By.tagName("body")).sendKeys(Keys.chord(Keys.CONTROL, "W");
above code was closed the current window.