August 21, 2014 by Roman Ožana

3 Sample Test Cases for Testing an Online Application

This article was originally written in Czech by Testomato and Wikidi tester Barbora Urbancova. It has been translated and posted here with her permission. 

You need to test. 

We’ve all heard it before, but how often does it actually happen?

I’ve spoken with a lot of friends on this topic, who work in corporates or smaller companies where programming is dictated by contracts and deadlines.

It’s not uncommon for them say something like:

“Of course we should test, but no one ever has time. Even our project managers usually tell us to skip testing.

If we do have tests and one fails, we’re told to comment it out because there’s no time, and it’s more important to finish before the next release.”

Early testing can save you the pain of rewriting and searching for hidden faults, but despite this, most managers don’t view it as a priority.

So, how can developers still test applications for themselves? Automation.

I’m lucky enough to work at a startup with a founder who’s excited about new technologies and methods.  As a result, we actually test each version of our applications consistently.

And almost all of them run automatically.

For today’s post, I’ll show you how to set up 3 test cases using an automated testing tool like Testomato.

Start with What You Know

I’ve chosen HipChat to use as an example, and I’ll show you what I’d do if I were responsible for testing its quality.

Let’s get started.

Before you can do anything, you need to know what to test.

Brainstorming Test Ideas: Assumptions

Once you’ve got the app you want to test in mind, it’s a good idea to do a quick brainstorm about its functions to come up with ideas for your test cases.

HipChat is a hosted chat service provider (which we use at Testomato) and has the following features:

  • 1-to-1 and group chat
  • Video chat
  • File sharing
  • Screen sharing
  • Desktop and web app
  • iOS and Android native apps

I’ll be using the web version for my test cases.

A lot of things should come to mind when you start considering what functionality to test on HipChat.

Here’s my list:

Mainpage

  • Buttons – Sign Up and Sign In
  • Video tutorial
  • Links to platforms
  • Footer links

Users

  • Account security
  • Registration
  • Logging in
  • Logging out
  • Sending 1-to-1 messages
  • Joining group chats

 Contacts

  • Adding a user to contacts
  • Viewing online contacts
  • Notifications

 Group Chats

  • Sharing files
  • Mentioning other users

This is not even close to a full list of HipChat’s functionality, but it’s all I’ll mention now for the purpose of this post.

My 3 Sample Test Cases

From my list of ideas, I’ve selected three to create test cases for:

1) Sign Up on Homepage
Starting pointStepsExpected BehaviorPrerequisites
HomepageFind the Sign Up button on the top of the page.Redirect to the page:internet connetion, web browser
Click on it.https://www.hipchat.com/sign_up
2) Sign In on Homepage
Starting pointStepsExpected BehaviorPrerequisites
HomepageFind the Sign In button at the top of the page.Redirect to the page:internet connetion, web browser
Click on it.https://www.hipchat.com/sign_in
3) Signing In
Starting pointStepsExpected BehaviorPrerequisites
HomepageFill out the form:Redirect to the page:internet connection, web browser, a test user account.
Email:
example@domain.com
https://domain.hipchat.com/homeEmail:
example@domain.com
Password:
password
Found text: “Welcome, Example.”Password: password
Submit by clicking the Sign In button.

I’m going to take you through these three cases using Testomato as my automated testing tool, and afterwards, you should be able to create your own tests independently.

Automated Testing in Action

When you start testing, the first thing you need to fulfill are the prerequisites.

Here’s how to do it:

  1. Create an account on HipChat. Remember the username and password. In this example, I’ve used a nonexistent user “example@domain.com” and the password “password”.
  2. Register an account on Testomato (if you don’t have one yet – it’s free to sign up).
  3. Create a new project by clicking +Add project. Enter the URL https://hipchat.com/  into the form.
  4. Click Create new project.
    Create a new Testomato project.

Test Case 1 & 2: Sign In and Sign Up Buttons

Once your project is created, you’ll see some tests have already been added automatically to your project dashboard:

Click the gear icon to edit tests.

Edit the names of tests for the Sign In and Sign Up pages by clicking on the gear icon. I’ve chosen to name my tests:

  • Test Case – Sign In
  • Test Case – Sign Up

Test Case 3: Signing In

For this case, you’ll need to manually create a test for signing in.

Here’s how to do it:

  1. Click on Create password protected area.Create password protected area.
  2. Fill in the URL: https://www.hipchat.com/sign_in. You can also use the path /sign_in.Enter URL for password protected area.
  3. Find the login form marked as signin (it’s the only option) and click Select.Select the sign in form.
  4. Fill in the Area Name (e.g. Logged In) and enter your credentials.
    Email: example@domain.com
    Password: password
  5. Test your login by clicking Verify credentials.Enter and verify credentials.
  6. Click Save.

Once you’ve created your new Logged In password-protected area, set up the following tests to check for redirection and homepage text:

  1. Click Add test.Add a new test.
  2. Add the URL: https://domain.hipchat.com/.Enter the URL.
  3. Click Submit.
  4. Click Next and check the box next to check for string occurrence.Check for Welcome, Example.
  5. Enter the phrase “Welcome, Example”. (Don’t forget to replace “Example” with your real name!)
  6. Click Save.

Your tests should pass, but if something goes wrong, you can click the gear icon to re-configure them.

If you have any questions, check out the Testomato Help Docs or contact the team directly: support@testomato.com.

Final Tips

Try deploying the same tests above on a working version of your own application to see if automation works well for your development process.

Using a simple tool like Testomato won’t cost much time or effort, and if something does go wrong, you’ll receive an email immediately about the error so you can correct it in a few minutes.

How do you come up with ideas for test cases?

Let us know in the comments below or on Facebook. You can also tweet us directly @testomatocom.

Is your website available? Testomato can check your website availability every 15 seconds from 10 different locations around the world and will send you an alert if the site is unavailable.

Keep track of the important parts of your website with simple checks that can run every minute. They can check plain words, HTML code, HTTP headers, redirects … and much more. Never miss anything.

Websites break, it happens all time. You'll be the first to know. Testomato has an extensive database of and will let you know if it finds any error on monitored url.