How can we apply assertion in a sahi script to check whether password field is showing masked value? For example, **********
Asked
Active
Viewed 899 times
2

Kevin Brown-Silva
- 40,873
- 40
- 203
- 237

user1663767
- 21
- 1
1 Answers
1
Get the type attribute from the input and check that it is equal to "password":
_assertEqual(_textbox("myTextBox").getAttribute("TYPE"), "password")
EDIT: To avoid confusion and based on Narayan's comment below, the correct way to do this is actually:
_assertExists(_password("id"))

infojolt
- 5,244
- 3
- 40
- 82
-
1Psych, the password field won't be identified as _textbox. If the type is password, it will be identified as _password. So checking _assertExists(_password("id")) is enough. – Narayan Raman Sep 13 '12 at 04:35