Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actions.sendKeys(Keys.ENTER) on browser window does not trigger key events #1419

Closed
codingphil opened this issue Nov 5, 2018 · 4 comments
Closed

Comments

@codingphil
Copy link

codingphil commented Nov 5, 2018

System

  • Version: 0.23.0
  • Platform: Windows 10 Version 1809 Build 10.0.17763.1
  • Firefox: 63.0.1 (64-bit)
  • Selenium: 3.13.0

Testcase

The test case below sends an ENTER keystroke to the browser window and then checks if the keydown event was fired (checkbox on web page is expected to be checked).

@Test
public void testSendEnterToBody_actionsApiSendKeys_eventFired() {
  webDriver.navigate().to("https://philipl-micro-focus.github.io/webdriver-testpages/specialKeys.html");
  WebElement enterIndicator = webDriver.findElementById("enter");
  assertFalse("ENTER checkbox expected to be NOT checked", enterIndicator.isSelected());

  new Actions(webDriver).sendKeys(Keys.ENTER).perform();

  assertTrue("ENTER checkbox expected to be checked", enterIndicator.isSelected()); // FAILS
}

Adding a click on the H1 tag before the call of Actions.sendKeys() did not help.

Tested also with Firefox Nightly 65.0a1 (2018-11-05) (64-bit).
Same result (failing test) as with Firefox 63.0.1.

Stacktrace

java.lang.AssertionError: ENTER checkbox expected to be checked
	at org.junit.Assert.fail(Assert.java:88)
	at org.junit.Assert.assertTrue(Assert.java:41)
	at SendKeysTests.testSendEnterToBody_actionsApiSendKeys_eventFired(SendKeysTests.java:328)

Trace-level log

geckodriver-log.txt

@whimboo
Copy link
Collaborator

whimboo commented Nov 5, 2018

Dupe of #985?

@andreastt
Copy link
Contributor

@whimboo I would expect so, yes. We really should prioritise fixing this, but I guess this is depending on converting the Element Send Keys command to using action primitives?

@andreastt
Copy link
Contributor

Closing as duplicate of #985.

@lock
Copy link

lock bot commented Aug 16, 2019

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have run into an issue you think is related, please open a new issue.

@lock lock bot locked and limited conversation to collaborators Aug 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants