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

It returns a File object corresponding to the file in the specified path. The file object methods and properties can be accessed. See File Object for the file object’s methods and properties.

Syntax: objFile = fso.GetFile(fileSpec)

Arguments:
fso: (Required) The name of a FileSystemObject object previously instantiated.
fileSpec: (Required) The filespec is the path (absolute or relative) to a specific file.

Example:    

Set fso=createobject("Scripting.FileSystemObject")
'File for  getting details  Sourcefile="D:qtptest.txt"
 Set get_file=fso.GetFile(Sourcefile) 
'Some of  the following details can be retrieved from a file.
msgbox  get_file.DateCreated
msgbox  get_file.DateLastAccessed
msgbox  get_file.DateLastModified
msgbox  get_file.ParentFolder
msgbox  get_file.Path
Set fso=nothing

 




Next 5 interview question(s)

1
Method: Close?
2
Method: Read?
3
Method: ReadAll?
4
Method: ReadLine?
5
Method: Write?

Comments