Like us on Facebook

Showing posts with label VB Script for QTP/UFT. Show all posts
Showing posts with label VB Script for QTP/UFT. Show all posts

June 11, 2015

How to import excel sheet in QTP or UFT during runtime ?

June 11, 2015
Why do we need to import excel sheet ,when we can make use of in-built data table.
Well,it has always been cumbersome when we deal with large amount of test data.
It become very tough to manage test data in UFT's data table if size of test data
grows or varies all the time.

February 8, 2015

How to Open/Read/Write/Appened a File through FileSystemObject using VB Script

February 8, 2015
We shall use File System object to open a File and read its content through 'Read','ReadAll'
and  'ReadLine' methods of a File, opened in Reading mode.
We can open a file in three different mode for reading ,writing and appending.Const is a reserved
keyword in VB Script which is used to declare constant variables in script.OpenTextFile 
is method of FileSystemObject which is used to open files.

1.'Example of Read method of File object, Read Method takes parameter as number of
specified characters that should be read

FileSystemObject(UFT/QTP):Access File through VB Script


'##################################################################
'Working with Files through FileSystemObject in VB Script  for QTP/UFT
'Author: Vikas
'##################################################################
'1.Working with Files in VB Script

'1.1 How to create a text file  in QTP/UFTusing VB Script(Visual Basic Script) ?

Dim objFso,objFile
Set objFso=CreateObject("Scripting.FileSystemObject")' Fso object can be used to 
operate over both Files and Folder
'CreateTextFile method of File object creates a new  text file ,other parameter "True"
 is used to overwrite the exisitng file having same name
Set objFile=objFso.CreateTextFile( "D:\Music\myTextFile.txt",true)
'Output :

.
© 2014-2015 Informational Digit : How-To & Tech Guides. The content is copyrighted to Vikas Pandey and may not be reproduced on other websites. WP themonic converted by Bloggertheme9.
TOP