Wednesday, July 21, 2010

Bug or Defect Report

Lets assume in your application under test you want to create a new user with user information, for that you need to logon into the application and navigate to USERS menu > New User, then enter all the details in the ‘User form’ like, First Name, Last Name, Age, Address, Phone etc. Once you enter all these information, you need to click on ‘SAVE’ button in order to save the user. Now you can see a success message saying, “New User has been created successfully”.
But when you entered into your application by logging in and navigated to USERS menu > New user, entered all the required information to create new user and clicked on SAVE button. BANG! The application crashed and you got one error page on screen. (Capture this error message window and save as a Microsoft paint file)
Now this is the bug scenario and you would like to report this as a BUG in your bug-tracking tool.
How will you report this bug effectively?
Here is the sample bug report for above mentioned example:(Note that some ‘bug report’ fields might differ depending on your bug tracking system)
SAMPLE BUG REPORT:

Bug Title or Name: Application crash on clicking the SAVE button while creating a new user.Bug ID: (It will be automatically created by the BUG Tracking tool once you save this bug) Area Path: USERS menu > New Users Build Number: Version Number 5.0.1 Severity: HIGH (High/Medium/Low) or 1 Priority: HIGH (High/Medium/Low) or 1 Assigned to: Developer-X Reported By: Your Name Reported On: Date DefectStatus: New/Open/Active (Depends on the Tool you are using)Environment: Windows 2003/SQL Server 2005

Description:Application crash on clicking the SAVE button while creating a newuser, hence unable to create a new user in the application.

Steps To Reproduce:

1) Logon into the application
2) Navigate to the Users Menu > New User
3) Filled all the user information fields
4) Clicked on ‘Save’ button
5) Seen an error page “ORA1090 Exception: Insert values Error…”
6) See the attached logs for more information (Attach more logs related to bug..IF any)
7) And also see the attached screenshot of the error page.Expected result: On clicking SAVE button, should be prompted to a success message “New User has been created successfully”.(Attach ‘application crash’ screen shot.. IF any)Save the defect/bug in the BUG TRACKING TOOL. You will get a bug id, which you can use for further bug reference.Default ‘New bug’ mail will go to respective developer and the default module owner (Team leader or manager) for further action.

QTP quick reference sample code

References:
http://qtp.blogspot.com/2007/05/checkpoints-in-qtp-quicktest.html
http://www.learnqtp.com/
http://www.qtp10.com/

Indexing:
Browser("Amazon.com: Online Shopping").Page("Amazon.com: Online Shopping").WebElement("Movies, Music & Games").Clickwait(5)Browser("Amazon.com: Online Shopping").Page("Amazon.com: Online Shopping").Link("Movies & TV").Clickwait(5)Browser("Amazon.com: Online Shopping").Page("Amazon.com Movies & TV:").Link("text:=Anime","index:=1").Click'Browser("Amazon.com: Online Shopping").WinToolbar("ToolbarWindow32").Click

---------------------
SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe","","C:\Documents and Settings\test","open"
Browser("Welcome: Mercury Tours").Page("Page").Sync
Browser("Welcome: Mercury Tours").CloseAllTabs
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").Set "mercury"
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("password").SetSecure "4c3c2d6874ae8db13192471656044dee3a37c0b6"
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").Image("Sign-In").Click 4,2
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebRadioGroup("tripType").Select "oneway"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("fromPort").Select "Seattle"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").ActiveX("Java Plug-in 1.6.0_20").WinButton("View Calendar").Click
Window("Select Departure Date").WinButton("29").Click
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toPort").Select "Portland"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").Image("findFlights").Click 57,14
Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").Sync




SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe","","C:\Documents and Settings\test","open"

Browser("Welcome: Mercury Tours").Navigate "http://newtours.demoaut.com/"
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").Sync

Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("name:= userName", "type:=text").Set"mercury"
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("name:= password", "type:=password").Set"mercury"

Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").Image("Sign-In").Click
Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").Link("outertext:=Hotels").Click
Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").Link("name:=Image").Click
'Dialog("QuickTest Professional").Activate
'Dialog("QuickTest Professional").Activate


Browser(“Browser”).Page(“Page”).Link(“outertext=”&objval, “index=”&k).Click
--------------------------
Recording Types:
· Normal
· Analog
· Low level

Object Repository
· Local repository
· Shared repository - .tsr


Username – webedit – set
Radio button – webradiogroup – select
Password – setsecure –

Regular expression – User for dynamic objects
Object repository – change the outertext value.

