Tuesday, October 16, 2012

Step Generator

Step Generator

Step Generator is a feature of QTP, library of functions, used for generating the recordable and non recordable steps.

Insert Menu > Step Generator
Shortcut - F7

User needs to select Category ( test object, utility object, functions) and required object or the function library. We can then select appropriate operation (Method, property or function) and define argument and return values, parameterizing them if required.

Step generator can be open from Keyword View, Expert View and Active screen.

Thursday, September 20, 2012

Factorial Function

'Factorial of number


Function factorial(no)

Dim fact
fact=1

For i=1 to no

fact=fact*I

Next

factorial=fact

End Function

num=inputbox("Enter number")

msgbox "Factorial is" &factorial(num)

Friday, September 14, 2012

String is palindrome or not

'string is palindrome or not
str=Inputbox ("enter string")
revstr=strreverse(str)
If str=revstr Then
    msgbox "string is palindrome"
else
    msgbox "string is not palindrome"
End If

Find Square of Number

' Program to square of number
num=inputbox ("Enter number","Square of number")
square=num*num
msgbox "Square of number is " &square

Example of LCASE function- “AuTOMatIon123_!@#” and 'convert all the upper case letter to lower case like “automation123_!@#”.


'Write a program that mimics the functionality of LCase function.
' For example, your program should take any variable like “AuTOMatIon123_!@#” and
'convert all the upper case letter to lower case like “automation123_!@#”.

'Code
Str = InputBox("String to be lowered")
diff = Asc("a") - Asc("A")

For i = 1 to Len(Str)
If Asc(Mid(Str,i,1))<=Asc("Z") And Asc(Mid(Str,i,1))>=Asc("A")Then
    If Asc(Mid(Str,i,1)) = Asc(" ") Then
    StrLower= StrLower + Mid(Str,i,1)
    End If
    temp= chr(Asc(Mid(Str,i,1))+diff)
    StrLower= StrLower+temp
Else
    StrLower= StrLower + Mid(Str,i,1)
End If
Next
MsgBox StrLower
'End Code

Reverses the order of words (not characters) in a sentence -“Good Morning Everybody” to “Everybody Morning Good”


' Write a program that reverses the order of words (not characters) in a sentence.
'For example, the program should change the sentence “Good Morning Everybody” to “Everybody Morning Good”

StrPR2 = InputBox("String to be Reversed")
SplitStr= Split(StrPR2)
For i = UBound(SplitStr) to 0 Step -1
StrRev=StrRev+" "+SplitStr(i)
Next
MsgBox StrRev

Program to display output in format V, B, S, c,r,i,p,t


'Given a string, write a program that finds out all the characters that constitute the string.
' Example – If the string is VBScript, the output (using a msgbox) should be in this format
' The string VBScript contains variables – V, B, S, c, r, i, p, t

Dim str
str = InputBox("Enterr string to be reversed","Trupti's trial prog")
iLen = Len(str)
For i =1 to iLen
temp=Mid(str,i,1)
RevStr= RevStr+temp+","
Next
msgbox "Reverse string example" &RevStr

VBScript - Working with Array

'Working with Array
' Dim keyword used to define array
' Redim keyword used to size or resize the arry
' Preserve optional- used to preserve the data in exisiting array, while you resize it
' Array Function
'Array(arglist) - use to define the array arguments
Dim arr1
arr1=Array("Sunday","Monday","Tuesday","Wedseday","Thursday","Friday","Saturday") ' first way of declare array with elements

'UBOUND() upperbound of array
msgbox "Upper bound of Array is " &UBOUND(arr1)
For i=0 to UBOUND(arr1)
        msgbox arr1(i)
Next

'LBOUND() lowerbound of array
msgbox "Lowerbound of Array is " &LBOUND(arr1)

'ISARRAY  function indicates whether a specific variable is array or not
Dim Var
Dim isarr(3) ' second way of declare array with given upper value and assign value to array elements
isarr(0)="one"
isarr(1)="Two"
isarr(2)="Three"
var=isarray(isarr)
msgbox "Isarr is variable is array or not" &var

Dim withoutupperlimitarr() ' declare array with no upper limit
var=IsArray(withoutupperlimitarr)
msgbox "withoutupperlimitarr is variable is array or not" &var

