Wednesday, September 29, 2010

How to Test Payment Gateway Functionality?

How to Test Payment Gateway Functionality?

To test payment gateway functionality is same as test any other functionality. You should have some test strategy during testing it. Following are some points keep in mind during testing of payment gateway.

  1. Gather appropriate test data for the dummy credit card numbers for various master cards.
  2. Gather payment gateway information like whether used paypal, guestpay etc.
  3. Gather payment gateway documents with error codes – useful it if any error came during testing to identify whether its our application fault or payment gateway related error.
  4. Does the gateway do what it is supposed to do? Does it handle order objects correctly? Does it perform additional calculations correctly?
  5. Understanding of the integration of the payment gateway with application
  6. Understand and test the parameters and sessions passed through payment gateway and application
  7. Understand and test the amount related information passed through query string or session or variables in any form.
  8. Check the format of the amount with currency format
  9. Check the language of the application and payment gateway language
  10. Try to change payment gateway language during the payment process
  11. Test after successful payment all the necessary data retrieved to our application or not
  12. Check what happens if payment gateway goes down during the payment process
  13. Check what happens if payment process went successful but do not return to our application
  14. Check what happens if session goes time out during the payment process
  15. Check what happens in backend during the payment process is the session data stored in temporary table or any id is generated or not?
  16. Check what happens if payment process is fail
  17. Check if any modification transaction is going on through payment gateway, then how much amount is taken out as modified amount whether required to pay more or not. For example- if modified amount is greater than paid amount then and then only application redirect to payment gateway otherwise it should not.
  18. Verify DB entries for the transaction whether they store credit card details and all or not
  19. Verify DB entries for the amount related fields in database for the fresh transaction, modified transaction and canceled transaction.
  20. Verify error page during payment gateway process
  21. Verify security passes for the transaction
  22. Sometimes payment gateway sent confirmation through popup dialogs – so test popup blocker related settings also. What happens is popup blocker is on and all this.
  23. Check buffer pages between application and payment gateway (firefox firebug add-on will be helpful to test)

Hope guys, it will be helpful to you in your testing. If any new points are there then update it in comments, so I also get update in my knowledge.

Wednesday, September 22, 2010

How to run your first selenium test in visual studio 2008 with c#

Step1:

Selenium IDE

  1. Install selenium IDE as add on in your firefox browser.
  2. Run Selenium IDE and record script using it with language as C#.
  3. Stop recording and copy the code.

Step2:

Selenium RC

  1. Download selenium RC file and extract it to your local folder
  2. Go through command prompt and local folder directory
  3. Write command as java – version to check java environment availability.
  4. If java environment is not there then install it first using jdk 1.6
  5. Write command as java –jar selenium-server.java
  6. It will start selenium RC server. If it gives port error then write java –jar selenium-server.jar –port 5555

Step3:

Visual Studio 2008

  1. Create one project with window application
  2. Add references with client drivers of selenium in the project
  3. In form1 add one button
  4. In project add one class as new item.
  5. Copy your selenium IDE c# script to that class1.cs
  6. In setup method give URL of your site going to be test in class1.cs as

public void SetupTest()

{

selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://www.gmail.com/");

selenium.Start();

verificationErrors = new StringBuilder();

}

7. Add reference of using library

8. In form1.cs button’s click event make object of that class using

private void button1_Click(object sender, EventArgs e)

{

SeleniumTests.Untitled a = new Untitled();

a.SetupTest();

a.TheUntitledTest();

a.TeardownTest();

}

9. Build the solution and run the application on click of button.

Thursday, September 9, 2010

About VMWare Virtual Machine Server

Steps of Configure Virtual Machine

1. Right click in right panel of vmware > Add Virtual Machine

2. Select path where you want to store your virtual machine (or space of virtual machine)

3. Select network path

4. Add disk size

5. Add ram

6. Start virtual machine

7. Install operating system

8. Install vmware tools

9. Give computer name

10. Give IP of computer

11. Set firewall off (as per requirement)

12. Add required software

13. Take snapshot

VMWare -Virtual Machine File types

1. Windows Server 2003 Enterprise Edition-000001.vmdk – Vmware virtual disk file

2. Windows Server 2003 Enterprise Edition.vmsd –VMSD file

3. Windows Server 2003 Enterprise Edition.vmx – vmware configuration file

4. Windows Server 2003 Enterprise Edition-Snapshot7.vmsn- VMware virtual machine snapshot file

5. vmware.log –vmware log file

VMDK is virtual disk file - virtual partition with data and installed operating system (Micosoft Windows, Linux, Mac OS X, MS-DOS etc.) and used by VMware to run as a virtual machine (under host operating system).

This is a virtual disk file, which stores the contents of the virtual machine's hard disk drive.
A virtual disk is made up of one or more .vmdk files. If you have specified that the virtual disk should be split into 2GB chunks, the number of .vmdk files depends on the size of the virtual disk. As data is added to a virtual disk, the .vmdk files grow in size, to a maximum of 2GB each. (If you specify that all space should be allocated when you create the disk, these files start at the maximum size and do not grow.) Almost all of a .vmdk file's content is the virtual machine's data, with a small portion allotted to virtual machine overhead.
If the virtual machine is connected directly to a physical disk, rather than to a virtual disk, the .vmdk file stores information about the partitions the virtual machine is allowed to access.
Earlier VMware products used the extension .dsk for virtual disk files.

-.vmdk
This is a redo-log file, created automatically when a virtual machine has one or more snapshots. This file stores changes made to a virtual disk while the virtual machine is running. There may be more than one such file. The e2_# indicates a unique suffix added automatically by VMware Workstation to avoid duplicate file names.