Parameterization
Create an excel sheet in C drive and give the data to be parameterized
Add the following in the starting of the code
Datatable.importsheet “C:test.xls”
Un = datatable.value (“Username”)
Pwd = datatable.value (“password”)
Eml = datatable.value (“Email”)
Msgbox Un
Msgbox Pwd
Msgbox Eml

To get a particular row from datatable
Datatable.importsheet “C:test.xls”
R = datatable.getrowcount
For i= 2 to 3
Datatable.setcurrentrow (i)
Un = datatable.value (“Username”)
Pwd = datatable.value (“password”)
Eml = datatable.value (“Email”)
Msgbox Un
Msgbox Pwd
Msgbox Eml

To take alternative data from the datatable
R= datatable.getrowcount
Msgbox R
For i=1 to R step 2

Topics :
· Parametization
· Object spy
· Regular exp
· Action concept
· Data tables
· Basics of descriptive programming
· Virtual objects
· Recovery scenario

Example:
Datatable.importsheet "C:/test.xlsx,1,1"
Un = datatable.value ("Username")
Pwd = datatable.value ("password")
'Eml = datatable.value (“Email”)
Msgbox Un
Msgbox Pwd
'Msgbox Eml
SystemUtil.Run "iexplore","","C:\Documents and Settings\test",""
Browser("Browser").Page("Page").Sync
Browser("Browser").Navigate "http://www.amazon.com/"
Browser("Browser").Page("Amazon.com: Online Shopping").Link("Start here").Click
Browser("Browser").Page("Sign In").WebEdit("email").Set "yasothai@ustglobal.com"
Browser("Browser").Page("Sign In").WebRadioGroup("action").Select "new-user"
Browser("Browser").Page("Sign In").Image("sign in using our secure").Click 46,12
Browser("Browser").Page("Amazon.com Registration").WebEdit("userName").Set "Un"
Browser("Browser").Page("Amazon.com Registration").WebEdit("emailCheck").Set "yasothai@ustglobal.com"
Browser("Browser").Page("Amazon.com Registration").WebList("month").Select "March"
Browser("Browser").Page("Amazon.com Registration").WebList("day").Select "06"
Browser("Browser").Page("Amazon.com Registration").WebEdit("password").Set Pwd
Browser("Browser").Page("Amazon.com Registration").WebEdit("passwordCheck").Set pwd
Browser("Browser").Page("Amazon.com Registration").Image("continue-blue-arrow._V19219331").Click 55,8


Checkpoint:
Instead of checkpoints they use IF conditions.
XML checkpoints & Database checkpoints are for standalone/desktop applications.
a. Standard
b. Text
c. Text area – used for desktop applications
d. Bitmap
e. Database
f. Accessibility
g. XML

IF condition instead of checkpoints:
Browser("welcome:Mercury Tours").page("welcome:mercury tours").webedit ("username").set "tutorial"
X= Browser("welcome:Mercury Tours").page("welcome:mercury tours").webedit ("username").GetROProperty("value")
If trim(x)="tutorial" then
Browser("welcome:Mercury Tours").page("welcome:mercury tours").webedit ("password").set "tutorial"
else reporter.ReportEvent.micfail."entering user name", "failed"
Y= Browser("welcome:Mercury Tours").page("welcome:mercury tours").webedit ("password").GetROProperty("value")
if trim( y)=tutorial then
Browser("welcome:Mercury Tours").page("welcome.mercury.tourse").image("sign-in").click
End if
End if

Paramterization
Browser(“Browser”).Page(“Page”).Link(“outertext=”&objval, “index=”&k).Click
Datatable.importsheet "D:\Data2.xls",1,1
Un = Datatable.Value ("Username")
Pwd = datatable.Value ("Password")
Msgbox Un
Msgbox Pwd
Datatable.value(“Res”)=”Pass”
Database.Export”D”\Data2.xls”

1.Record and Run a scenario
2. Runtime settings ->sync seconds =0; use page.sync
3.Object Repository
4.Regular Expressions
5. Capture “Anime” in Amazon.com using regular exp.
6. Create Objects in Object Repository and highlight in the application
7.Parameterization
- Import a sheet
-Run with diff set of username and passwd
- Set current row/particular row
8.Descriptive Programming
9.Recovery scenario


*Functions, Data table export, Get Runtime Object property, Fire event,

