Automation testing QTP with VB Script functions Interview questions


Total available count: 68
Subject - Software Testing
Subsubject - Automation testing QTP with VB Script functions

Method: FileExists?

It determines whether or not a specified file exists.

Syntax: fso.FileExists (filespec)

Arguments:

fso: (Required) The name of a FileSystemObject object previously instantiated.

filespec: (Required) The name of the file whose existence is to be determined. A complete path specification (either absolute or relative) must be provided if the file isn't expected to exist in the current folder.

Example:  

Set fso=createobject("Scripting.FileSystemObject")
'The file to check the existence
filepath="D:qtptest.txt"
If fso.FileExists(filepath) then
msgbox  "File Exists"
Else
Msgbox "File doesnot Exist"
End If
Set 
fso=nothing

 




Next 5 interview question(s)

1
Method: FolderExists?
2
Method: GetDrive?
3
Method: GetFolder?
4
Method: GetFile?
5
Method: Close?

Comments