Reputation: 11
I have to use combination keys (Ctrl+00) in Selenium (Java) to submit a form, which will not accept key presses from the numpad, but only the keys from the backspace row. Could anybody please help?
driver.switchTo().activeElement().sendKeys(Keys.Control, Keys.NUMPAD9, Keys.NUMPAD9);
driver.switchTo().activeElement().sendKeys(Keys.Control, Keys.NUMPAD0, Keys.NUMPAD0);
Upvotes: 1
Views: 198
Reputation: 8394
Try with Keys class:
driver.switchTo().activeElement().sendKeys(Keys.chord(Keys.CONTROL, "0"), Keys.chord(Keys.CONTROL, "0"));
Upvotes: 1