java - How can I check if the show password functionality is working or not in selenium? -
how can check if show password functionality working or not? property of check box should after clicking on 'show password' checkbox confirm test written in password field visible?
this simple logic can implemented based on needs
function togglepassword(checkbox){ if(checkbox.checked == true){ document.getelementbyid("password").type = "text"; }else{ document.getelementbyid("password").type = "password"; } }
<input type="password" id="password" name="passwod" /> <label><input onchange="togglepassword(this)" type="checkbox" /> show</label>
if want use checkbox means
function togglepassword(checkbox){ if(checkbox.checked == true){ document.getelementbyid("password").type = "text"; }else{ document.getelementbyid("password").type = "password"; } }
<input type="password" id="password" name="passwod" /> <label><input onchange="togglepassword(this)" type="checkbox" /> show</label>
Comments
Post a Comment