Do not have subject.msg box, in fact, i can't type within the field more than 30 characters, as soon as i type up to 30.
Encaixei your code as follows: browser (browser). "" page (page). WebEdit ("City"). "set aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =" webeditlength browser (browser). "" page (page). WebEdit ("City"). getroproperty ("max length") when i set putting in hand 31 characters, quick gives error, that only goes to 30. How do i quick check more than 30?
Anderson, did you try the code Prince gave you?
[ QUOTE ]
WebEditLength = Browser("Browser").Page("Page").WebEdit("city").Ge tROProperty("max length")
[/ QUOTE ]
Can you state what the value of WebEditLength was? If the field has a max_length of 30 you will NOT be able to put in more than 30 characters, your application won't allow it, hence your error from QTP.
A good rule of thumb is to never measure with your thumb.
I have a if you define a function, for example:
If webeditlength = browser (browser). "" page (page). WebEdit ("City"). getroproperty ("max length")
then MsgBox webeditlength ' displays message by placing a maximum of 30 characters.
else the test
<font class="small">Code:</font><hr /><pre>On error resume next
Browser (.).Page (.). WebEdit ("City").Set "Enter a string with 31 or more characters long"
If Trim(Err.Description) = "The parameter is incorrect."&vbnewline Then
On error goto 0
Msgbox "Edit filed is not accepting more than 30 characters"
Msgbox "Edit filed is accepting more than 30 characters"
End If</pre><hr />