'Erase statement is used to empty array
Erase isarr
For i=0 to UBound(isarr)
    msgbox isarr(i)
Next

'Join() function joins substrings of an array into one long string with each substring separated by delimiter
'Join (list,[delimiter])
Dim a
Dim Joinex(3)
joinex(0)="This"
joinex(1)="is"
joinex(2)="join"
joinex(3)="example"
a=Join(joinex)
msgbox "Join string without delimiter" &a
a=join(joinex,",")
msgbox "Join string with delimiter" & a

'Split function returns a zero based , one dimenensional array containing a specified number of substring
'Split (expression, [,delimiter],count[,compare]) 0 means binary compare and 1 means text compare
Dim str,myarr, i
str="split * function* example"
myarr=split(str,"*",-1,1)
For i=0 to ubound(myarr)
    msgbox myarr(i)
Next

'Filter function returns zero based array containing a subset of a string array based on criteria specified
'Filter (inputstring, value,[,include[,compare])
'input string and value are required fields
' if include set to True return the subset of array contains the value as substring
' if include set to False then filter return the subset of the array that does not contains value as substring
a=Array("Apple","Orange","Banana","Olive","Apricoat")
b=filter(a,"A",True)
For each x in b
    msgbox "it shows all items containing A" &x
Next
c=filter(a,"A",False)
For each x in c
    msgbox "it shows all items NOT containing A" &x
Next
'Program to find the array elements start with A

Wednesday, September 12, 2012

String Functions in QTP

'string functions examples
' LTRIM() Left space remove function
str1="           Remove left space"
msgbox Ltrim(str1)

'RTRIM() Right space Remve function
str2="Remove right space              "
msgbox Rtrim(str2)

'Trim() Remove left and right space
str3= "       Remove left and right space           "
msgbox Trim(str3)

'LEN() to find the length of string function
str4= "find the length of string"
msgbox "Length of string is " &Len(str4)

'LCASE() UCASE() upper and lower case letter function
str5="AutoMATion word in Lower and UPPER case"
msgbox "in lowercase later"  &LCASE(str5)
msgbox "In uppercase later" & UCASE(str5)

'InStr function helps you determine if a smaller string is present in a bigger string or not.
'If a match is found, this functions returns a number that represents the position at which the match is found
sBigString = "Automation Repository"
sSmallString = "on Rep"
'Start match from 11th character
iReturnVal = InStr(11, sBigString, sSmallString, 1)
'From the above statement iReturnVal will have value 0 because we are matching from 11th character.
'So effectively, we are trying to find "on Rep" in "Repository"
msgbox "result of instr function" &iReturnVal

'InstrRev() function
iReturnValRev=InStrRev(sBigString, sSmallString)
msgbox "result of InStrRev function" &iReturnValRev

'Left function to find out a specified number of characters from the left of a string. Syntax: Left(String, Length)
Dim sMainString, sLeftString
sMainString = "Orange"
sLeftString = Left(sMainString, 2) 'Get the first two characters from the left of the string
msgbox  "Displays the value Or" &sLeftString

'Right function retrieves the specified characters from the right side of the string. Syntax: Right(String, Length)
sRightString = Right(sMainString, 2)
msgbox  "Display the value ge" &sRightString

'splits a string using a delimiter and returns a number of sub-strings stored in an array
'Syntax: Split(String, Delimiter(optional), Count(optional), Compare(optional))
sText = "Yes,No,Maybe"
sDelimiter = "," 'Delimiter is comma (,)
'Split the text using the delimiter. 'arrArray' is the array in which the fucntion Split will store the sub-strings
arrArray = Split(sText, sDelimiter)
'arrArray(0) contains the value Yes. arrArray(1) contains the value No and  arrArray(2 contains the value Maybe
'Display the sub-strings in a msgbox
iLoop = UBound(arrArray) 'Find trhe size of the array
For i = 0 to iLoop
   msgbox  "Split function result" &arrArray(i)
Next

