QTP code to check if a txt file is available or not, if not creating the File

Below is the code for QTP to check if a txt file is available or not, if not creating the File
strDirectory="D:\"

strFile="Scripting.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(strDirectory & strFile) Then
Set objFolder = objFSO.GetFolder(strDirectory)
Else
Set objFile = objFSO.CreateTextFile("D:\Log.txt")
End if
QTP code to check if a txt file is available or not, if not creating the File QTP code to check if a txt file is available or not, if not creating the File Reviewed by Animesh Chatterjee on March 24, 2010 Rating: 5

No comments:

Powered by Blogger.