Servage Magazine

Information about YOUR hosting company – where we give you a clear picture of what we think and do!

Working with acceptance testing

Saturday, December 3rd, 2016 by Servage

AcceptanceTestingSoftware testing is important, and hopefully all developers agree with it. Finding a bug at an early stage is much easier and cost-effective to solve than letting it go unnoticed for a long time. But how does testing a web application work? Let’s look into one way to do it: Acceptance Testing.

Acceptance Testing explained

Acceptance testing means the process of testing that an application works as it should. In a web application it works by clicking buttons, submitting forms and tweaking settings. Acceptance testing is usually the last step of testing. If you have different types of tests, you usually run unit and functional tests before acceptance tests.

In acceptance testing, the tester does not care about the underlying implementation of the software. The tester does not have to know how a specific feature has been coded or what libraries and classes it depends on. What the tester cares about is that the application does what the tester expects it to do. This all means that acceptance testing can be performed by a non-technical person. The tester can be a customer, manager or a professional software tester. It can even be a web browser!

Automating web browsers

To make acceptance testing as efficient as possible, you can write tests that automate a web browser. The advantage in doing this is that you can test your application as often as you want, without being dependent on the schedule of a testing person. There are many ways to control a web browser in your tests. The most common way is to use Selenium, a tool that sits between your code and a web browser. You send a command to Selenium inside your test and Selenium performs the operation with a real browser. You can for example tell it to click an element on a web page or to sign in to your application.

Selenium can be used with many languages. For web developers, it is available in JavaScript and PHP. It also supports many testing testing frameworks, such as Behat and Codeception for PHP developers. On a technical level, Selenium is a program that you start before running your tests. It runs on port 4444 by default, and testing frameworks connect to this port by default.

When you start an acceptance test, Selenium will open a real web browser window and run all tests within it. This gives you the advantage of being able to see what is going on during a test, which helps you to spot any errors you have made when writing a test. You can easily make sure that correct elements are interacted with, and you can see the results in real time. It is of course possible to leave a test running and review a summary of the test results when the test is over. How this works depends on the testing framework you use. If you would like to give acceptance testing a try in your own application, go ahead and download Selenium and Codeception. Codeception is easy to get started with.

Working with acceptance testing, 5.0 out of 5 based on 2 ratings
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

No comments yet (leave a comment)

You are welcome to initiate a conversation about this blog entry.

Leave a comment

You must be logged in to post a comment.