Micro Focus QTP (UFT) Forums

Full Version: How to save files with dynamic file names??
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
After creating a script I want to save it, so I clicked on "Save As" from "File" menu then a window appeared and asked me to enter a file name to save. my question is how we can give the file name dynamically instead of giving static file name like"file1 or file2 etc..)?

Please help me out this question
what exactly you mean by a dynamic file name. would you like to elaborate your query for what exactly you want to do?
dynamic names means when to save a file , it will ask you to give a suitable name for ex; file1, file2...etc. my question is we have to write such a script that it will automatically generate a unique name and save the file with this name. no need to give a file name manually enter through keyboard..
Code:
Dim mt,mdt
mt=Time
mdt=Date
rndm=mdt&"_"&mt
rndm=Replace(rndm,"/","_")
rndm=Replace(rndm,":","_")
use rndm variable for your file name