How to use library files in QTP? how we can call these
files in to script?

Answers were Sorted based on User's Feedback



How to use library files in QTP? how we can call these files in to script?..

Answer / uday kumar_anem

We can load the external Library files by using 2 ways:
1. Choose Test > Settings > Choose Resources tab >
Choose + button so select the library file > browse and
select the library file > click Ok.

2. We can load the library files using Scripting:
Use executefile function to load library files.
Example:
executefile "C:\Documents and
Settings\ukumar\Desktop\Sample.vbs"
x=10
y=5
result=SumOfTwoNumbers(x,y)
msgbox(result)


'Code in External Library file(.vbs file).
'Public function SumOfTwoNumbers(a,b)
'Dim sum
'sum=a+b
'SumOfTwoNumbers=sum
'End Function

Is This Answer Correct ?    11 Yes 1 No

How to use library files in QTP? how we can call these files in to script?..

Answer / priyank

add it to resource OR if you required during run-time use
ExecuteFile " ..\absolute path "

Is This Answer Correct ?    3 Yes 1 No

How to use library files in QTP? how we can call these files in to script?..

Answer / chandana

Hi priyank

can u plz explain in detail with validations, it is very
use full for us.

Thank U

Is This Answer Correct ?    2 Yes 0 No

How to use library files in QTP? how we can call these files in to script?..

Answer / pravati

file>>new test>>test name>>test path >> save
file>>new>>function library>>path>>create file>> write script>>save.
for associate file>>setting>>Resources>>associate function library in the test which u want to call the function library>>apply>>ok

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

Can we add the objects of an application dynamically?

2 Answers   KEN Group, LD College,


What are default add-ins in qtp?

14 Answers   Semantic Space,


We developed 100 descriptive programms and put in running, in the midle if any descriptive program is stucked with some error? what will happend weather it will execute the remaining prg's or it will terriminate ?

6 Answers   Kanbay,


QTP identified the object but not performing the desired action???what could be the reason?????

1 Answers   Mphasis,


Write a script to delete the a specific row (say 3rd) in a webtable.

0 Answers  


How we can call the scripit from another scripit in QTP?,Not a call Action

12 Answers  


1.How do u prepare the test suits in QC? 2.How do u convert requirements to test plan in QC?

0 Answers  


What is the ur roles and responsibilities as automation testing engineer?

2 Answers   Atos Origin,


How to export quicktest professional (qtp) results to an .xls file?

0 Answers  


whenever a scenario is recorded ever, it creates a object repository automatically (‘per action’ /local ). we do not need to make them individually…then why we need a shared object repository. How it will be practically utilized ?? your input will be highly appreciated..

5 Answers  


What is the current version of QTP?

19 Answers  


What are the different types of recording modes in qtp? Which will be used when?

0 Answers  


Categories