I am currently testing the validation on a login form using Selenium webdriver. I have noticed that while the username field clears successfully, the password field does not clear when using the clear method. Is there something I am overlooking?
it('Password is required', function(done) {
usernameElem.clear();
// The test is being skipped because clearing the password field is not functioning properly.
passwordElem.clear();
loginElem.click();
driver.findElements(By.className('text-danger')).then(elements => {
elements.length.should.equal(2);
elements[1].getText().then(text => {
text.should.equal('Password is required.');
done();
});
});
});