Micro Focus QTP (UFT) Forums
How can we call a function stored in another test ? - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: How can we call a function stored in another test ? (/Thread-How-can-we-call-a-function-stored-in-another-test)



How can we call a function stored in another test ? - akhilsoni776 - 08-24-2011

If say our script is stored as Test1 in QTP

And we want to call a function stored in Test1 from Test2.
Is it possible to call such a function ?

As far as i know we can call Action from different test. But is it possible to call function ??


RE: How can we call a function stored in another test ? - parminderdhiman84 - 08-25-2011

Hello,

No, you cannot call a function from another test. All the functions should be written in library file and that library file can be attached to your test from File>>Setting>>Resources

This file is the global file and you can call the functions from this file in any test you want.

Regards,
Parminder


RE: How can we call a function stored in another test ? - akhilsoni776 - 08-25-2011

(08-25-2011, 12:23 PM)parminderdhiman84 Wrote: [quote='akhilsoni776' pid='17739' dateline='1314208702']
If say our script is stored as Test1 in QTP

Hello,

No, you cannot call a function from another test. All the functions should be written in library file and that library file can be attached to your test from File>>Setting>>Resources

This file is the global file and you can call the functions from this file in any test you want.

Regards,
Parminder

Thanks Parminder for your valuable response.