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

sendKeys not working. #246

Closed ghost closed 7 years ago

ghost commented 7 years ago

List inputs = driver.findElementsByTagName("div"); for (WebElement allIn : inputs) { if (allIn.getAttribute("class") != null) { if (allIn.getAttribute("class").equals("input")) { System.out.println("eeeeeeeeeeeeeee"); allIn.sendKeys("Teste"); } } }

I want to get a div that has the class input, and write some text in it, and send.

However, this code is not working. Nothing happens.

Is there any other way?

hollingsworthd commented 7 years ago

Not sure. If you look in https://github.com/MachinePublishers/jBrowserDriver/blob/master/src/com/machinepublishers/jbrowserdriver/diagnostics/test.htm it's a test html page and the main method in https://github.com/MachinePublishers/jBrowserDriver/blob/master/src/com/machinepublishers/jbrowserdriver/diagnostics/Test.java runs the tests. If you could create a test case that reproduces this issue that would help. Otherwise it's hard to know whether it's a bug. Thanks.

ghost commented 7 years ago

Is an error in the button.

See #247