This is script for data driven using excel sheet.
In this script we are not importing excel sheet to datatable.Directly values are supplied to application from excel sheet.
set ex= CreateObject("Excel.Application")
Set a=ex.Workbooks.open("D:\excel.xls")
Set b=a.worksheets("Sheet1")
dim login,pwd
for i=1 to 3
login=b.Cells(i,"A").value
pwd=b.Cells(i,"B").value
msgbox login
msgbox pwd
next
"D:\excel.xls" is path of excel sheet.
"sheet1"indicates sheet name in which values are present.
A,B are column names in excel sheet.
we have excel sheet with values as shown below in d drive.
A B
1 2
3 4
5 6
Data Driven Testing using Notepad instead of datatable
Data Driven Testing using Excel Sheet instead of datatable
d.p to create folder in system
Descriptive Programming to create folder in System.
Set obj=createobject ("scripting.filesystemobject")
Set notepad=obj.createfolder("d:\\abc")
this script will create a folder named "abc" in "d" drive.
d.p to create notepad
script to create notepad and to write in it.
Set obj=createobject ("scripting.filesystemobject")
Set notepad=obj.createtextfile("d:\\abc.txt")
notepad.writeline("hi")
notepad.writeline("welcome to my blog")
VB Script to display a random number from 0-100
Script to display random number from 0 to 100
x=randomnumber.Value(0,100)
msgbox(x)
Subscribe to:
Posts (Atom)