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. 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

Data types tutorials

  • Unlike other language, VBScript has only a single data type, called a variant. A variant is a very special data type, since it can contain many different types of data and can automatically select the most appropriate data type for the particular context in which it is being used. A simplified view of a variant is that it can hold both string data (characters) and numerical data as well as other data, such as date, Boolean, and object. Internally it is much more complex, which permits it to hold a wide range of different numeric types.


Variant Data Types

  • While the only data type recognized by VBScript is the variant, any item of variant data belongs to a particular type. Let's look at the range of types or the different types of data that a variant can hold:



  • Empty is a type that consists of a single value, also called Empty, that is automatically assigned to new variables when you declare them, but before you explicitly assign a value to them. For instance, in the following code fragment:


Dim var1, var2

var2 = 0


  • The type of var1 is Empty, whereas var2 is only Empty for the brief period of time between the execution of the Dim statement on the first line (which declares a variable) and the assignment statement on the second line. In addition, a variable's type is Empty if it has been explicitly assigned a value of Empty, as in the following code fragment:


Dim var1

var1 = Empty



  • Null is a special type that consists of a single value, also called Null, that is used to indicate that a variable does not contain any valid data. Typically, a Null is used to represent missing data. For instance, a variable called JanSales might be assigned a value of Null if the total of January's sales is unknown or unavailable. This must be done by explicit assignment, as in the statement:


MarSales = Null


  • Because it represents missing data, once a Null value is assigned to a variable, it propagates to any variable whose value results from the value of the original variable. For instance, in the following code


Program to

Sam Sir

' Script to Test Null Data Type

Dim JanSales, FebSales, MarSales, TotalSales

' At this stage, all four variables are Empty


JanSales = 5000

FebSales = 6000

MarSales = Null

' We now have made MarSales Null


TotalSales = JanSales + FebSales + MarSales

' Because MarSales is Null, Q1Sales will also be Null


Print "Jan Sales =" & JanSales

Print "Feb Sales =" & FebSales

Print " Mar Sales =" & MarSales

Print "Total Sales=" & TotalSales


Type above Script and run it.



Explanation of earlier code:-

  • The value of Q1Sales will be Null, since its value results from an expression that also includes a Null value. Because the Null type represents missing or unknown data, this makes sense: if March's sales data is unknown, then any value that wholly or partially results from it, such as the total sales for the first quarter, must also be unknown.



  • The Boolean type can contain either of two values, True or False. The keywords True and False are constants (if you're not sure what a constant is) that are predefined in VBScript, so you can make use of them in your code when you want to assign a Boolean value to a variable, as the following code fragment shows:

var1 = True

var2 = False



  • A Byte is the smallest numeric type available in VBScript. One byte (8 binary bits) can represent 256 integer numbers, ranging from 0 to 255 in decimal or 00 to FF in hexadecimal. Because the Byte is an unsigned data type, only zero or positive integers are valid Byte values. Attempting to convert a value outside this range to a Byte results in a runtime error.



  • An Integer is a whole number that VBscript uses two bytes (or 16 bits) to store in memory. Since one bit is used to represent the sign (either positive or negative), the value of Integer data can range from -32,768 to 32,767. Attempting to convert a value outside this range to an Integer results in a runtime error.



  • A Long is a signed integer that VBscript stores in four bytes (or 32 bits) of memory. This allows it to hold a far greater range of negative or positive numbers than the Integer type; the value of a Long can range from -2,147,483,648 to 2,147,483,647.



  • The three numeric data types that we've examined so far (Byte, Integer, and Long) are all integers; they're unable to represent fractional numbers. Fractions can be handled by a floating-point data type, two of which are available in VBScript. The first is Single, which is an abbreviation for single precision; it represents numbers with about seven digits of precision. Because of the large and small numbers involved, we are forced to specify the ranges as exponential numbers. There are two ranges, one for negative values and one for positive values. A negative single precision value can range from -3.402823E38 to -1.401298E-45, while the range of a positive single precision value is 1.401298E-45 to 3.402823E38. A Single can also have a value of zero.

  • If you need to use a floating-point number in VBScript, there is no reason to use a Single; use a Double instead. Generally, Singles are used because they offer better performance than Doubles, but this is not true in VBScript. Not only are Singles not smaller than Doubles in the VBScript implementation, but the processor also converts Singles to Doubles, performs any numeric operations, and then converts Doubles back to Singles.



  • The Double type stores a double precision floating-point number; basically, it's the industrial-strength version of the Single data type. Its value can range from -1.79769313486232 E308 to -4.94065645841247 E-324 for negative values and from 4.94065645841247 E-324 to 1.79769313486232E308 for positive values. A Double can also have a value of zero.



  • The Date type represents the date or time. If the number holds a date value, the earliest date that can be represented is January 1, 100, and, taking the view that our web sites will be around for a long time, the furthest into the future that we can go is December 31, 9999.

  • A literal date can be defined by surrounding the date with the # symbol. For example:


Dim mJoinDate

mJoinDate = #01/15/1985#

msgbox mJoinDate



  • The Currency type provides a special numeric format for storing monetary values that eliminates floating-point error. Because of this, it, rather than the floating-point types, should be used when working with monetary values. Its value can range from 922,337,203,685,477.5808 to 922,337,203,685,477.5807.



  • The most commonly used VBScript data type isString, which can contain virtually an unlimited number of characters the theoretical limit is the size of the address space, which is two billion bytes on Win32 systems. In practice, though, strings in scripted applications should never be longer than a few thousand bytes at most.



  • This data type contains a reference to an object. TheObject type includes the intrinsic VBScript Err object, as well as objects defined by the Class ... End Class construct. It also represents references to external COM objects instantiated with the CreateObject or GetObject methods. If we view script as the "glue" that binds the services provided by components together, then the Object is the most important data type supported by VBScript.



  • The Error type contains an error number and is typically used to signal a missing argument or other condition resulting from missing data. Typically, Error variants are returned by calls to Visual Basic component methods. VBScript itself does not allow direct creation or manipulation of Error variants.


Pr.Pg border                                              Next Pg