| |
GeekInterview.com > Interview Questions > Testing Tools > QTP
| Print | |
Question: Give an example of a regular expression,user-defined function and built-in-function? how to make a user-defined function reusable?
|
| January 01, 2006 05:33:09 |
#1 |
| Nageswara Rao G |
Member Since: Visitor Total Comments: N/A |
RE: Give an example of a regular expression,user-defin... |
| Regular Expressions: These r enable QT to identify Objects and Text Strings with varying values.There r so many examples for Regular expressions . plz refer Visual Basic6.0 any reference book.For example, start.* matches start, started, starting, starter, etc. You can use a combination of brackets and an asterisk to limit the search to a combination of non-numeric characters. For example: [a-zA-Z]* User Defined Functions: You can write your user-defined function directly into your test or component if you want to limit its use only to the local action or component, or you can store the function in an associated library file to make it available to many actions and tests or components (recommended). Note that if the same function name exists locally within your action or component and within an associated library file, QuickTest uses the function defined in the action or component. Function MyFuncWithParam (obj, x) dim y y = obj.GetROProperty("value") Reporter.ReportEvent micDone, "previous value", y MyFuncWithParam=obj.Set (x) End Function Built_in Function:QuickTest provides a set of built-in variables that enable you to use current information about the test and the QuickTest computer running your test. These can include the test name, the test path, the operating system type and version, and the local host name. (if u have any queries regarding QTP, plz send gnrao10@gmail.com) |
| |
Back To Question | |