UFT Framework Driver Script

UFT Test Automation Framework Driver Script
Dim objExcel, objWorkbook, objWorksheet
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\Documents and Settings\G C reddy\Desktop\Proj_Automation\TestResults\Results1.xls")
Set objWorksheet = objWorkbook.Worksheets(1)

i= 2

'Login Test
objWorksheet.Cells(i, 1) = "Login Operation"
objWorksheet.Cells(i, 2) = Login("abcd", "mercury")
Call Close_App()
i= i+1

'Open Order
objWorksheet.Cells(i, 1) = "Open Order"
Call Login("hyderabad", "mercury")
objWorksheet.Cells(i, 2) = Open_Order(5)
Call Close_App()
i= i+1

'Update Order
objWorksheet.Cells(i, 1) = "Update Order"
Call Login("delhi", "mercury")
objWorksheet.Cells(i, 2) = Update_Order(3)
Call Close_App()

objWorkbook.Save
objExcel.Quit

Set objWorksheet = Nothing
Set objWorkbook = Nothing
Set objExcel = Nothing

UFT Framework Initialization Script

Dim objQTP
Set objQTP = Createobject("QuickTest.Application")

objQTP.Visible = True 'To view the Tool during execution

objQTP.Launch 'To open UFT Tool

objQTP.Open "C:\Documents and Settings\G C reddy\Desktop\Proj_Automation\Drivers\Driver1"
objQTP.Test.Run
objQTP.Test.Close

objQTP.Quit 'To close the Tool
Set objQTP = Nothing 'To release the memory

0 comments:

Post a Comment