Micro Focus QTP (UFT) Forums
function/sub loading - 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: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: function/sub loading (/Thread-function-sub-loading)



function/sub loading - stevol - 11-07-2008

Hi,
i write functions/subroutines on .txt files, then i load them through test Settings / Resources and I launch scripts recalling them without problems. The question is: if i want to modify these functions/subs, after the updates i am obliged to re-load them in that tab manually? so if i use same functions/subs in many scripts, i must re-load them for each script created?
Is there any functionality which allows to re-load automatically the functions/subs before every launch?
Thanks in advance for every suggestion

PS: i use QTP_8.2


RE: function/sub loading - MR21135 - 11-07-2008

Hi stevol,
I don't think we need to reload a .txt or .vbs file after any updations.


RE: function/sub loading - stevol - 11-07-2008

Hi MR21135,
if i don't reload file in tab "Test / Settings / Resources" I don't see changes..

es: in .txt I write a sub as:
Code:
Sub abc ()
   msgbox "ciao"
End Sub
and the script is simply "Call abc ()"

If I modify "ciao" with "bye" (obviously without changing filename and filepath) and I re-launch the script, howewer the popup says "ciao" until I reload the file in the tab mentioned above...
I hope there is some property to set in Options, but I don't know which is :-(


RE: function/sub loading - MR21135 - 11-07-2008

Hi stevol,
Here i tried the same as wat you have explained..
1) i wrote a user-defined function in .txt/.vbs file
2) added the file in test settings
3) called the function from action
4) recieved a pop up as expected wen executed
5) now changed the content in the function
6) again exected with the pop up but the message was the one which i edited.

***note i checked in QTP 9.2, But according to my knowledge in this prospect QTP 8.2 and QTP 9.2 works similarly. sorry if i am wrong


RE: function/sub loading - stevol - 11-07-2008

mmhhh... ok, maybe I have understood... if I modify a file with functions/subs loaded on Quality Center, I must close and re-open QTP to see the updates [while with files/scripts on my pc the problem is not present... in my post i had not mentioned Quality Center.. sorry]
Thanks!


RE: function/sub loading - JohnBoy - 12-16-2008

I have had a similar issue and I am using QTP 9.5 with function library files on QC. I have to remove the .vbs file from the resources tab and save, then re-add the same file and save before the changes are visible to QTP. I have not found any other way around this issue.