Prepare for your Next Interview
This is a discussion on User defined function in QTP library within the QTP forums, part of the Software Testing category; How to put any user defined function in QTP library? Now this function should become inbuilt function and can be used anytime I use QTP. Is this possible? If yes ...
|
|||
|
User defined function in QTP library
How to put any user defined function in QTP library? Now this function should become inbuilt function and can be used anytime I use QTP. Is this possible? If yes then how?
NOTE : [This question was asked by Renu] |
| The Following User Says Thank You to JobHelper For This Useful Post: | ||
| Sponsored Links |
|
|||
|
Re: User defined function in QTP library
Yes this possible..
You have to write the function in a note pad and save it in Test settings >resource tab as an attachment. Then you can call the function in ur program. You can write as many functions as u can in that note pad nas save. Thanks Prasanna |
|
|||
|
Quote:
to make use define function first of all make one script with function and run it in qtp to find logical errors and copy that script and paste it in notepad file with .vbs extention again come back to qtp and load that script using executefile"filepath" u can load this file any where i hope u got the answer if u have any query please consult me |
| The Following User Says Thank You to ramugogurla For This Useful Post: | ||
|
|||
|
Re: User defined function in QTP library
Hi Prasanna,
A very good thing you have mentioned in your above post. But i don't think this is the reply to the post. The approach you said is "adding a user defined library function or functions to your script." We can have a library file and we can use it at any time. But now my concern is how can we make a permanent function like "MsgBox". We can use it in any script, no need to attach any file. are you getting me,.. I think there might be some approach for creating any ".dll" file and to register.. I hope people will come up with any idea for this post. Let me know if i am wrong. Thanks, Jitu |
| The Following User Says Thank You to jitendramishra For This Useful Post: | ||
|
|||
|
Re: User defined function in QTP library
Hi All,
There is an alternate way to make available a user defined function for all tests (as a build-in function). This approach doesn’t require a function library to be associated to a test. We need not to work with .vbs files and execute or include them in our QTP script either. This is a good approach but could be risky. We can copy our function definition (in VBScript) to common.txt file in Program Files\Mercury Interactive\QuickTest Professional\dat\BPT_Resources. We may even register this function to a windows or web object. Be careful not to change any other content from the text file. This is a text content, but it contains the definitions of the built-in functions for QTP. Don’t do it if you don’t know VBScript coz if you change any other content from the file knowingly or unknowingly, you should be able to correct the changes. It is better to keep a copy of the original file before you copy your function definition into the file… just in case. After you copy your function definition, save and close the file. Close QTP and restart it again. Now, your user defined function should be available for all tests as a built-in function.
__________________
Lack of WILL POWER has caused more failure than lack of INTELLIGENCE or ABILITY. -sutnarcha- |
|
|||
|
Re: User defined function in QTP library
prasanna.sabat ,
If I have a function "test" in a file which saved as myfunctiontest.vbs and loaded to test|Setting|Resource, How do I call the function? |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Pre-defined and post-defined value | JobHelper | Seibel | 0 | 12-30-2006 04:51 PM |
| Rules for user defined words | Bessie | MainFrame | 1 | 10-09-2006 04:04 PM |
| Why are Levels defined like this | GregMark | MainFrame | 0 | 10-01-2006 05:33 PM |
| How do you Implement Class Library Object | GeekAdmin | VB.NET | 0 | 05-28-2006 11:14 AM |
| Explain about .NET Framework Class Library | GeekAdmin | VB.NET | 0 | 05-17-2006 11:47 PM |