How do we call Library Files(.vbs) in the Test Script

Thanks in Advance...


Answers were Sorted based on User's Feedback



How do we call Library Files(.vbs) in the Test Script Thanks in Advance... ..

Answer / raj

We can use ExecuteFile statement to call vbs files.

Syntax : ExecuteFile <filepath>

Is This Answer Correct ?    1 Yes 0 No

How do we call Library Files(.vbs) in the Test Script Thanks in Advance... ..

Answer / sreekanth chilam

Calling of Library Files can be done in two ways:

1.Loading(Calling)the Library Files in design Time:
In QTP 8.2
Test Menu --> Settings--> resources tab --> click "+"
Button & browse the required file & click Apply.
Now the library file has been associted with entire
(Current)test.(This entire process is done before run time
i.e during design time ).

so all the Actions contained in the test can access the
functions written in the .vbs files.


2.Loading the Library Files during the Run Time:

By using th ExecuteFile Statement.

Syntax:ExecuteFile "../.../../../.vbs filepath"

Here in which action the above statement is given ..in to
that action only the .vbs file will be loaded/called.. but
not to all actions contained in the Test.

During Run time , executefile statement loads .vbs file
into the current action of the test.

Is This Answer Correct ?    1 Yes 0 No

How do we call Library Files(.vbs) in the Test Script Thanks in Advance... ..

Answer / ram.polavarapu

we need to associate file to qtp and
call function name


executefile "path.vbs"

Is This Answer Correct ?    1 Yes 0 No

How do we call Library Files(.vbs) in the Test Script Thanks in Advance... ..

Answer / k.sai krishn reddy

u can add library file to ur script through Test-----------
-->Resources tab here u find option called add file there u
can add ur files manually before running the script then
save it so when ever u open that script attached lib files
also opened with that script.
i hope this will satisfy.

Is This Answer Correct ?    0 Yes 0 No

How do we call Library Files(.vbs) in the Test Script Thanks in Advance... ..

Answer / uday

Associating a function library can be done in many ways.
Putting all the above valid answers here.

1. Open QTP -> Click on File menu -> Settings -> Resource ->
Choose the file path of the function library.
(Manual way of associating a function library)

2. ExecuteFile "FilePath".
If you use in an action, then the functions in function
library are available on that action only, other actions
cannot access the functions in function library.
Another disadvantage is, the function pointer will not go
into the function library when you debug the script.

3. LoadFunctionLibrary(From QTP 11), which will load the
function library at run-time.

4. Using AOM.

Thanks,
Uday
http://qtpftvideos.blogspot.com/

Is This Answer Correct ?    0 Yes 0 No

How do we call Library Files(.vbs) in the Test Script Thanks in Advance... ..

Answer / sri satya

By using script, we can add in this way also:

path1="C:/Lib1"
path2="C:/Lib2"
Set qtLibraries =
qtApp1.Test.Settings.Resources.Libraries ' Get the
libraries collection object

qtLibraries.Add path1 ,1
qtLibraries.Add path2 ,2

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More QTP Interview Questions

Explain types of exception handling and script for that?

2 Answers  


How do you script a nested loop in QTP? I am showing a snipet of my code. Any suggestions to help me get this to work would be great appreciated! STEP A - Customer Number: No loop - ISBN: Loop STEP B - Customer Number: Loop - ISBN: Nested Loop Here is the code I am using now. I am using i for the loop and j for the nested loop in STEP B of my script. =========================================== 'CREATE AN ADDITIONAL CUSTOMER Dim myNum, RowNum, RowCnt2, val2, total, i DataTable.ImportSheet "C:\QOE Data - UAT1.xls" ,"Data" ,"Global" RowCnt2 = DataTable.GetRowCount i = 1 DataTable.SetCurrentRow(i) ' Set row to one Do while Not i > RowCnt2 i=i+1 DataTable.SetNextRow MsgBox Datatable.Value("Customer_Num") Msgbox i Msgbox RowCnt2 If Not i > RowCnt2 then val2=datatable.Value("Customer_Num","Global") OracleFormWindow("Sales Order").SelectMenu "File->New" OracleFormWindow("Sales Order").OracleTabbedRegion("Order Information").OracleTextField("Customer Number").SetFocus OracleFormWindow("Sales Order").OracleTabbedRegion("Order Information").OracleTextField("Customer Number").Enter val2 End If 'CREATE SECOND ISBN LIST DataTable.ImportSheet "C:\QOE Data - UAT1.xls" ,"Data" ,"Global" Dim j, RowCnt3, val3 RowCnt3 = DataTable.GetRowCount For j = 1 To RowCnt3 DataTable.SetCurrentRow(i) ' datatable.getSheet("DataTable").setNextRow If Trim(DataTable("ISBN",dtGlobalSheet)) = "" Then j = j - 1 Exit For End If Next 'Define ISBN rows If RowCnt3 <> j Then RowCnt3 = j End If 'Loop through ISBN rows For j = 1 To RowCnt3 DataTable.SetCurrentRow(i) val3 = Datatable.Value("ISBN","Global") msgbox j If j = 1 Then OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item").SetFocus OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item").Enter val3 else If j < 16 Then OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_"&i).SetFocus OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_"&i).Enter val3 else If RowCnt1 => 16 Then OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_15").SetFocus OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_15").InvokeSoftkey "DOWN" OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_15").SetFocus OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_15").Enter val3 end if end if End If Next 'EXIT APP msgbox i loop Browser("Browser").Page("Oracle Applications 11i").Sync Browser("Browser").Close ========================================== It isn't working correctly in my nested loop in STEP B (for ISBN). Any ideas?? Thanks! SBsteve

0 Answers  


what type of run time errors you get while you ar edoing rpg program?

0 Answers  


Is QTP a compiler or interpreter..? can you we execute a QTP Script file in a another system which does not have QTP installed..??

6 Answers   Virtusa,


What types of testing comes under functional testing or in other word what will you test in functional testing?

3 Answers   Infosys,






How can I test the unix shell in QTP

2 Answers   Persistent,


Which function is used to accesses the Properties from Repository Pls anybody can give the answer.. Thanks in advance...

2 Answers   Navis,


What is the limitation to XML Checkpoints?

1 Answers  


in how many ways you perform batchtesting?

2 Answers   Sapient,


What is action?

0 Answers  


write a script to verify the image path(src property) of the images which are in web pages.

0 Answers  


When you are running a batch test of 5 scripts and in 2nd script appln crashed, what hpns then?

4 Answers   BirlaSoft,


Categories