Thursday, October 18, 2012

Functional and Non Functional Testing

Functional Testing: Testing the application against business requirements. Functional testing is done using the functional specifications provided by the client or by using the design specifications like use cases provided by the design team.
Functional Testing covers:
·      Unit Testing
·      Smoke testing / Sanity testing
·      Integration Testing (Top Down, Bottom up Testing)
·      Interface & Usability Testing
·      System Testing
·      Regression Testing
·      Pre User Acceptance Testing(Alpha & Beta)
·      User Acceptance Testing
·      White Box & Black Box Testing
·      Globalization & Localization Testing
Non-Functional Testing: Testing the application against client's and performance requirement. Non-Functioning testing is done based on the requirements and test scenarios defined by the client.
Non-Functional Testing covers:
·      Load and Performance Testing
·      Ergonomics Testing
·      Stress & Volume Testing
·      Compatibility & Migration Testing
·      Data Conversion Testing
·      Security / Penetration Testing
·      Operational Readiness Testing
·      Installation Testing
·      Security Testing (Application Security, Network Security, System Security)



Saturday, July 7, 2012

How to create test plan in Jmeter ?



1. Download the binary

You can get the binary here.

2. Unzip the tarball/zip file

I extracted it file to 
/Users/theo/tools/jakarta-jmeter-2.3.1
3. Start up JMeter- It seem like to (Double click on Jmeter.bat files)

 Create a Test Plan:

4. Create a Thread Group:

Thread Group:
Thread Group is the beginning point of any Test Plan. Thread Group is set of request that simulate the user actions and all the elements of Test Plan should be under Thread Group. It works like LoadRunner Scenario. In Thread Group we define the Number of User, Ramp Up, and Loop Count.
  • Number of Thread (User), as a name we define the number of users, who will simulate the performance test steps.
  • Ramp-Up option used to set the time that waited between each and every user run. Suppose if you have define 5 then each and every user will activate after 5 seconds. All the time will be in seconds.
  • Loop Count is the option where we set that how many times users will repeat the actions.

5. Add a Sampler: With the help of sampler JMeter send the request to web server.
A sampler is a type of request you want to make. In this example, I used an HTTP request to test load to a web server. It’s good to note JMeter supports multiple types of samplers including web services, JMS, and JDBC. Add a sampler by selecting the Thread Group you just created, right-click, select Add -> Sampler -> HTTP Request.
Configurable properties include:
  • Server Name – what the ip or url is to the server the request it to
  • Port – the port the server is listening to
  • Protocol – the protocol (http, https, etc)
  • Method – HTTP method (POST,GET, PUT, DELETE, etc)
  • Path – the URL path to request
6. Add a Listener:
 Listener is same as Result window of any tools. It will help to analyze the test result. JMeter provides different kind of Listener which we used according to our needs.
See JMeter is having lots of element of Test Plan but these are enough to create sample script for Web Application. For the more details about Test Plan element refer this link.

7. Run the test!


Tuesday, July 3, 2012

JMeter Interview Questions and Answers


Q1 . Does Jmeter generate any scripts? How to use the Jmeter tool and also the How to analyze the results?

A1.When you create a test in Jmeter, save the file. The file saves with the extension .jmx.
Open the .jmx file in an editor. There you can see script.
Q2. For what purpose are Junit and Jmeter used?

A2.Jmeter is a Performance Tool. It is used to test the performance of the application. Apache JMeter is a 100% pure Java desktop application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions.

What is Jmeter?
Jmeter is one of the Java tools which is used to perform load testing client/server applications.
Apache JMeter is open source software, a 100% pure Java desktop application
designed to load test functional behavior and measure performance of the application.
It was originally designed for testing Web Applications but has since expanded to other test functions

what are the other applications tested by Jmeter? 
JMeter may be used to test performance both on static and dynamic resources (files, Servlets, Perl scripts, Java Objects, Data Bases and Queries, FTP Servers and more)

What do u see when u open a jmeter?
By default,
Test Plan
Workbench
can be seen

What is Test Plan in Jmeter?
Test plan describes a series of steps JMeter will execute when run.
A complete test plan will consist of one or more Thread Groups, logic controllers, sample generating controllers, listeners, timers, assertions, and configuration elements.

What is Work bench?
The Workbench is simply an area to store test elements while you are in the process of constructing a test.  
The Workbench is a sandbox for any test or portion of a test that you are working on.
When you are ready to test what you have designed in the Workbench, you can copy or move the elements into the Test Plan.

It also contains Non- Test Elements
Http mirror sever
Http Proxy server
which is not available in the thread group & Test plan 


