Can we add the function library directly from scripting in
qtp instead of adding from resource tab?

Answers were Sorted based on User's Feedback



Can we add the function library directly from scripting in qtp instead of adding from resource tab..

Answer / nath .t

Sorry for the small mistake in the above answer.



Set qtApp = CreateObject("QuickTest.Application")

qtApp.Launch

qtApp.Visible = True

qtApp.Open "C:\Tests\Test1", False, False

qtApp.Test.Settings.Resources.Libraries.Add "e:\Utils.vbs"

Is This Answer Correct ?    8 Yes 2 No

Can we add the function library directly from scripting in qtp instead of adding from resource tab..

Answer / nath .t

through script we can do

executefile "give the path"
Ex: executefile "d:\functionlibrary.vbs"

another way we can add to our script is AOM(Automated
object model)

first of all create Quick Test object than we can add with
that object.

Ex:
qtApp.Test.Settings.Resources.Add "Path of the library file"

like this we can add.

Is This Answer Correct ?    5 Yes 1 No

Can we add the function library directly from scripting in qtp instead of adding from resource tab..

Answer / pikkilimadhu

Executefile "filepath.qfl" (we can do with qfl,vbs,txt extensions in this method)

loadfunctionlibrary "filepath.qfl" (we can do only qfl extension in this method)

Is This Answer Correct ?    0 Yes 0 No

Can we add the function library directly from scripting in qtp instead of adding from resource tab..

Answer / mohit

Naren,
Seems like u need to learn that adding a library and executing a library are two different tasks. In a laymen language, (that u seems to b more suitable for u) the difference is exactly what is in between loading a gun with bullets and firing the bullets. If u add something to ur resources, u may or may not use it in future. But when u execute something.. u command the control to execute it then and there without knowing even it is needed or not. So come prepared next time when u post something. Gud Day!

Is This Answer Correct ?    0 Yes 3 No

Can we add the function library directly from scripting in qtp instead of adding from resource tab..

Answer / naren

Hi Nath,

Please understand the questions first no hurry. Execute File
is the correct answer then again what is the need for adding
OR through scripting. Function Library means user defined
function(x.vbs) so Execute file is enough. The question does
not ask about adding Object Repository through scripting.

Is This Answer Correct ?    1 Yes 10 No

Post New Answer

More QTP Interview Questions

Hi, Can anyone tell me what type questions can be ashed in interview on QTP?

1 Answers  


Explain calling sub procedure.

0 Answers  


WHAT IS A TEST STRATEGY & WHAT IS THE DIFFERENCE BETWEEN TEST STRATEGY & TEST PLAN?

21 Answers   ABM, AZTEC, CTS, Infosys, Nihilent, Orange,


How did you use regular expressions in QTP and also in WR?

0 Answers  


In QTP, If you have list of checkboxes, how can i select a particular checkbox and delete if the checkboxes are changing dynamically?

0 Answers  






Hi Guys, I tried to install java add-in for QTP 9.5 after the whole installation but it didn't install but then i also found in documentation saying that winrunner7.6 patch for java plugin would work fine with QTP. But when i tried to install from winrunner7.6 it asks me for the path of winrunner So my question is are we supposed to install winrunner for java add in to work on QTP. Please suggest me

1 Answers  


What's QuickTest Window?

1 Answers  


I am a new tester that needs to create an automatic script involving security questions. On a webpage I need to select a security question(which are random) from a drop down menu, and then input the answer as the last word from the security question. I have the script set-up to automatically select the first security question from the drop down. The problem I am having is trying to insert the security answer. How do I insert the security answer based on the selection from the security question?

0 Answers  


What are metrics and matrix?

0 Answers  


What are the methods used in UFT to handle exceptions or run-time errors?

0 Answers  


How to attach a file to TD?

0 Answers  


Hi I am new to QTP. we are planning to implement automation for the application. I am trying to execute the following script: Set ExcelObj=CreateObject ("Excel.Application") ExcelObj.WorkBooks.Add Set NewSheet=ExcelObj.Sheets.Item(1) NewSheet.Name="Order" ExcelObj.Cells(1, 1).Value = "Name" ExcelObj.Cells(1, 2).Value = "Ordernum" ExcelObj.Cells(2, 1).Value = "nam" ExcelObj.Cells(2, 2).Value = "21" ExcelObj.ActiveWorkbook.SaveAs "c:\test1.xls" ExcelObj.Quit Set ExcelObj = Nothing in the above script for the line(ExcelObj.Cells(2, 2).Value = "21") it is inserting the value 21 successfully.this is fine But if i want to insert a variable instead of the constant value then what should be the modification in the script. For example: If user retrives a value throug "GetRoProperty" and wants to insert the value into then how the script changes?

1 Answers  


Categories