Ijheri Omitogun
Ijheri Omitogun

Reputation: 1

Web Element sendKeys() adds an extra character no matter what string I pass. How to fix?

I am working in with Selenium 3.14 in java to do UI testing on a login page. My code is trying to send values to an input element named password. Which is the field to input a password. Passing in "1111" will output a five digit string into the input field. It was working fine before but now it won't work at all.

value="1111" browser.findElement(passwordElement).sendKeys(value);

My output is some 5 character string. But the length should be 4

Upvotes: 0

Views: 367

Answers (1)

pburgr
pburgr

Reputation: 1778

element.clear()

before

element.sendKeys()

Upvotes: 1

Related Questions