You can also override an existing TO method and we could actually extend a TO class with new methods. Such custom methods will be registered in the same fashion as those which override the existing ones. For example, if you wish to retrieve the comment property of a TO, use the following code:
Print "username: " & Browser("AdvancedQTP - Overriding").Page("AdvancedQTP - Overriding").WebEdit("username").GetTOProperty("miccommentproperty")
Instead of writing this every time, the best practice would be to create a new method, which passes in the properties of the TO and returns the retrieved value.
Proceed with the following steps:
Open Object Repository in which we previously added the objects from our HTML sample page. Enter the following values (or whichever you choose) to their respective comment fields in the Properties pane:
WebEdit("username"): Username WebEdit("password"): Password123 WebEdit("email"): [email protected] WebEdit("tel"): (01)...