'Mid function can be used to retrieve a sub-string from a main string Mid(String, Start, Length(optional))
Dim sMainString1, sSubString1, sSubString2
sMainString1 = "Orange"
sSubString1= Mid(sMainString1, 3, 2) ' variable 'sSubString' will have the value 'an'
msgbox "Substring upto length 2 by mid function" &sSubString1
sSubString2 = Mid(sMainString1, 3) ' variable 'sSubString1' will have the value 'ange'
msgbox "Sub string using mid function without length parameter" &sSubString2

'Replace function can be used to replace some sub-string within a main string with some other string.
replacestr="abaacaadea"
msgbox "Replace abaacaadea a character with b" &Replace(replacestr, a,b)

' Space function Returns a string consisting of the specified number of spaces
Dim MyString
MyString = Space(10)   ' Returns a string with 10 spaces.
MyString = "Hello" & Space(10) & "World" ' Insert 10 spaces between two strings.
msgbox "Display string with 10 space insert between two string" &MyString
'String function to create a repeating character string of a specified length. str = String(5, “a”) would return the string – “aaaaa”.
Dim MyString1
MyString1 = String(5, "*")   ' Returns "*****".
msgbox "string func value" &MyString1
MyString1 = String(5, 42)   ' Returns "*****".
msgbox "string func value" &MyString1
MyString1 = String(10, "ABC")   ' Returns "AAAAAAAAAA".
msgbox "string func value" &MyString1

'StrReverse function in QTP can be used to create a reverse of a string.
strrev=StrReverse("Trupti")
msgbox "String Reverse function" &strrev

'Join()- If you have a number of sub-strings in an array, you can use the Join function to concatenate all the sub-strings from the array into a single string.
Dim MyStringJoin
Dim MyArray3(3)
MyArray3(0) = "Mr."
MyArray3(1) = "John "
MyArray3(2) = "Doe "
MyArray3(3) = "III"
MyStringJoin = Join(MyArray3) ' MyString contains "Mr. John Doe III".
msgbox "Join String example" &MyStringJoin

'StrComp function can be used to compare two strings in QTP o means binary comparision and 1 means text comparision
Dim MyStr1, MyStr2, MyComp
MyStr1 = "ABCD": MyStr2 = "abcd"   ' Define variables.
MyComp = StrComp(MyStr1, MyStr2, 1)   ' Returns 0.
msgbox " text comparision ABCD abcd" &MyComp
MyComp = StrComp(MyStr1, MyStr2, 0)   ' Returns -1.
msgbox "binary compariion ABCD abcd" &myComp
MyComp = StrComp(MyStr2, MyStr1)   ' Returns 1.
msgbox "string comparision ABCD abcd" &MyComp

'Filter function returns a zero-based array containing a subset of a string array based on a specified filter criteria.
'If no matches of Value are found within InputStrings, Filter returns an empty array. An error occurs if InputStrings is Null or is not a one-dimensional array.
'The array returned by the Filter function contains only enough elements to contain the number of matched items
Dim MyIndex
Dim MyArray (3)
MyArray(0) = "Sunday"
MyArray(1) = "Monday"
MyArray(2) = "Tuesday"
MyIndex = Filter(MyArray, "Mon") ' MyIndex(0) contains "Monday".
msgbox "filter function output" &MyIndex(0)

Tuesday, September 4, 2012

To capture application screenshot and display it in test results

Hey folks,

A common feature that QTP testers are often asked to implement is to capture the application screenshot every time an error occurs during test run. This is definitely a good to have feature in your automation framework because -
a) When a script fails, you would have a proof that it failed due to an application issue and not due to your script, and
b) with the error screenshot, the developers usually find it easier to identify/fix the issue.

QTP provides a method called CaptureBitmap that can capture the image of either an object within the application or the entire screen/desktop and save it in any desired location. The image is saved as .png or .bmp file depending upon the file extension provided during the function call. The object is captured as it appears in the application when the method is performed. If only a part of the object is visible, then only the visible part is captured

Function fnDisplayBitmapInTestResults
URL="www.gmail.com"

 SystemUtil.Run "iexplore.exe", URL
browsernm=".*gmail.*"
Pagenm=".*gmail.*"
Set CurrObj=Browser("name:="&browsernm).Page("title:="&Pagenm)
wait(5)
currobj.CaptureBitmap "d:\Test.bmp"
Reporter.ReportEvent micDone ,"Image", "Image", "D:\Test.bmp"
End Function