Log files – Log files are just that- a log of virtual server activity for a single virtual server. Log files should be used only when you are having trouble with a virtual machine.

VMEM – A VMEM file is a backup of the virtual machine’s paging file. It will only appear if the virtual machine is running, or if it has crashed.

VMSN & VMSD files – these files are used for VMware snapshots. A VMSN file is used to store the exact state of the virtual machine when the snapshot was taken. Using this snapshot, you can then restore your machine to the same state as when the snapshot was taken. A VMSD file stores information about snapshots (metadata). You’ll notice that the names of these files match the names of the snapshots.

NVRAM files – these files are the BIOS for the virtual machine. The VM must know how many hard drives it has and other common BIOS settings. The NVRAM file is where that BIOS information is stored.

VMX files – a VMX file is the primary configuration file for a virtual machine. When you create a new virtual machine and answer questions about the operating system, disk sizes, and networking, those answers are stored in this file. As you can see from the screenshot below, a VMX file is actually a simple text file that can be edited with Notepad.

What is a VMware Shapshot?

A snapshot is a picture of your system at the time the snapshot is taken. Think of it as an image of your computer’s hard drive. Besides just the data on the hard drive, the VMware configuration for that virtual machine and the BIOS configuration are also saved when you take a snapshot. The snapshot files that are created contain only the changes that have occurred to the virtual machine since the snapshot was taken. Thus, over time, the snapshot files will grow as the machine is used more and more.

What Snapshot files are created?

When a snapshot is created a number of files are created in the directory for that virtual machine.

  • -SnapshotX.vmsn (Where X is the number of the snapshot taken) This file stores the state of the virtual machine when the snapshot was taken.
  • -SnapshotX.vmem (Where X is the number of the snapshot taken) This file stores the state of the virtual machine memory when the snapshot was taken.
  • -nnnnnn.vmdk (where nnnnnn is the number of the disk image, not corresponding to the snapshot number) These are log files which store changes to the virtual machine, since snapshot was taken. There may be many of these files over time.

Snapshots in Workstation vs Server

VMware Workstation has the ability to create multiple snapshots and offers a very nice Snapshot Manager. The Snapshot Manager was introduced in VMware Workstation 5.0. With Snapshot Manager, you can view the snapshot tree. Each snapshot will be represented by a screenshot of what the screen looked like when the snapshot was taken. VMware Server lacks two important features: Snapshot Manager (multiple snapshots) and virtual machine cloning. In other words, in VMware server, you can only take a single snapshot and then revert back to that snapshot.

One alternative to taking snapshots that can be used in VMware Server is to shutdown the virtual machine and copy the vmdk, vmem, vmx, and nvram files. Later you could replace these files and your virtual machine would be back at the point of when that copy was made. This is a manual way of taking snapshots. However, this method takes much more disk space when compared to snapshots.

Summary

VMware snapshots are an extremely valuable feature of VMware. Currently, VMware workstation offers the Snapshot Manager, which offers the possibility of multiple snapshots. Currently, VMware Server offers only the ability to take a single snapshot. With snapshots, you can save the state of your virtual system BEFORE you make risky changes like installing applications, adding a new patch, or making a configuration change. When things go wrong, Snapshots can really save your day

Saturday, September 4, 2010

All about Bug or Issues

All about Bug, Error and Defects
Error: Mistake in code is error. Error is an undesirable deviation from requirement
Bug: if defect accepted by the development team it is called bug. Bug is an error found before the application goes into production
Defect: Defect is a variance from desired product attributes or normal flow. When defect reaches to end customer is termed as failure. Defect is an error found after the application goes into production.
Defects can be from product specification
Defects can be from customer or user expectation.
Attributes of Defect
1. Defect Naming – requirement defect, design defect, documentation defect
2. Severity of Defect
  • Critical (high) –show stopper
  • Major (high) incorrect output derived
  • Minor (Low) spelling mistake
3. Type of Defect
  • Wrong- requirements implemented incorrectly
  • Missing – requirement given by end customer but it were not implemented at all
  • Extra – requirement implemented correctly but were not requested by end customer
About Severity and Priority
Severity: Seriousness of defect with respect to functionality
Priority: importance of defects with respect to customer
  • · High: without resolving defect we are unable to continue testing
  • · Medium: compulsory to solve but able to continue
  • · Low: may or may not be resolved
Examples:
  • User interface bug- low severity
  • Calculation bug- high severity and high priority bug
  • Improper alignment – low priority and low severity bug
  • Spell mistake – high priority and low severity bug
  • Final output wrong – low priority
  • Dependent output wrong – high priority
  • Annual report print functionality not working – High severity and low priority issue
Components of Bug
  • Title of bug
  • Severity of bug
  • Priority of bug
  • Bug type
  • Module name
  • Assigned to
  • Project manager
  • Steps to reproduce
  • Actual output
  • Expected output
  • Attachment of log and screen shot
  • Comments
  • Test environment – browser, OS information etc
  • Build date and platform
Guidelines to write bug
  • Be precise
  • Be clear – explain it so other can reproduce the bug
  • Mention exact steps to reproduce with details
  • Provide sufficient test environment details
  • Mention build date and number with details
  • When you close your bug mention on which build and date you verify it, so in future if require to reopen it we can have track on which build it works last
Defect Density
defect density is the count of total defects identified against a particular software entity it is calculated as... no of defects/ size of software where size is typically counted in lines of code this is used to compare the relative number of defects in various software components, to find out the defect prone areas of the application

Defect density = Total number of defects/LOC (lines of code)
Defect density = Total number of defects/Size of the project Size of Project can be Function points, feature points, use cases, KLOC etc