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

Element sendKeys changes does not deliver single newline character #7886

Closed
TriciaCrichton opened this issue Dec 23, 2019 · 1 comment
Closed
Labels

Comments

@TriciaCrichton
Copy link
Contributor

🐛 Bug Report

Nov 18th change to Element.sendKeys in the Java bindings results in loss of a single newline character. This was introduced in fc12197.

If the input to sendKeys is "\n", nothing will be sent to the driver.
This results in breaking test FormHandlingTest.testShouldSubmitAFormUsingTheNewlineLiteral.

I believe this will also drop a trailing newline, but I haven't confirmed that.

To Reproduce

Run test FormHandlingTest.testShouldSubmitAFormUsingTheNewlineLiteral. The test code is:

public void testShouldSubmitAFormUsingTheNewlineLiteral() {
driver.get(pages.formPage);
WebElement nestedForm = driver.findElement(By.id("nested_form"));
WebElement input = nestedForm.findElement(By.name("x"));
input.sendKeys("\n");
wait.until(titleIs("We Arrive Here"));
assertThat(driver.getCurrentUrl()).endsWith("?x=name");
}

The test fails the wait, because the navigation never occurs. the SendKeys command delivers an empty string to ChromeDriver.

This build also shows the failure: https://github.com/SeleniumHQ/selenium/runs/309284705

Expected behavior

ChromeDriver should receive the text "\n".

Instead the text is empty: "".

@lock
Copy link

lock bot commented Apr 18, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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

No branches or pull requests

2 participants