call  fnDisplayBitmapInTestResults

Notes:
1. You cannot load images from Quality Center.
2. If you include large images in the run results, it may impact performance.
3. If you specify an image as a relative path, QTP will first search the Results folder for the image and then the search paths specified in the Folders pane of the Options dialog box

4 Different Ways to Associate Function Libraries to your QTP Scripts

4 Different Ways to Associate Function Libraries to your QTP Scripts
Most of the times, when you are creating test scripts or are designing a new QTP Framework, you would be trying to come up with reusable functions which you would have to store in the function library. Now, in order to use this function library with multiple test cases, you need to associate this function library with your scripts. This article explains the 4 methods that will help you in associating the function libraries in QTP Test Cases.

Based on the type of framework you are using, you can use any of the following methods to associate function libraries to your QTP Script -

  • By using ‘File > Settings > Resources > Associate Function Library’ option in QTP.
  • By using Automation Object Model (AOM).
  • By using ExecuteFile method.
  • using LoadFunctionLibrary method.

Friday, August 31, 2012

Advantages and Disadvantages of using DataTable as a Data Source

Advantages and Disadvantages of using DataTable as a Data Source

Advantages
  • a) The main advantage of this method is that it is very each to script for taking data from the datatable.
  • b) Another advantage is that you can use the ‘Run on all rows’ setting to run the same script for multiple data without making any changes in the script.
Disadvantages
  • a) This concept can’t be used for complex frameworks where you need to reuse the same set of data for different test cases.
  • b) This method also doesn’t work with modular framework where the test data needs to be grouped based on the functions rather than test cases.

Tuesday, August 14, 2012

Excel Formatting using QTP

Hey folks,

Here, I try to write code for excel formatting. Code is fetching excel files from the folder and do formatting of Font, Size etc. It count the number of excel files from the folder and do formatting on each file and save it. This type of example helps when user wants to do same kind of formatting on each file in folder.

Set xlApp = CreateObject("Excel.Application")
Set fso = CreateObject("Scripting.FileSystemObject")
 PathofFolder="D:\Trupti\Copy of Testcases"
 Set oFolder = fso.GetFolder(PathofFolder) ' to get the folder
 Set oFiles = oFolder.Files
 NumberOfFiles = oFiles.Count ' to get the count of files
 msgbox "no of files" &NumberOfFiles
 For Each oFile In oFiles
 On Error Resume Next
 If InStr(1, lcase(oFile.path),".xls") > 0 then ' to check the type of file
            Set xlbook = xlApp.Workbooks.Open(oFile.path)
            set xlSheet=xlbook.WorkSheets.item(1)
            xlSheet.Activate
            xlApp.Visible=True
            xlSheet.Cells.Select ' to select all the active cells
            'xlApp.Selection.ClearFormats
            With xlApp.Selection
                    .Font.Name="Calibri"
                    .Font.Size=11
                    .HorizontalAlignment = -4131 '-4131 letf align, -4152 right align, -4130 justify, -4108 center
                     .VerticalAlignment = -4160 ' -4160 top align, -4107 bottom align, -4108  center, -4130 justify
                     .WrapText = True
                    ' .Borders(1).linestyle=1
            End With
            xlSheet.Rows("1:1").Font.Size=14            'select the first row and change the font size of it
            xlbook.SaveAs oFile.path, 51
 end If
 Err.clear
 Next
xlApp.Quit
Set xlApp = Nothing
Set xlbook = Nothing
set xlSheet = Nothing    

Thanks,
Trupti

Wednesday, May 23, 2012

Software Testing Risks

The 10 top software testing risks are addressed in terms of articulating their full impact to the software testing process.
  1. lack of staff availability
  2. lack of staff knowledge.
  3. lack of test environment availability
  4. lack of test environment stability
  5. lack of test coverage across product scope
  6. lack of test depth across conditions
  7. lack of realistic schedule estimation
  8. schedule mismangement
  9. Defect mismanagement
  10. lack of testing progress

Definations- Quality Related

