Library files are containing normal VB Script code.
We can load library files by using 2 ways -
1. Choose Test-Settings-Resources tab-Click on + button - browse and select library file-click OK
2. Use Executefile function to load library files at run time.
When we associate a library file with the test, then all functions with in the library are available to the actions presents in the test.
But when we use executefile function to load a library file, then the functions with in the library file are restricted to a specific action.
Ex: ExecuteFile "FilePath"
Sample Script:
execute file "C:\sample.vbs"
x=10
y=5
result=SumofTwoNumbers(x,y)
msgbox (result)
Code in Sample.vbs -
Public Function SumOfTwoNumbers(a,b)
Dim sum
sum=a+b
SumOfTwoNumbers=sum
End Function
Important Topics & Useful Scripts on QTP. Ask your QTP related questions at this id - asrajaputra@gmail.com
Tuesday, June 3, 2008
Subscribe to:
Post Comments (Atom)
About Me
- RAJAPUTRA
- Hi all,I am Arun Singh Rajaputra. I am working as a Project Lead in a reputed organization in Hyderabad, AP, India. I have little bit knowledge on Quick Test Professional and like to share my knowledge to all through this blog.
Subscribe to get updates on this blog
NOTE
Some of the posts posted in this blog are collected and most of them have been prepared by me. If any one have objections regarding any copied posts. Please mail me so that I can take a necessary action on that post.
No comments:
Post a Comment