' record web page and click on insert checkpoints while recording
Browser("Sign-on: Mercury Tours").Page("Welcome: Mercury Tours").SyncBrowser("Sign-on: Mercury Tours").Navigate "http://newtours.demoaut.com/"Browser("Sign-on: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").Set "tutorial"Browser("Sign-on: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").Check CheckPoint("userName")'Window("Test Results").Page("Welcome: Mercury Tours").Check CheckPoint("Welcome: Mercury Tours")DbTable("DbTable").Check CheckPoint("DbTable")
Browser("Sign-on: Mercury Tours").Page("Sign-on: Mercury Tours").Image("html").Check CheckPoint("html")Dialog("QuickTest Professional").Activate

Test Plan Vs Test Strategy

Test Strategy
A Test Strategy document is a high level document and normally developed by project manager. This document defines “Testing Approach” to achieve testing objectives. The Test Strategy is normally derived from the Business Requirement Specification document.
The Test Stategy document is a static document meaning that it is not updated too often. It sets the standards for testing processes and activities and other documents such as the Test Plan draws its contents from those standards set in the Test Strategy Document.
Some companies include the “Test Approach” or “Strategy” inside the Test Plan, which is fine and it is usually the case for small projects. However, for larger projects, there is one Test Strategy document and different number of Test Plans for each phase or level of testing.
Components of the Test Strategy document
Scope and Objectives
Business issues
Roles and responsibilities
Communication and status reporting
Test deliverability
Industry standards to follow
Test automation and tools
Testing measurements and metrices
Risks and mitigation
Defect reporting and tracking
Change and configuration management
Training plan

Test Plan
The Test Plan document on the other hand, is derived from the Product Description, Software Requirement Specification SRS, or Use Case Documents.The Test Plan document is usually prepared by the Test Lead or Test Manager and the focus of the document is to describe what to test, how to test, when to test and who will do what test.
It is not uncommon to have one Master Test Plan which is a common document for the test phases and each test phase have their own Test Plan documents.
There is much debate, as to whether the Test Plan document should also be a static document like the Test Strategy document mentioned above or should it be updated every often to reflect changes according to the direction of the project and activities.My own personal view is that when a testing phase starts and the Test Manager is “controlling” the activities, the test plan should be updated to reflect any deviation from the original plan. After all, Planning and Control are continuous activities in the formal test process.
Test Plan Contains:
Test Plan id
Introduction
Test items
Features to be tested
Features not to be tested
Test techniques
Testing tasks
Suspension criteria
Features pass or fail criteria
Test environment (Entry criteria, Exit criteria)
Test delivarables
Staff and training needs
Responsibilities
Schedule

Web Application or Web base testing

Web based applications are of 3 tier applications (developed for Internet / intranet / xtranet)Here we will be having Browser, web server and DB server.
The applications accessible in browser would be developed in HTML, DHTML, XML, JavaScript etc. (We can monitor through these applications)
Applications for the web server would be developed in Java, ASP, JSP, VBScript, JavaScript, Perl, Cold Fusion, PHP etc. (All the manipulations are done on the web server with the help of these programs developed)
The DBserver would be having oracle, sql server, sybase, mysql etc. (All data is stored in the database available on the DB server)