Here, some of the definations related to Quality.
  1. Quality : The totality of features and characterstics of a product or service that bear on its ability to satisfy stated or implied needs.
  2. Quality Audit : A systematic and independant examination to determine whether quality activity and related results comply with planned arrangments. The audit also determine whether these arrangements are implemented effectively and are suitable to achieve objectives.
  3. Quality Manual : The top level document defining the quality system.
  4. Quality Plan : A document setting out the specific quality practices, resources and sequence of activities relavent to a particular product service, contract or a project.
  5. Quality Policy : The overall intentions and direction of an organization regarding quality as formally expressed by top managment.
  6. Quality Records - written records that are retained in accordance with requirements of ISO 9001.
  7. Quality System : The organizational structure responsibilities, procedures, process and resurces for implementing quality management.

Reasons - Why we should test software

Folks,

why we need to test the software. here are the reasons.....

Reasons for test software
  1. To find defects and reduce risk of software failure
  2. To ensure that it meets user requirements
  3. To ensure that it is fit for use
  4. To reduce cost of quality by delivering defect free product
  5. To achieve customer satisfaction
  6. To imporve continously testing process
  7. To determine state of software

About Testing Documents and Definetion

@Readers,

Here, I have given some common testing definetion about testing, which usually we need to refer most of the time in hurry when go for the interview. HAHAHAHAHA.......

hope this will helpful to me as well you guys also............

Following are the testing documents.
  1. Test Policy - Comapany level : A high level document describing the principle approach and major objectives of the organization regarding testing.
  2. Test Strategy - Company level : The objective of testing is to reduce the risks inherent in computer system. The strategy must address the risks and present a process that can reduce those risk or high level description of the test levels to be performed and the testing within those levels for an organization or programme.
  3. Test Methodology - Project level : It incorporate both testing strategy and testing tactics. It means by which the test strategy is achieved.
  4. Test Plan - Project level : A document describing the scope approach,resources and schedule of intended test activities. It identifies amongest others test items, the features to be tested, testing task, who will do each task, degree of tester independence, test environment, test design technique and entry and exit criteria to be used and the rationale for their choice and any risks requiring contingency planning.
  5. Test Case- Project Level : A testcase is a set of test input, execution conditions (pre/post conditions) and expected results developed for a particular test objective.
  6. Test Procedure : A document specifying a sequence of actions for the execution of test. Also knwon as test script or manual test script.
  7. Defect Report -Project Level : A document reporting on any flaw in component or system that can cause the component / system to fail to perform its required function. (IEEE 829)
  8. Test summary report - Project Level : A document summarizing testing activities and results. It also contains an evaluation of the corresponding test items against exit criteria. (IEEE 829)
  9. Test objective : A test objective is what the test is to be validate. eg. performance, functionality etc.
  10. Verification : A technique to ensure the system complies with organization standards and processess, relying on review and non executable methods.
  11. Validation : Ensures that the system operates according to the plan by executing the system functions through a series of tests that can be observed and evaluated
  12. Test Approach : Approach to testing, how it will ensure adequate testing which is detailed enough for test task estimation and to use testing technique
  13. Testing : Software testing is process used to identify the correctness, completeness and quality of developed computer software
  14. Test case adequacy criteria: The criteria for deciding if the testcase selected are adequate and appropriate
  15. Test suspension and resumption criteria: when test should be suspended and when they can be resumed
  16. Test stop criteria The criteria for deciding when testing should be stopped

Tuesday, May 15, 2012

Difference between DBMS/RDBMS and Access/SQL server

DBMS/RDBMS
  1. RDBMS= DBMS + referencial integrity- RDBMS follows 12 rules of CODD
  2. In DBMS relation is between two files, while in RDBMS relation is between 2 tables.
  3. DBMS doesnt support client server architecture , while RDBMS supports
  4. DBMS doesnt follow Normalization, while RDBMS follows
  5. DBMS consist of files, records , while RDBMS consist of relations, tables, tuples
  6. DBMS -allow one user access at a time, while RDBMS allow multiple user simulations
Access/ SQL Server
  1. Access follows file sharing architecture and network trafic is high, while SQL server follows client server architecture and network trafic is low- scalability and reliability
  2. Access- is not relieable . It directly interact with access file, if in middle transaction fails then not recovered, while SQL server is reliable, transaction is recovered
  3. When it comes to cost and support access is better than SQL. In case of SQL server you have to pay for per client licence, but for access runtime is free.
  4. When your application has to cater to huge load demand, highly transactional environment and high concerrency then its better to use SQL.

