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

It writes a specified number of newline characters to a TextStream file.

Syntax: objTso.WriteBlankLines(numLines)

Arguments:
objTso: (Required) The name of a TextStream Object previously instantiated.
numLines: (Required) The number of newline characters you want to write to the file.

Example:    

Set fso=createobject("Scripting.FileSystemObject")
'Open the file "qtptest.txt" in writing mode.
Set qfile=fso.OpenTextFile("C:qtptest.txt",2,True)
'write contents to the file into two newlines.
qfile.Writeline  "Welcome to the World of QTP"
'will insert 4 new  blank lines.
qfile.WriteBlankLines(4)
qfile.Writeline  "the file name is qtptest.txt"
'Open the file "qtptest.txt" in reading mode.
Set qfile=fso.OpenTextFile("C:qtptest.txt",1,True)
'Read  the entire contents of  priously written file.
Do while qfile.AtEndOfStream <> true
 'Output --> The file will be read file line by line. 
Msgbox  qfile.ReadLine
Loop
'Close the files.
qfile.Close
'Release the allocated objects.
Set qfile=nothing
Set fso=nothing

 




Next 5 interview question(s)

1
Method: WriteLine?
2
Mid Function?
3
Minute Function?
4
Month Function?
5
MonthName Function?


Comments