Forum Discussion

rajeshthomas's avatar
rajeshthomas
Contributor
9 years ago

After Upgrading to Test Complete V12, Utilities.FileExists not Working, What is the alternative

Hi,

 

I have upgraded to Version 12 and face up gradation problem in test script. Previously i was using the following script to find whether any bmp image is available in the folder. This was working fine until i upgrade to v12

 

Dim Destination_Files_Name
Destination_Files_Name = "E:\Image\2016-9-21\#TC_0013#\Fail\*.bmp"

   

 If Utilities.FileExists(Destination_Files_Name) Then
          log.Checkpoint("Failed Images created")
Else
       Log.Error("Failed Images Not Created")
End IF

 

The function Utilities.FileExists returns whether bmp image with any name (wildcard) does exists or not.

 

But after upgrading i have to change my coding as below since FileExists is not supported any further in Utilities.

 

Dim Destination_Files_Name
Destination_Files_Name = "E:\Image\2016-9-21\#TC_0013#\Fail\*.bmp"

     

If aqFile.Exists(Destination_Files_Name) Then
          log.Checkpoint("Failed Images created")
     Else
        Log.Error("Failed Images Not Created")
    End IF

 

The aqFile.Exists is not returning value whether any bmp image is available in the folder  when using wildcard (*). Instead it return value only when i give the full Image name with path

i.e.  Destination_Files_Name = "E:\Image\2016-9-21\#CMN_0013_100102#\Fail\AC_50X50.bmp"

 

 

Question:

What function should i use to find out whether the destination folder contains any image or not.

 

Thanks and Regards

Rajesh Thomas

  • AshMan's avatar
    AshMan
    New Contributor

    Try using aqFileSystem.FindFiles.