Difference between store procedure and Function

Function
  1. Should return at least one output parameter, it can return more than one parameter using OUT argument
  2. Parsed and compiled at runtime
  3. Cannot affect the state of database
  4. Can be invoked from SQL statement eg. SELECT fnname()
  5. functions are mainly used to compute values
Procedure
  1. Doesnot return value but can return value (by OUT parameter)
  2. Stored as Psedo-code in database i.e complied form
  3. Can affect the state of database using committ etc
  4. Cannot be invoked from SQL statement ex. SELECT
  5. procedures are mainly used to process the task

About SQL Injection

SQL injection is the means by which a user can pass malicious code to a database by injecting their own code into your SQL statement by passing part of an SQL statement to your query via an online form.

SQL injection is a technique for explaiting web applications that use client supplied data in SQL queries without stripping potentially harmful character first SQL injection occurs when an attacker is able to insert a series of SQL statements into query by manipulating data input into an application.

Example
  1. Enter first name kur'n and lastname Daud
so, Select id,firstname,lastname from author where firstname='kur'n' and lastname='daud'
it give error

2. Enter username ';drop table usertable
;colon terminate first query and drop table

3. username admin'--
4. username ór 1=1--
5. username únion select 1;'functional user and 'same password'',1--
here application believes that constant row that the attacker specified was part of the record set retrived from database.

SQL Injection Prevention
  1. using store procedure - use parameterized queries and SP
  2. protect SQL syntax- never allow client supplied data to modoify syntax of SQL statement and All SQL statements required by the application should be in SP and kept on database server
  3. Protect from your application level - protect it from application from by remove all char that could attempt any SQL injection
  4. combination approach- first you need to make sure that your SQL syntax is secure. second make sure that your application protect from any SQL character attempts. Finally make use of SP to update your database, and make sure that you define any restriction from your DBMS such as oracle and SQL server.

Database Testing Checklist

Folks,

Keep following points in mind when doing database testing. hope this will helpfull.
  1. Field size validation
  2. Check constraints
  3. Indexes are done or not (for performance related issues)
  4. Store procedure
  5. Field size defined in the application is matching with that in database
  6. Events like insert, update, delete
  7. Data integrity, data validity and data manipulation and update

Tuesday, May 8, 2012

Difference between Delete and Truncate and count

Difference between Delete and Truncate
if we use truncate table then we can reuse storage. all memory is free for other operation not wait for any cleanup operation in truncate while in delete the memory is not available for further use.

Difference between count() and count(*)
In count(*) include duplicate null values while in count() not include null value

Wednesday, May 2, 2012

QTP-How to create and delete folder on path

vb script create 5 folders test1 test2 test3 test4 test5

set fso=createobject("scripting.filesystemobject")
for i=1 to 5
fso.createfolder "C:\test" &i
next

vb script to delete folder test1,test2, test3,test4 and test5
dim vfso
set vfso=createobject("scripting.filesystemobject")
for i=1 to 5
vfso.deletefolder "C:\test" &i
next

Thursday, April 19, 2012

VB Script -Programs

  1. *
    **
    ***
    Please write a code to get output like above diagram.
for i=1 to 3 step 1
  for j=1 to i step 1
    vstr=vstr&"*"
  next
   vstr=vstr&vbnewline
next
msgbox vstr
  1. sunday is sunday
    monday
    tuesday
    wendesday
    sunday
    thursday
    friday
    saturday
    sunday
    sunday

    how to count no of sunday in the text file from vb?
Set fso=createobject("scripting.filesystemobject")
Set forread=fso.OpenTextFile("path\test.txt",1)
text=forread.ReadAll
coun=ubound(split(text,"sunday"))
msgbox coun

3. int a=4857 i need output as 7584.without using any inbuild function?
var=4857 For i=1 to len(var) x=var mod 10 num=num&x var=var/10 var=fix(var) Next msgbox num

Wednesday, February 29, 2012

This month No New Update

Dear Readers,

This month no new updates from myside, due to some new role have to play in my life with my lovely daughter.

Friday, January 20, 2012

