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.
Contact Our Team