UFT Class 28

UFT Class 28 (VBScript Built in Functions part-2, Many to Many Comparisons Example) 28) CreateObject Function It creates an automation object in a specified class. Examples: Dim objFso ‘Create File System Object, It is used to work with Drives, folders and files. Set objFso = CreateObject(“Scripting.FileSystemObject”) Dim obJExcel ‘Create Excel Application object, It is used … Read more

UFT Class 27

UFT Class 27 (VBScript Built in Functions) 1) Abs Function (It returns absolute value) Dim val val = 100.75 Msgbox Abs(val) ‘100.75 val = 100.25 Msgbox Abs(val) ‘100.25 Msgbox Abs(100.60) ‘100.6 val = -100.85 Msgbox Abs(val) ‘100.85 2) Round Function Dim val val = 100.75 Msgbox Round(val) ‘101 val = 100.25 Msgbox Round(val) ‘100 Msgbox … Read more

UFT Class 25

UFT Class 25 (VBScript Conditional Statements Part-2, VBScript Loop Statements) Usage of VBScript conditional statements 1) Execute a statement when condition is True/Simple if. 2) Execute a block of statements when condition is True. 3) Execute a block of statements when condition is True, otherwise execute another block of statements 4) Decide among several alternates … Read more

UFT Class 21

UFT Class 21 (VBScript Fundamentals and Features) 1) Comments To make the code readable To make the code disable from execution 2) Data Types VBScript supports implicit declaration of Data Types. In VBScript, only data type is Variant. Using VarType function we can check data sub-type Ex: Dim a a =”abcd” a = 123 a … Read more

UFT Class 20

UFT Class 20 (Overview on VBScript) I) Introducing VBScript Visual Basic Scripting Edition > VBScript was launched in 1997 > Vendor: Microsoft > VbScript derived from VB Programming language > VBScript not a case sensitive language Ex: Dim a A = 100 Msgbox a ‘100 > VBScript ignores extra spaces Ex: Dim a a = … Read more