Web testing checklist:
1) Functionality Testing
2) Usability testing
3) Interface testing
4) Compatibility testing
5) Performance testing
6) Security testing
1) Functionality Testing:
Test for – all the links in web pages, database connection, forms used in the web pages for submitting or getting information from user, Cookie testing.
Check all the links:
Test the outgoing links from all the pages from specific domain under test.
Test all internal links.
Test links jumping on the same pages.
Test links used to send the email to admin or other users from web pages.
Test to check if there are any orphan pages.
Lastly in link checking, check for broken links in all above-mentioned links.
Test forms in all pages:Forms are the integral part of any web site. Forms are used to get information from users and to keep interaction with them. So what should be checked on these forms?
First check all the validations on each field.
Check for the default values of fields.
Wrong inputs to the fields in the forms.
Options to create forms if any, form delete, view or modify the forms.
Let’s take example of the search engine project currently I am working on, In this project we have advertiser and affiliate signup steps. Each sign up step is different but dependent on other steps. So sign up flow should get executed correctly. There are different field validations like email Ids, User financial info validations. All these validations should get checked in manual or automated web testing.
Cookies testing:Cookies are small files stored on user machine. These are basically used to maintain the session mainly login sessions. Test the application by enabling or disabling the cookies in your browser options. Test if the cookies are encrypted before writing to user machine. If you are testing the session cookies (i.e. cookies expire after the sessions ends) check for login sessions and user stats after session end. Check effect on application security by deleting the cookies. (I will soon write separate article on cookie testing)
Validate your HTML/CSS:If you are optimizing your site for Search engines then HTML/CSS validation is very important. Mainly validate the site for HTML syntax errors. Check if site is crawlable to different search engines.
Database testing:Data consistency is very important in web application. Check for data integrity and errors while you edit, delete, modify the forms or do any DB related functionality.Check if all the database queries are executing correctly, data is retrieved correctly and also updated correctly. More on database testing could be load on DB, we will address this in web load or performance testing below.
2) Usability Testing:
Test for navigation:Navigation means how the user surfs the web pages, different controls like buttons, boxes or how user using the links on the pages to surf different pages.Usability testing includes:Web site should be easy to use. Instructions should be provided clearly. Check if the provided instructions are correct means whether they satisfy purpose.Main menu should be provided on each page. It should be consistent.
Content checking: Content should be logical and easy to understand. Check for spelling errors. Use of dark colors annoys users and should not be used in site theme. You can follow some standards that are used for web page and content building. These are common accepted standards like as I mentioned above about annoying colors, fonts, frames etc.Content should be meaningful. All the anchor text links should be working properly. Images should be placed properly with proper sizes.These are some basic standards that should be followed in web development. Your task is to validate all for UI testing
Other user information for user help:Like search option, sitemap, help files etc. Sitemap should be present with all the links in web sites with proper tree view of navigation. Check for all links on the sitemap.“Search in the site” option will help users to find content pages they are looking for easily and quickly. These are all optional items and if present should be validated.
3) Interface Testing:The main interfaces are:Web server and application server interfaceApplication server and Database server interface.
Check if all the interactions between these servers are executed properly. Errors are handled properly. If database or web server returns any error message for any query by application server then application server should catch and display these error messages appropriately to users. Check what happens if user interrupts any transaction in-between? Check what happens if connection to web server is reset in between?
4) Compatibility Testing:Compatibility of your web site is very important testing aspect. See which compatibility test to be executed:
Browser compatibility
Operating system compatibility
Mobile browsing
Printing options
Browser compatibility:In my web-testing career I have experienced this as most influencing part on web site testing.Some applications are very dependent on browsers. Different browsers have different configurations and settings that your web page should be compatible with. Your web site coding should be cross browser platform compatible. If you are using java scripts or AJAX calls for UI functionality, performing security checks or validations then give more stress on browser compatibility testing of your web application.Test web application on different browsers like Internet explorer, Firefox, Netscape navigator, AOL, Safari, Opera browsers with different versions.
OS compatibility:Some functionality in your web application is may not be compatible with all operating systems. All new technologies used in web development like graphics designs, interface calls like different API’s may not be available in all Operating Systems.Test your web application on different operating systems like Windows, Unix, MAC, Linux, Solaris with different OS flavors.
Mobile browsing:This is new technology age. So in future Mobile browsing will rock. Test your web pages on mobile browsers. Compatibility issues may be there on mobile.
Printing options:If you are giving page-printing options then make sure fonts, page alignment, page graphics getting printed properly. Pages should be fit to paper size or as per the size mentioned in printing option.
5) Performance testing:Web application should sustain to heavy load. Web performance testing should include:Web Load TestingWeb Stress Testing
Test application performance on different internet connection speed.In web load testing test if many users are accessing or requesting the same page. Can system sustain in peak load times? Site should handle many simultaneous user requests, large input data from users, Simultaneous connection to DB, heavy load on specific pages etc.
Stress testing: Generally stress means stretching the system beyond its specification limits. Web stress testing is performed to break the site by giving stress and checked how system reacts to stress and how system recovers from crashes.Stress is generally given on input fields, login and sign up areas.
In web performance testing web site functionality on different operating systems, different hardware platforms is checked for software, hardware memory leakage errors,
6) Security Testing:
Following are some test cases for web security testing:
Test by pasting internal url directly into browser address bar without login. Internal pages should not open.
If you are logged in using username and password and browsing internal pages then try changing url options directly. I.e. If you are checking some publisher site statistics with publisher site ID= 123. Try directly changing the url site ID parameter to different site ID which is not related to logged in user. Access should denied for this user to view others stats.
Try some invalid inputs in input fields like login username, password, input text boxes. Check the system reaction on all invalid inputs.
Web directories or files should not be accessible directly unless given download option.
Test the CAPTCHA for automates scripts logins.
Test if SSL is used for security measures. If used proper message should get displayed when user switch from non-secure http:// pages to secure https:// pages and vice versa.
All transactions, error messages, security breach attempts should get logged in log files somewhere on web server.