Automation Testing, Why It’s Needed and a ‘How To’ Introduction to Selenium WebDriver

29August2018

When it comes to software, everything created must go through the testing process before it can be handed over to the user and go live as part of quality assurance (QA). As far as web browser-based tools go, Selenium is the top Web Browser automation testing tool and is recommended by the World Wide Web Consortium (W3C).  Testing is required to catch mistakes and is necessary for producing working and effective software products.  Errors in coding have caused many problems from product dissatisfaction and loss of revenue to other mistakes causing accidents or deaths.  For instance, bugs in the code of software systems have caused money to disappear from accounts, customer data to be lost and even more egregious, medical-related deaths in healthcare for patients.

While software testing can be done manually, there are limitations with manual testing.  Manual testing is often time consuming, tedious and inaccurate, creating room for additional errors.

These problems in manual testing can be overcome by automation testing, which tends to be faster and more accurate, and by definition, repeatable.  Automation testing is conducted using a testing software tool to check the application software under test. Some of the popular automation testing tools include Selenium, Katalon Studio, Cucumber, Unified Functional Testing, Watir, IBM Rational Functional Tester, and TestComplete. When it comes to Web application automation testing, Selenium takes the lead, especially since it is open source. Unlike other automation testing tools, however, Selenium can only be used in Web application testing and cannot test native/client-server applications.  

If using Selenium, testers need to write test scripts that be written in a language of their choice from Java, JavaScript, Python, C#, PHP, Ruby, and Perl. Selenium runs on Windows, Mac or Linux.  Test scripts can be executed on Mozilla Firefox, Internet Explorer, Google Chrome, Safari or Opera browsers.  Selenium simulates user actions in the browser.  

With Selenium WebDriver, a skilled automation tester can do different types of automation testing of WAUT (Web Application Under Test), like static element testing, dynamic element testing, link testing, functional testing, and Ajax testing.   Below is a description of each of these tests.

Static Content Testing

The easiest of web tests.  It includes non-changing static UI web elements, such as page title, page heading, and text inside the page.

Dynamic WebElements Testing

Some web elements’ attribute values may change after a while within the page. These values are generated dynamically and vary in each instance on the DOM. The same element has different attribute values once the page is reloaded or after a few seconds even if the page is not reloaded based on page functionality.

Testing Links

This test is used to check whether the links are working properly in a WAUT and is very common in automation testing.  Often, it is found that either the link is incorrect, or the pages it points to are missing. 

Functionality Testing

This test is one of the most important tests in automation testing and is very complicated to conduct in most cases. For instance, if we need to verify login functionality on a Web application, we need to input information related to valid or invalid credentials.  Since the data has to be accurate to verify the test case, it is difficult to keep the data accurate again and again during regression testing.  Additionally, all functionalities of WAUT need to be checked to ensure that it works as specified in its requirements. It includes input fields, cancel button, submit buttons and so on.  The options for user input can be drop-down lists, check boxes, radio buttons, text-input fields or any other inputs suitable to implement for log-in, sign-up, settings changes, as well as data retrieval operations. 

Ajax Testing

AJAX (Asynchronous JavaScript and XML) is a set of interrelated techniques for web application that is used on the client side for creating asynchronous web applications. Generally, AJAX displays dynamic content on the web page and updates a portion or part of a web page or a single element without reloading the entire page. The entire page is not updated but typically parts of the page are after obtaining content from backend services using XMLHttpRequest (XHR). WebDriver is designed to locate AJAX elements.

Hopefully, this gives a glimpse into the need for automated testing and how Selenium WebDriver is used.  We will explore more on automated testing with Selenium in future blogs.  Check back with us soon!