Micro Focus QTP (UFT) Forums
Search All Test scripts For a Function? - 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 Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Search All Test scripts For a Function? (/Thread-Search-All-Test-scripts-For-a-Function)



Search All Test scripts For a Function? - AndyBSG - 02-13-2015

Guessing this one is going to be very simple but I can't seem to find it anywhere!

I have created several scripts now, all in the same directory.

There's been a couple of occasions where i've renamed a function or i've written a bit of code in a script then realised that I need the same code in another script but can't remember which script I did it in.

This has forced me to manually check all my scripts to find the references to the relevant fucntion or code. Is there an option in QTP to let me search through ALL of my scripts for a certain text string?

For example, I know I created a script that uses a variable called 'strTelNumber' and I know that variable only appears in one script but I don't know what the script's called so can I just search my entire script library for that string?


RE: Search All Test scripts For a Function? - supputuri - 02-19-2015

As per my knowledge we don't have any such feature in QTP/UFT. However you can develop a program by your self to meet this this requirement.
Finding Text:
Just read through the .mts files in the directly and find the text in each file

Functions List:
Go through all .mts files and read the lines start with "Function " (don't forget to use ltrim)

Please let me know if you need any more help on this.