MachinePublishers / jBrowserDriver

A programmable, embeddable web browser driver compatible with the Selenium WebDriver spec -- headless, WebKit-based, pure Java
Other
809 stars 143 forks source link

Problem with sendKeys #226

Closed ZaziroZ closed 7 years ago

ZaziroZ commented 7 years ago

Hello there,

Let's assume there is some input WebElement inputField;

Command inputField.sendKeys(Keys.CONTROL + "a", Keys.DELETE) should select all and then delete everything in the input field

Instead, jBrowserDriver types "a" into the field.

Regards

FranAguiar commented 7 years ago

Just use inputField.clear();

ZaziroZ commented 7 years ago

But this works fine in regular drivers.

Okay, in this case inputField.clear(); can do. But doesn't it mean that other Keys commands do not work with jBrowserDriver as well?

hollingsworthd commented 7 years ago

Haven't tested this but maybe inputField.sendKeys(Keys.chord(Keys.CONTROL + "a") + Keys.DELETE) or inputField.sendKeys(Keys.chord(Keys.CONTROL + "a")); inputField.sendKeys(Keys.DELETE)

If other drivers handle sendKeys(Keys.CONTROL + "a", Keys.DELETE) this one should too.