VBScript Excel Object Model Part-2

VBScript Excel Object Model Part-2 1) Read Test data from Excel file and perform Data driven testing for Login Functionality. And write/export Test Result and Error Message to the same file. Dim objExcel, objWorkbook, objWorksheet, RowsCount, i Set objExcel = CreateObject(“Excel.Application”) Set objWorkbook = objExcel.Workbooks.Open(“C:\Users\G C REDDY\Desktop\January.xlsx”) Set objWorksheet = objWorkbook.Worksheets(1) RowsCount = objWorksheet.UsedRange.Rows.Count objWorksheet.Cells(1, … Read more

UFT Class 30

UFT Class 30 (VBScript File System Operations Part-2, Excel Object Model Part-1) ‘Read Test Data from a Text file and perform Data Driven Testing for Login Functionality. Dim objFso, objTextstream, myLine, myField Set objFso = CreateObject(“Scripting.FileSystemObject”) Set objTextstream = objFso.OpenTextFile(“C:\Users\G C Reddy\Desktop\UFT.txt”) objTextstream.SkipLine Do Until objTextstream.AtEndOfStream = True myLine = objTextstream.ReadLine myField = Split(myLine, “, … Read more