Software Testing

1. Software Testing Intro 2. What is Testing 3. Why Software Testing necessary 4. Role of Testing 5. General Testing Principles 6. Types of Software Testing 7. Load,Performance & Stress Test 8. Software Development Process 9. Project/System Life Cycle 10. Difference between terms 11. Manual V/s Automated Testing 12. Economic of Bug/Error/Fault 13. Fundamental Test Process 14. Software Testing Tools 15. Intro.to HP- QTP 16. Installing QTP 9.2 17. Ex.01 Evaluating AUT 18. Ex.01 Answer 19. Ex.02 Learning AUT 20. QTP 9.2 / 10 21. QTP Window Layout 22. Test Object Model 23. Applying Test Object Model 24. Object SPY & Object Properties 25. Designing Test 26. Ex.03 Record & Running a Test 27. Ex.03 Answer 28. Saving a Test 29. Printing a Test 30. App. Record & Run Options 31. Ex.04 Sample Web Site 32. Web Record & Run options 33. Ex.05 Recording a Test 34. Working with Keyword View 35. Keyword View Description 36. Recorded Object Hierarchy 37. Ex.06 Identifying Objects 38. Ex.06 Answers 39. Keyword view columns 40. Microsoft VBScripting 41. Running VBScript 42. Msgbox Function 43. Variable 44. VBScript and QTP 45. Print statement 46. InputBox function 47. Operator Precedence 48. Cint( ) function 49. Data Types 50. VarType( ) Function 51. TypeName( ) Function 52. Cbool( ) Function 53. Cbyte( ) Function 54. Cdate( ) Function 55. CDbl( ) Function 56. Cint( ) Function 57. CLng( ) Function 58. CSng( ) Function 59. CStr( ) Function 60. If Then - End If statement 61. If Then -Else-End If statement 62. If-Elseif-Else-End If Statement 63. Len( ) Function 64. Left( ) Function 65. Right( ) Function 66. Mid( ) Function 67. Ltrim(), Rtrim(), Trim() Function 68. For-Next Statement 69. Array Function 70. ABS( ) Function 71. ASC( ) Function 72. Chr( ) Function 73. Date( ) Function 74. Now( ) Function 75. DateAdd( ) Function 76. Time( ) Function 77. DateDiff( ) Function 78. InStr( ) Function 79. InStrRev( ) Function 80. StrComp( ) Function 81. Lcase( ) Function 82. Ucase( ) Function 83. Rnd( ) & Randomizer 84. Round( ) Function 85. VBScript Procedure 86. Ex.07 QTP Logon App.Script 87. Ex.08 Synchronization 88. Ex.09 Synchronization I/O 89. Ex.10 Output Parameter 90. Ex.11 Create Input Parameter 91. Check Points 92. Ex.12 Add Standard Checkpoint 93. Ex.13 Checking Objects 94. Ex.14 Page Checkpoint 95. Ex.15 Checking Text 96. Ex.16 Checking Tables 97. Ex.17 Parameterization Test 98. Testing Interview Part1 99. Testing Interview Part2 100.Testing Interview Part3 101.Testing Interview Part4 102.Testing Interview Part5 103.Testing Interview Part6 104.Testing Interview Part7 105.Testing Interview Part8 106.Testing Interview Part9 107.Testing Interview Part10 108.Testing Interview Part11
Pr.Pg Next Pg

VBScript Procedures tutorials

  • Procedures are set of executable statements. In VBScript, there are two types of procedures:

    1. Sub Procedures

    2. Function Procedures

Sub Procedures

  • A sub procedure is a series of VBScript statements, enclosed by Sub and End Sub statements which perform actions but do not return a value. A sub procedure can take arguments. If a sub procedure doesn’t receive any arguments, its Sub statement must include an empty parenthesis ( ).

  • The following Sub procedure uses two intrinsic, or built-in, VBScript functions, MsgBox and InputBox , to prompt a user for information. It then displays the results of a calculation based on that information. The calculation is performed in a Function procedure created using VBScript.

 

Sub ConvertTemp( )

Ftemp = InputBox("Please enter the temperature in degrees Fahrenheit.", 1)

MsgBox Ftemp & " Fahrenheit temperature = " & Celsius(Ftemp) & " degrees Celsius."

End Sub

 

Function Procedures

  • A function procedure is a series of VBScript statements enclosed by the Function and End Function statements. A function procedure is similar to a sub procedure but it can return value to the calling function. A function procedure can take arguments (constants, variables or expressions that are passed to it by a calling procedure). If a function procedure has no arguments, it Function statement must include an empty set of parenthesis. A function returns a value by assigning a value to its name in one or more statements of the procedure. Since VBScript has only one base data type, a function always returns a variant.

  • In the following example, the Celsius function calculates degrees Celsius from degrees Fahrenheit. When the function is called from the ConvertTemp Sub procedure, a variable containing the argument value is passed to the function. The result of the calculation is returned to the calling procedure and displayed in a message box.

 

VBScript to test Procedure and Function

Sam Sir

REM VBScript to test Procedure and Function

Sub ConvertTemp( )

Ftemp = InputBox("Please enter the temperature in degrees Fahrenheit.", 1)

MsgBox Ftemp & " Fahrenheit temp = " & Celsius(Ftemp) & " degrees Celsius."

End Sub

 

Function Celsius(fDegrees)

Celsius = (fDegrees - 32) * 5 / 9

End Function

 

Call ConvertTemp( )

Output

 

 

NOTE:-

To get data out of a procedure, you must use a Function. Remember, a Function procedure can return a value; a Sub procedure can not return a value.

A Function in your code must always be used on the right side of a variable assignment or in an expression.

For e.g.

Ctemp = Celsius( FDegrees)

To call a Sub procedure from another procedure, type the name of the procedure along with values for any required arguments, each separated by a comma.

The Call statement is not required, but if you do use it, you must enclose any arguments in parentheses.

The following example shows two calls to the MyProc procedure. One uses the Call statement in the code; the other doesn't. Both do exactly the same thing.

Call MyProc(First Parameter, Second Parameter, ….. )

MyProc First Parameter, Second Parameter, …

 

Notice that the parentheses ( ) are omitted in the call when the Call statement isn't used.

 

VBScript to test Procedure, Function and Call in script

 

Rem VBScript to call function

Test1

 

Function Test1( )

Msgbox ("Function Test1 Called")

End Function

 

 

Rem VBScript to call function with perameter

Test2 " Hello Students "

 

Function Test2( Para1 )

Msgbox ( "Function Test2 Called ") & Para1

End Function

 

 

Rem VBScript to convert Fahrenheit to Celsius

f= InputBox("Please enter the temperature in degrees Fahrenheit .", 1)

MsgBox "The temperature of " & f & " Fahrenheit = " & Celsius(temp) & " degrees Celsius."

 

Function Celsius(fDegree)

Celsius = (fDegree - 32) * 5 / 9

End Function

 

 

Pr.Pg border                                              Next Pg