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
clearValue is not clearing input type=password field #1592
Comments
Never had those issues and actually still wondering why so many else facing this. |
@davidlinse setValue does not remove current value in the field, that's actually very inconvenient as you need to use clearValue every time. |
if you set value before clear it and re-set it again it will work
|
@farhadf246 thanks a lot it worked fine 😀😀 |
Seems to not working anymore (since a chromedriver update)? :( |
Is this working again? I get connection refused errors from java. |
not working also, any update?
Found a work around from #701 thanks to @minyanghbc
to clear them use this code
hopes that works for you all |
I use a function to get a working "clearValue" /**
* A better `clearValue` for inputs having a more complex interaction.
*
* @export
* @param {string} selector
* @returns
*/
exports.command = function clearValue2 (selector) {
const { RIGHT_ARROW, BACK_SPACE } = this.Keys
return this.getValue(selector, (result) => {
const chars = result.value.split('')
// Make sure we are at the end of the input
chars.forEach(() => this.setValue(selector, RIGHT_ARROW))
// Delete all the existing characters
chars.forEach(() => this.setValue(selector, BACK_SPACE))
})
} |
This issue has been automatically marked as stale because it has not had any recent activity. |
👍 |
I've been trying to adopt workarounds suggested by @MonrealRyan and @MartinX3, and I've noticed that // for solution by MonrealRyan
.setValue('input[type=password]', ['', [browser.api.Keys.CONTROL, "a"]])
// for solution by MartinX3
const { RIGHT_ARROW, BACK_SPACE } = this.api.Keys |
// Google Chrome 87 |
Hi, I just checked issues and there is no any resolutions to similar issues.
My problem is following, I have emails and password field, the code is:
But what I have is that email field is got cleared and new value inserted, but for password field it just appends value and not clearing default one.
The text was updated successfully, but these errors were encountered: