Stripe testing: Test your payments manually or with automation tools

By Andrew Luna | August 19, 2022

Did you know testing Stripe is not as daunting as it may seem? One of the trickiest ordeals is knowing how to properly test credit card payment methods. But luckily, it is possible to test Stripe with ease. Knowing the payment system on your eCommerce website is functioning without unexpected is essential to all business owners.

In this article, we'll discuss what Stripe is, how to get started with testing Stripe, but also how to sign up for an account, and how to create a test product so that you can start taking payments with ease and confidence. We'll also provide tips for troubleshooting errors during the testing process, and outline some of the most common issues that can occur when setting up payments with Stripe. So whether you're just getting started with online payments or you're looking for a more advanced solution, Stripe is definitely worth considering!

What is Stripe and what do they offer merchants?

Stripe is a payment processing service that allows businesses to accept credit and debit card payments online. They offer a wide range of features, including the ability to process payments in multiple currencies, set up recurring billing, and track customer data.

Stripe also offers a number of security features, such as fraud prevention and data encryption. And best of all, they have a very simple pricing structure.

How to test Stripe?

Getting Started with Testing

Before getting started with testing, it is essential to have a testing environment set up with the Stripe payment system in place. This includes having Stripe integrated into the eCommerce website. The best part about testing is that there are no requirements for using actual payment systems, so don’t worry about spending money. 

There are many benefits to using test credit data since this will provide several of the following testing scenarios:

It is essential to be able to identify any issues and confirm the eCommerce website is properly handling these scenarios with the integration of the Stripe payment system. It is important to ensure that when the credit card has a declined payment, or if the user opens a dispute, there will not be any issues.

Using Test Credit Cards

Thankfully, the Stripe website does provide test credits so testing is not as complicated as it may seem. In order to test these credit cards, you will need to enter the test credit card numbers plus the CVS and Date. Stripe does provide the test credit card numbers, but keep in mind that the CVS and Date are not. In order to test this, the data needs to be randomized. 

For example, if you are testing a Visa credit card, Stripe has the numbers 4242424242424242, then the CVC and Date can be any combination such as 342 and 12/25/2026. This will make it easy to test with any combination as long as the credit card is a recognizable test number. 

Test Scenarios

As mentioned there are multiple test scenarios to plan for. The most important one to test for is successful payments. It is imperative that the team tests numerous credit cards from different brands and countries. The most common credit cards include Visa, Mastercard, and JCB. 

In addition to testing successful payments, the Stripe website also includes numbers for stolen cards. This is equally important since the number of fraudulent transactions is on the rise. Being able to identify when a credit card is stolen or being used for a fraudulent transaction is essential because this will avoid headaches later with your eCommerce business. 

Refunds are another test scenario to plan for. It is essential for your eCommerce business to provide refunds to customers. The last thing you would want is to have an unhappy customer. Having a positive review is a must for any business since it provides customers with peace of mind. 

Stripe Automated Testing

After the Stripe payment systems have been manually tested thoroughly and integrated successfully, it is time to consider automation testing. There are different automation testing tools that can be such as Selenium, but in this article, I will focus on using UIlicious. Thanks to the ease of use, UIlicious is an ideal automation tool for automating the Stripe payment process for your eCommerce website. 

When the checkout process is automated on your website, the chances for unexpected errors are greatly reduced.

Look at this test example running on UIlicious:

This automation was made possible with the following script:

I.goTo("https://allblackshop.com/")
I.click("Accept")

I.hoverOn("Shop All")
I.click("Bags")
I.see("All Blacks Backpack")
I.click("Add To Cart")
I.click("Checkout")

//Fill in Address Details
I.fill("First Name", "John")
I.fill("Last Name", "Kent")
I.fill("House Number", "12345")
I.fill("Town / City", "Sample Town")
I.fill("Postcode", "12345")
I.fill("Phone", "123456789")
I.fill("Email", "[email protected]")

//Choose Shipping option
I.select("Express")
I.wait(10)

//Fill In Credit Card Details
I.select("Credit Card")
UI.context("iframe[title='Secure card number input frame']",()=>{
	I.fill("Card Number", "4242 4242 4242 4242")
})
UI.context("iframe[title='Secure expiration date input frame']",()=>{
	I.fill("Expiry Date", "12/29")
})
UI.context("iframe[title='Secure CVC input frame']",()=>{
	I.fill("Card Code", "123")
})
I.select("I have read and agree to the website")
I.click("Place Order")
I.see("The card was declined.")

As you can see, UIlicious is a low code-based tool. But, it also has a monitoring feature that enables automated tests to run on a scheduled basis. By using test credit cards with your UIlicious automated testing scripts, both the checkout process and payment system will be fully tested. This will save time and money.

Sign up for UI-licious now

Tips for troubleshooting errors during the testing process

If you encounter any errors during the testing process, here are a few tips that may help:

Frequently asked questions about Stripe testing

How to sign up for a Stripe account?

Signing up for a Stripe account is quick and easy. Just visit their website and enter your email address. You'll then be sent a confirmation email, and once you've clicked the link in that email, you'll be taken to a page where you can enter your business information.

How to create a test product in Stripe

Once you've signed up for a Stripe account, you can create a test product so that you can start taking payments. To do this, log in to your Stripe account and click on the "Products" tab. Then, click on the "Add product" button.

Enter the name of your product, a description, and the price. Then, select "Add product."

Your product will now be listed in your Stripe account, and you can start taking payments!

What to do if you use an eCommerce CMS like Shopify or WooCommerce?

If you use an eCommerce CMS such as Shopify or WooCommerce, then you can connect your Stripe account so that you can start taking payments. To do this, log in to your Stripe account and click on the "Connect" tab. Then, follow the instructions on the screen to connect your account.

Then, when your website is ready to be published, you can start testing your payment gateway as explained in the dedicated section above.

How to test the payment process with a real credit card?

To test the payment process, you'll need to use a real credit or debit card. To do this, log in to your Stripe account and click on the "Payments" tab. Then, click on the "New payment" button.

Enter the amount that you want to charge, and select the currency. Then, enter your credit or debit card details. Once you've entered all of the required information, click on the "Charge" button.

You should now see a confirmation message indicating that your payment was successful!

How to test the full checkout process on my eCommerce website?

If you're using an eCommerce platform such as Shopify, Magento, or WooCommerce, then you can test the full checkout process on your website.

The easiest way to test as many scenarios as possible is to use automated testing tools such as UIlicious. These tools will allow you to simulate real user interactions, such as adding items to a shopping cart and entering credit card details.

You can also use manual testing to test the checkout process. To do this, add items to your shopping cart and attempt to checkout using a real credit or debit card.

Manual testing can be a time-consuming process, and it can be difficult to test every possible scenario. Additionally, manual testing can be error-prone, and it's often difficult to track down the source of errors. This is why automated testing tools are often the preferred option for testing eCommerce websites.

Start using UIlicious for free by signing up today.

Conclusion

Testing is an essential part of the development process, and it's especially important when you're working with payments. Stripe makes it easy to get started with testing, and there are a variety of tools that you can use to test your website or application.

By utilizing Stripe’s test credit cards for your testing, there will be no unexpected surprises with your product. Customers will be able to shop without any payment issues. With so many different payment types, it is always important to have your bases covered. Plus, by automating the payment and checkout process with UIlicious, any found issues will be urgently addressed thanks to the notification system.

If you're using an eCommerce platform such as Shopify, Magento, or WooCommerce, we recommend using automated testing tools such as UIlicious. These tools will save you time and help to ensure that your checkout process is working correctly, and any found issues will be urgently addressed thanks to the notification system.

Happy testing!

Sign up for UI-licious now

About Andrew Luna

I love to write about all things related to QA and UIlicious.