Showing posts with label selenium. Show all posts
Showing posts with label selenium. Show all posts

Friday, 11 October 2013

Automating Form Testing with Selenium IDE

Testing Forms

Automating the testing of forms helps speed up the test process and saves having to do the repetitive work of filling the form with test data.

We use Selenium IDE for our form testing because it is simple to use and is integrated into Firefox.


Screen shot of our website and selenium IDE overlayed
Selenium IDE

Test Suite

With the redesign of our enhanced listing signup form we needed to rewrite our selenium test suite for testing the signup form.

Using selenium IDE we can record our actions in the browser and replay them so we can step through every test and check the form works as expected.

If you have used unit testing before selenium and its concepts will be familiar to you, with selenium the tester can assert things such as checking for error strings in the form when the form has been submitted or asserting a page has the desired title or heading.

We first start by testing the form to make sure that our error checking is working we like to test all the required fields in a form and stepping through each required for field and asserting the error string is present in the form.

Then we move through the form testing any other constraints such as passwords not matching and finally check the form with correct data to verify it works correctly.

Recording your browser is as simple as clicking the record button in the UI and then carry on as usual, you can also access rules and statements by right click your mouse or adding them directly from the IDE GUI.

Conclusion

When you need to test a form using selenium to drive it makes sense and it saves time and effort when rerunning any tests. We like to use test driven development to help improve the standard of our code base.

Very soon we will be moving The Care Homes Directory over to using a pure div layout for the whole website in an attempt to improve keyboard navigation of our website for improved accessibility for non mouse using visitors.

And releasing a new improved enhanced listings sign up form and Google wallet payment support which greatly improves the users experience.

Also we are adding aria data to our website and are improving our <nav> structure so we can improve our breadcrumbs.

Saturday, 11 May 2013

Development Platforms and Practices

3C Web Development

In this article we will be covering the development environment and platforms that Chic Computer Consultants use while developing The Care Homes Directory website. We will cover what tools we use and the reasoning behind our choices.


Platforms

When we begun developing The Care Homes Directory we decided upon using the LAMP stack as our server platform. Our web server is a quad core, 4GB RAM, SSD machine running Debian 7.0 (Wheezy x86_64) and Apache 2MySQL 5 and PHP 5 sitting on top.

This platform has been very stable for us and we currently have a good amount of unused resources. While monitoring a server you can use the utility top to get the load average for the machine giving you an idea of how busy the machine is (or cat /proc/loadavg).


An image of a GNU laying down listening to music on some headphones
GNU/Linux


We have heavily customised our server changing the default scheduler to use a deadline rather than cfq. We also configured our TCP stack and installed PHP accelerators. We decided to use XCache for PHP optcode caching.


As well as these changes we modified the MySQL, PHP and Apache configuration to provide a faster install. On top of all this we did the usual hardening and configuration of a GNU/Linux system you would expect.



Bugzilla Bug Tracking

Even the best software has defects so obviously when developing you need to have a system for tracking bugs we use Mozilla's Bugzilla for our bug tracking.

We can raise any defects and/or enhancements to our code base directly from a web browser which is great for our testing team.


Screen shot of the Bugzilla home page.
Mozilla's Bugzilla
Before we release any software it must go through regression testing using unit tests and also any other use cases which need to be tested for before being sent for Q&A and general release.

We try to follow a rolling release schedule and use agile development to produce incremental updates to our code hence why rolling releases suit us.


Subversion Version Control

For source code revision control we decided to use Subversion rather than CVS or git which were the other two candidates we chose (we were already using Subversion when git was released). Subversion fits all our use cases and we have found it easy to use.

We have a main repository which allows all developers to access our source code and work independently of each other and when any changes have passed Q&A then it is merged into the trunk and tagged as a stable release.

To help add security (adding layers is good) when providing remote access we run everything over SSH tunnels including sftp so for accessing our repositories we require svn+ssh be used.

Subversion apache website screen shot.
Subversion


We did not go with CVS due to problems with it handling binary files and some people would consider it a bit "over the hill" and should be superseded by Subversion. Although we have do have previous work experience with CVS which went in its favour.


Recently we reviewed our choices and had a look at what git has to offer but we decided to stick with subversion as it has worked perfectly for us so "if it aint broke dont fix it", although git's distributed nature is appealing to us for the obvious replication advantages.



Developer Workstations

Our developer workstations run Mint GNU/Linux which is a derivative of Ubuntu which is another OS we allow on our workstations. We do use other operating systems inside the company but we are mainly a GNU/Linux house. The other OS we use are Windows, Android and iOS.

We do not use any IDE for our web development as we find gedit and Filezilla a good combination for any PHP, Python or working on writing markup. We do use Eclipse when developing in Java but that is beyond the scope of this article.


Mint & Cinnamon


In regards to our testing environment this will be covered in another article which will follow the release of this document. Selenium is a great tool for browser automation and we have test units which make use of it. We also make use of other tools but again this is for a future article.



Conclusion

I hope you have enjoyed this article and it has given you an insight of our development environment and how we like to approach things.

We will be writing another blog post about how we tested porting our site to HTML 5 and CSS3, the cross browser support issues we encountered and a little bit about our methods for testing our software.

Please take a moment to visit our Facebook page.