AscentialTest Support Hub

Reusable test to ve…

 

Notifications

Clear all

Reusable test to verify a fields maximum length



1

Posts


1

Users


0

Reactions


34.9 K

Views

(@blesuer)
Member Admin

Joined: 4 months ago
Posts: 33

Topic starter
 

This is a reusable function that can be used to verify the maximum field length of your edit fields regardless of the target application’s platform. Provide the full object name of the field to be verified along with its expected maximum field length. An error will be raised if the maximum field length is shorter or longer than the expected max field length.

[-] VerifyMaximumFieldLength (AppObject FieldName, Integer FieldLength)
[ ]
[ ] String TestString = “”
[ ]
[ ] TestString = String.Replicate(“a”,FieldLength)
[ ]
[ ] FieldName.SetText (TestString + “x”, false)
[ ]
[ ] FieldName.VerifyValue(TestString)

Usage: VerifyMaximumFieldLength (MyDialog.MyTextField, 8)

If you include this function in your project, it will show up automatically in the Actions Explorer in the ‘User Defined folder’ so that you can easily drag it into your steps.



   

Quote

Share:

Can’t Find An Answer in the Forum?

Contact Our Team