Function is a group of methods and instruction and it can be access by calling that function.
User defined functions can be coded as part of QTP files or can be coded as separate ".vbs" files.
These can be associated as library files under Run Settings. This would enable you to create a library functions which can be used across scripts as and when required.
Example for User Defined Function for WebEdit Class:
Public function edit(name) 'Defining the function
Browser("BrowserName").Page("PageName").WebEdit("User ID").set name
End Function
Call edit("rajaputra") 'Calling the function
No comments:
Post a Comment