What is Thread Group?
Thread group elements are the beginning points of any test plan.

  1. All controllers and samplers must be under a thread group. 
  2. Listeners may be placed directly under the test plan, in which case they will apply to all the thread groups. 
  3. The controls for a thread group allow you to:
  • Set the number of threads
  • Set the ramp-up period
  • Set the number of times to execute the test 
What are the parts of thread group?

  • Sampler :Sends various types of requests to the server
  • Listeners : Results of the Run can be viewed & saved
  • Timer : Makes the run more realistic by inserting delays between the requests
  • Controller: responsible for controlling the flow of the thread group. If we have defined request to be executed on some logic like if-then-else or loop structure in java
  • Config Element: Info about the requests are added to work with samplers using this.
  • Assertion: To check if the responses are within given time and containing expected data
What are Controllers and its types? 
JMeter has two types of Controllers

Samplers Controllers 
Logical Controllers 

Samplers Controllers 
Samplers tell JMeter to send requests to a server.
For example, add an HTTP Request Sampler if you want JMeter to send an HTTP request. You can also customize a request by adding one or more Configuration Elements to a Sampler.

Logical Controllers 

Logical Controllers let you customize the logic that JMeter uses to decide when to send requests.
Logic Controllers can change the order of requests coming from their child elements.
For example, you can add an Interleave Logic Controller to alternate between two HTTP Request Samplers.

What is Configuration element?

A configuration element works closely with a Sampler
Configuration elements can be used to set up defaults and variables for later use by samplers.
Note that these elements are processed at the start of the scope in which they are found, i.e. before any samplers in the same scope.

Its elements:

CSV Data Set Config: Used to read lines from a file, and split them into variables.
HTTP Authorization Manager: You can specify one or more user logins for web pages that are restricted using server authentication
Java Request Defaults: You can set default values for Java testing
HTTP Cookie Manager: The Cookie Manager element has two functions:  
  1. It stores and sends cookies just like a web browser.
  2. Second, you can manually add a cookie to the Cookie Manager. However, if you do this, the cookie will be shared by all JMeter threads

HTTP Request Defaults: This element lets you set default values that your HTTP Request controllers use.
HTTP Header Manager: The Header Manager lets you add or override HTTP request headers




What are Listeners?
A listener is a component that shows the results of the samples
the results can be shown in a tree, tables, graphs or simply written to a log file

The Graph Results listener plots the response times on a graph.
The "View Results Tree" Listener shows details of sampler requests and responses, and can display basic HTML and XML representations of the response.
Other listeners provide summary or aggregation information.

Every listener in JMeter provides a field to indicate the file to store data to.
They also provide means to view, save, and read saved test results.

Q. How do you ensure re-usability  in your JMeter scripts?
A.
 · Using config elements like "CSV Data Set Config", "User Defined Variables", etc for greater data reuse
·    Modularizing shared tasks and invoking them via a "Module Controller".
·  Writing your own BeanShell functions, and reusing them.
Does Jmeter generate any scripts? How to use the Jmeter tool and also the How to analyze the results?
When you create a test in Jmeter, save the file. The file saves with the extension .jmx.
Open the .jmx file in an editor. There you can see script.

For what purpose Jmeter used?
Jmeter is a Performance Tool. It is used to test the performance of the application. Apache JMeter is a 100% pure Java desktop application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions.

Can we Parametrize via Jmeter?
Yes, you can parametrize via CSV file, User define variables or XML sheet.



Reference Site----

http://java-success.blogspot.in/2011/10/jmeter-interview-questions-and-answers.html

Tuesday, June 19, 2012

Explain GUI Testing and it's Contents - Define UI Testing


GUI Testing is nothing but testing the design of the application.
Verifying the User interface of the application means how the front end design, colors,  fonts, font sizes, Labels, Text format, Text boxes, Captions, Radio Buttons, buttons, list boxes, Alignments, icons, links, popup, content, tabbing is provided to move between the objects, background, foreground etc  are displayed as specified.
GUI testing is functional testing - ensuring that all interactions, navigation, links, pop-ups, content, etc all work as required.
CONTENTS:-
Section 1 - Windows Compliance Standards
1.1. Application
1.2. For Each Window in the Application
1.3. Text Boxes
1.4. Option (Radio Buttons)
1.5. Check Boxes
1.6. Command Buttons
1.7. Drop Down List Boxes
1.8. Combo Boxes
1.9. List Boxes
Section 2 - Tester's Screen Validation Checklist

