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: CopyFolder?

It copies a folder to a new location.

Syntax: fso.CopyFolder (source, destination[, overwrite])

Arguments:
fso: (Required) The name of a FileSystemObject object previously instantiated.
source: (Required) A character string folder specification, which can include wildcard characters, for one or more folders to be copied. Wildcard characters can only be used in the last path component of the source argument.
destination: (Required) Character string destination where the folder and subfolders from source are to be copied. Wildcard characters are not allowed in the destination string.
overwrite: (Optional) Boolean value that indicates if existing folders are to be overwritten. If True, files are overwritten; if False, they are not. The default is True.

Example:   

Set fso=createobject("Scripting.FileSystemObject")
'Folder to be created SourcePath="D:Folder_create" DestinationPath="D:Destination".
'If the folder doesnot exst then create the folder.
If fso.FolderExists(DestinationPath) = false Then
 fso.CreateFolder (DestinationPath)
End If
fso.CopyFolder  SourcePath,DestinationPath,True
Set fso=nothing

 




Next 5 interview question(s)

1
Method: MoveFolder?
2
Method: DeleteFolder?
3
Method: DriveExists?
4
Method: FileExists?
5
Method: FolderExists?

Comments