Reputation: 31
I am unable to send keyboard entry as CTRL+P using selenium. Please help.
My code looks like below: getWebElement("Registration").sendKeys(Keys.chord(Keys.CONTROL, "p"));
I have tried CTRL+A with the same code and it works without any issues.
Upvotes: 0
Views: 2230
Reputation: 720
If you are trying to print, this is working for me
((JavascriptExecutor) driver).executeScript("print()");
Upvotes: 2
Reputation: 2814
Try with actions
Actions actions = new Actions(driver);
actions.sendKeys(Keys.chord(Keys.LEFT_CONTROL, "p")).build().perform();
Upvotes: 0