Defect Tracking or Defect/Bug Life Cycle

Hey folks,

Defect Tracking or bug life cycle is vary from company to company and tools to tools.


Defect Tracking
To track defects, a defect workflow process has been implemented. Defect workflow training will be conducted for all test engineers. The steps in the defect workflow process are as follows:
a) When a defect is generated initially, the status is set to "New". (Note: How to document the defect, what fields need to be filled in and so on, also need to be specified.)
b) The Tester selects the type of defects:
Bug
Cosmetic
Enhancement
Omission
c) The tester then selects the priority of the defect:
Critical - fatal error
High - require immediate attention
Medium - needs to be resolved as soon as possible but not a showstopper
Low - cosmetic error
d) A designated person (in some companies, the software manager; in other companies, a special board) evaluates the defect and assigns a status and makes modifications of type of defect and/or priority if applicable).
The status "Open" is assigned if it is a valid defect.
The status "Close" is assigned if it is a duplicate defect or user error. The reason for "closing" the defect needs to be documented.
The status "Deferred" is assigned if the defect will be addressed in a later release.
The status "Enhancement" is assigned if the defect is an enhancement requirement.
e) If the status is determined to be "Open", the software manager (or other designated person) assigns the defect to the responsible person (developer) and sets the status to "Assigned".
f) Once the developer is working on the defect, the status can be set to "Work in Progress".
g) After the defect has been fixed, the developer documents the fix in the defect tracking tool and sets the status to .fixed,. if it was fixed, or "Duplicate", if the defect is a duplication (specifying the duplicated defect). The status can also be set to "As Designed", if the function executes correctly. At the same time, the developer reassigns the defect to the originator.
h) Once a new build is received with the implemented fix, the test engineer retests the fix and other possible affected code. If the defect has been corrected with the fix, the test engineer sets the status to "Close". If the defect has not been corrected with the fix, the test engineer sets the status to .Reopen.. Defect correction is the responsibility of system developers; defect detection is the responsibility of the AMSI test team. The test leads will manage the testing process, but the defects will fall under the purview of the configuration management group. When a software defect is identified during testing of the application, the tester will notify system developers by entering the defect into the PVCS Tracker tool and filling out the applicable information.

How to write Effective Defect Report


 
Defect reports are most important deliverables to come out of test. Effective defect report will
  • Reduce the number of defects returned from development
  • Improve the speed of getting defect fixes
  • Improve the credibility of test
  • Enhance teamwork between test and development
Defect Remarks
  1. Condense - Say it clearly but briefly
  2. Accurate - Is it a defect or could it be user error, misunderstanding, etc.?
  3. Neutralize - Just the facts. No zingers. No humor. No emotion.
  4. Precise - Explicitly, what is the problem?
  5. Isolate - What has been done to isolate the problem?
  6. Generalize - What has been done to understand how general the problem is?
  7. Re-create - What are the essentials in triggering/re-creating this problem? (environment, steps, conditions)
  8. Impact - What is the impact to the customer? What is the impact to test?
Sell the defect.
 
Debug - What does development need to make it easier to debug?
(traces, dumps, logs, immediate access, etc.)
 
Evidence - What documentation will prove the existence of the error?

The defect report contains proper following data.
<!--[if !supportLists]-->1.     <!--[endif]-->Title of bug - it should start with your Module number along with your defect summary. For ex Module No-Module Name- Record is not getting updated in database.
2. Select Cross Reference#, if any
3. Select all mandatory details like, opened by, severity, found during, assigned to, etc.
 
In comment section we should provide detail information along with test environment. Because if any new member validates the defect then he/she should able to understand the same in better way.
In comment section, we should follow as:
1. Copy title of bug
2. Test environment: like L1, L2(if any), Browser detail(if any), Database details (if any)
3. Steps to reproduce
4. Actual output
5. Expected output
6. Build date and number (if any)
7. Attachment of log or screenshot (if any)
8. Any special observation/comment
9. Test data (if any) like ID, xml etc.
 
Same way, when we close or retest or reopen the details we need to follow same style.
1. Mention on which build and date you test the defect.
2. Reason for closing the defect, like DB getting updated properly.
3. Defect due to Code, Document etc (if any)
4. Provide test data with which defect is validated.