Hi All,
I am testing a web page which has fields on it that have restricted character lengths that are set by javascript.
For example, if a user tries to type more than 10 characters in a field once they get to character 10 they will not be able to type any more characters - no error message appears.
I am stuck on how I would test this using QTP. I need to ensure that it is not possible to type more than 11 characters, how would I go about this?
The code I have written so far is as follows:
The problem I have with this code is that for the 2nd iteration QTP reports the error 'The parameter is incorrect. Line(82): "Browser("Reg").Page("Reg").WebEdit("in_post").Set "XXXX XXXX"&i"
if anyone can help and suggest some other code that would work then i would be very grateful. Thanks.
for some reason I can't edit my post above??
I want to change one line to say:
'I am stuck on how I would test this using QTP. I need to ensure that it is not possible to type more than 10 characters, how would I go about this?'
I am testing a web page which has fields on it that have restricted character lengths that are set by javascript.
For example, if a user tries to type more than 10 characters in a field once they get to character 10 they will not be able to type any more characters - no error message appears.
I am stuck on how I would test this using QTP. I need to ensure that it is not possible to type more than 11 characters, how would I go about this?
The code I have written so far is as follows:
Code:
For i = 9 to 10
Browser("Reg").Page("Reg").WebEdit("in_post").Set "XXXX XXXX"&i
sPost(i) = Browser("Reg").Page("Reg").WebEdit("in_post").GetROProperty("value")
msgbox("Post is now "&sPost(i))
Next
If sPost(10) = "XXXX XXXX10" Then
Reporter.ReportEvent micFail
Else
Reporter.ReportEvent micPass
End If
The problem I have with this code is that for the 2nd iteration QTP reports the error 'The parameter is incorrect. Line(82): "Browser("Reg").Page("Reg").WebEdit("in_post").Set "XXXX XXXX"&i"
if anyone can help and suggest some other code that would work then i would be very grateful. Thanks.
for some reason I can't edit my post above??
I want to change one line to say:
'I am stuck on how I would test this using QTP. I need to ensure that it is not possible to type more than 10 characters, how would I go about this?'