Learning Something New: 19/07/2018


An investment in knowledge pays the best interest.




Subject: Web Testing 101 - How to test World Wide Web

Topics:
  1. HTML <input> readonly Attribute
The readonly attribute is a boolean attribute.

When present, it specifies that an input field is read-only.

A read-only input field cannot be modified (however, a user can tab to it, highlight it, and copy the text from it).

The readonly attribute can be set to keep a user from changing the value until some other conditions have been met (like selecting a checkbox, etc.). Then, a JavaScript can remove the readonly value, and make the input field editable.

 <!DOCTYPE html>  
 <html>  
 <body>  
 <form action="/action_page.php">  
  Email: <input type="text" name="email"><br>  
  Country: <input type="text" name="country" value="Norway" readonly="readönly"><br>  
  <input type="submit" value="Submit">  
 </form>  
 </body>  
 </html>  


When any application shows: read-only attribute field.

Perform below steps.

a. Open chrome web developer tools 
b. Right-click on the button you want to test, and click "Inspect".  
c. In the developer tools panel, you will now see the html for that field highlighted.
d. Right-click on that highlighted text and choose "Edit as HTML".  An editable text window will open up.  
e. If you see text such as readonly="readonly" delete the attribute.  
f. Click away from the editable field, and see if your button is now enabled. 
g. If it is, click on it, update the values and see what happens in the database.








A note on Security, It's important to remind that even using readonly attribute, you should never trust user input which includes form submissions. Because, it can still be modified with Firebug, DOM Inspector, etc, or they can just submit a HTTP request without using the browser at all. 
Validate to check if there are client Side and Server Side Validations.
Or Provide only the text value of email address.

This entry was posted in ,. Bookmark the permalink.

Leave a Reply