2.1. Aesthetic Conditions
2.2. Validation Conditions
2.3. Navigation Conditions
2.4. Usability Conditions
2.5. Data Integrity Conditions
2.6. Modes (Editable Read-only) Conditions
2.7. General Conditions
2.8. Specific Field Tests
2.8.1. Date Field Checks
2.8.2. Numeric Fields
2.8.3. Alpha Field Checks
Section 3 - Validation Testing - Standard Actions


3.1. On every Screen
3.2. Shortcut keys / Hot Keys
3.3. Control Shortcut Keys
Section 4 - Origin & Inspiration
4.1. Document origin
4.2. Sources of Inspiration & information
4.3. Contacting the author.
Compliance for each application
·         Application should be started by double clicking on the icon.
·         Loading message should have information about application name, version number, icon etc.
·         Main window of application should have same caption as the icon in the program manager.
·         Closing of the application should result in “Are you sure?” message.
·         Behavior for starting application more than once must be specified.
·         Try to start application while it is loading
·         On every application, if application is busy it should show hour glass or some other mechanism to notify user that it is processing.
·         Normally F1 button is used for help. If your product has help integrated, it should come by pressing F1 button.
·         Minimize and restoring functionality should work properly
·         Compliance for each window in the application
·         Window caption for every application should have application name and window name. Specially, error messages.
·         Title of the window and information should make sense to the user.
·         If screen has control menu, use the entire control menu like move, close, resize etc.
·         Text present should be checked for spelling and grammar.
·         If tab navigation is present, TAB should move focus in forward direction and SHIFT+TAB in backward direction.
·         Tab order should be left to right and top to bottom within a group box.
·         If focus is present on any control, it should be presented by dotting lines around it.
·         User should not be able to select greyed or disabled control. Try this using tab as well as mouse.
·         Text should be left justified
·         In general, all the operations should have corresponding key board shortcut key for this.
·         All tab buttons should have distinct letter for it.
Text boxes
·         Move mouse to textbox and it should be changed to insert bar for editable text field and should remain unchanged for non-editable text field.
·         Test overflowing textbox by inserting as many characters as you can in the text field. Also test width of the text field by entering all capital W.
·         Enter invalid characters, special characters and make sure that there is no abnormality.
·         User should be able to select text using Shift + arrow keys.
·         Selection should be possible using mouse and double click should select entire text in the text box.
Radio Buttons
·         Only one should be selected from the given option.
·         User should be able to select any button using mouse or key board
·         Arrow key should set/unset the radio buttons.
Check boxes
·         User should be able to select any combination of checkboxes
·         Clicking mouse on the box should set/unset the checkbox.
·         Spacebar should also do the same
Push Buttons
·         All buttons except OK/Cancel should have a letter access to them. This is indicated by a letter underlined in the button text. The button should be activated by pressing ALT
·         Clicking each button with mouse should activate it and trigger required action.
·         Similarly, after giving focus SPACE or RETURN button should also do the same.
·         If there is any Cancel button on the screen, pressing Esc should activate it.
Drop down list boxes
·         Pressing the arrow should give list of options available to the user. List can be scrollable but user should not be able to type in.
·         Pressing Ctrl-F4 should open the list box.
·         Pressing a letter should bring the first item in the list starting with the same letter.
·         Items should be in alphabetical order in any list.
·         Selected item should be displayed on the list.
·         There should be only one blank space in the dropdown list.
Combo Box
·         Similar to the list mentioned above, but user should be able to enter text in it.
List Boxes
·         Should allow single select, either by mouse or arrow keys.
·         Pressing any letter should take you to the first element starting with that letter
·         If there are view/open button, double clicking on icon should be mapped to these behavior.
·         Make sure that all the data can be seen using scroll bar.
Hope this checklist will help you in testing your GUI components in a better way. In next template, Testing Geek will discuss information about field specific tests and usage of shortcuts in the application GUI.

Saturday, June 16, 2012

What is 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 Strategy 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.

What is testing life cycle?.

STLC :
STLC consists of the following :

Prepare for test Plan
Test Design
Test Execution
Bug reporting
Inspection and release
Client Acceptance
Support during acceptance testing
Test summary report

STLC is software test life cycle it starts with :-

1. Preparing the test strategy
2. Preparing the test plan
3. Creating the test environment
4. Writing the test cases
5. Creating test scripts
6. Executing
7. Analyzing the results the test scripts and reporting the bugs
8. Doing regression testing
9. Test exit

Wednesday, June 13, 2012

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.
I think I have addressed all major web testing methods. I have worked for around 2 years out of my testing career on web testing. There are some experts who have spent their whole career life on web testing. If I missed out addressing some important web testing aspect then let me know in comments below. I will keep on updating the article for latest testing information.