Thursday, February 15, 2007

Finding the Text box maximum length by one click

If the Webpage you are testing contains a form fields with text boxes then, if you need to perform the boundary value analysis testing for the text box and validations for the text box use the following javascript




javascript:var x=document.getElementsByTagName('input');myVals='';for (var i=0;i

2 comments:

SATS said...

(javascript:var x=document.getElementsByTagName('input');myVals='';for (var i=0;i<=x.length;i++){z=x[i].getAttribute('type');if(z=='text' || z=='password')myVals=myVals+'ID attribute: '+x.item(i).id+'\n'+'Name attribute: '+x.item(i).name+'\n'+'Maxlength: '+x[i].getAttribute('maxlength')+('\n\n')};alert(myVals))

Pradeep Soundararajan said...

Thanks for adding my blog link to yours. I request you to name it as Pradeep Soundararajan or Tester Tested and not as Rajan!

Kindly delete this comment as it is irrelevant to the topic and I could not find an e-mail to get in touch with you.

Thanks!