Automating The Web Applications Using The Selenium Computer Science Essay

Published: Last Edited:

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.


The goal of this paper is to set forth the approach for "Automating the Web Applications Using SELENIUM RC (an open source test automation tool)". Selenium Remote Control (RC) is a test tool that simulates web browsers and supports six programming languages. Many software applications today are written as web-based applications to be run in an Internet browser. Selenium is a set of powerful different software tools working with many browsers, operating systems, programming languages, and testing frameworks each with a different approach to supporting automation test for testing web-based applications. JMeter is used to simulate a heavy load on a server, network or object to test its strength or to analyze overall performance under different load types. JMeter operates at the protocol-level, on the other hand, Selenium works at the user-level. With the use of the software framework, we efficiently improve the extensibility and reusability of automated test. Selenium RC provides only basic functionalities using the client drivers. But there is an effective way of expanding the functionalities by implementing the thought process to capture user actions automatically, creates a customized logger file, generation of customized test summary report.

Keywords-selenium; web; jmeter; automation testing framework


Recent progress in the Software Automation Industry has shown a tremendous framework implementation in order to execute test cases for bringing out a better quality web application. As millions of people are spending many hours of time in internet, due to which, the web applications are becoming more popular and increasingly more complex since the goal of it, is to impress and gain the potential market place. Thus the need for the code quality and maintainability has grown drastically and as a result, the need for testing of these applications has become more important. Testing the web application during the application development phase has become an integral part of the Software Development Life Cycle (S.D.L.C) and these tests are typically planned to check the functionality of the application.

As the web applications face a lot of enhancements, probability of conducting repetitive testing of the application functionality goes high and thus we go for test automation in place of regression testing. Test Automation is a strategic approach designed in a form of a framework to gain control over the execution of the tests.

The acceptance test of web applications often involves some manual tasks. Doing it manually, the operating personnel human error can occur easily. At the same, it wastes the time. The web-based applications were bearing the more and more complex business logic and more and more huge information platform formation, along with the characteristics of short release cycle and the quick regeneration. This requires the web application tests to be of comprehensiveness, expansibility and efficiency. The Browser carrying on web applications also was emerging in diversification and pluralism. It also increases complexity and workload for the web application testing. More attention should be paid to the web application testing efficiency, reusability, and comprehensiveness.

Aim at some problem mentioned above, the paper presents the test automation framework that was integrated by the two kinds of test automation tool Selenium and Jmeter.

Common Web test automation tools, such as QTP, Win Runner Load Runner, Robot, SilkTest, Selenium are used widely in automation test. Selenium can be said to be the most comprehensive of open source Web test automation tools, especially well support to the Web application which employed the BackBase framework.

Jmeter, Grinder, Multi-Mechanize, OpenSTA are common pressure test tools. However, Jmeter developed by Apache organization is an open source pressure test tool based on Java. It can be used on the server, the network or other object to simulate huge loading, in different pressure under a variety of testing their strength and analyze the overall performance, beyond that, it takes some kinds of test result reports.

Implement of the test automation framework shows that the test automation framework is convenient to carry on function test, performance testing, and loading test in web applications. It also shows that it has better test performance in reusability, extensibility, comprehensiveness, and feasibility.

We are all known that Selenium and JMeter software testing framework tools work at the different levels. Selenium works at the user-level while JMeter operates at the protocol-level. In order to easy to carry on different tests for a web applications and to share testing procedures and test data between different kinds of tests, this paper presents one test automation framework by an integration of Selenium and Jmeter.

II. Technical Overview

A. Selenium

Initially developed by Jason Huggins and released in 2004. Selenium is very famous as it is an open source suite of tools specifically developed for testing web applications. It supports a test domain specific language (DSL) to execute tests in many programming languages such as C#, Java, Ruby, Groovy, Python, PHP, and Perl.,

B. Selenium IDE

It is a Mozilla Firefox add-on which is capable of recording the user actions and also play-back. Since selenium IDE is an integrated development environment, Tester can also edit and debug the tests in above mentioned languages. Latest version of Selenium IDE is 1.0.10.

C. Selenium RC

It is a server / solution for executing linear / regression / integration tests. RC obtains the commands from the selenium server and run the tests via the browser. Recorded user actions from the selenium IDE can be obtained in any supported programming language then imported to eclipse for test case/suite execution. It contains the client drivers such as dotnet, java, Perl, Php, python, ruby and the selenium server.

D. Eclipse Java EE IDE:

It is an extensible open source IDE. It provides a number of aids that makes programmers /testers write code much quicker and easier than using a text editor. This means that a person can spend more time learning Java, less time typing. Here eclipse IDE is user to write test cases and execute it.


A. Well known automation frameworks

A "Test Automation Framework" is an integrated system that combines the set of assumptions, concepts and tools which provides support for automated software testing. The main advantage of such a framework is it defines the organization's way of doing things as a unique standard. If there is change to any test case then only the test case needs to be updated and the test suite and ANT script will remain the same.

There are several types of automation frameworks; some of the most commonly known frameworks include the following:

Data-driven testing

Modularity-driven testing

Keyword-driven testing

Hybrid testing

Model-based testing

Selenium Based Test Automation Framework

figure 1: framework structure

Till now we have a clear idea on the fundamental concepts of Selenium, eclipse and data driven framework, the next step will be to come up with a basic design for the overall test automation architecture. The framework contains some main components, they are as follows.

ANT script

Reusable Library

Library Files


Test Data

Test Report

Test Screens

Test Scripts

I. Test Suite

A. ANT script

A Script that is used to execute a set of instruction using build.xml. It is used to run single test or batch test. Single test could be used to execute a single test suite while batch test can be used to run multiple test suites.

B. Reusable Library

Reusable library consists of the common functions that can be reused. Reusable library consist of those functions that are application independent and can be called to perform certain tasks. It can also consist of a group of tools or utilities that will enhance the overall automation framework. In this case the reusable library is a collection of utilities that deliver the capabilities to create detailed drill down reports in different formats, help log events and save snapshots of tests that fail (snap shots or screen shots of failures).

C. Library Files

Library files consist of the major supporting libraries files which are necessary for the automation. For ex: selenium-server.jar, selenium-java-client-driver.jar.

D. Logger

Logger is mainly designed to help the user to view the step by step execution of the test scripts along with the time stamp, execution status whether it passed or failed. The logger component of the framework can be customized in many ways as per the user's knowledge.

E. Test Data

Test Data contains the excel workbooks with test data sheets holding the input values to the application under test.

F. Test Report

The test report is generated by ANT at the end of the test execution. The test report displays the overall execution status.

G. Test Screens

As mentioned earlier reusable functions are called to capture the screen shot of the failed tests. The test screen can be customized by the user in the script and could be used to capture the screen shot of the AUT where ever it is required. For Ex: User Name, Password entered wrong. The error message is used as an assertion to trigger the screen capture.

H. Test Scripts

The test scripts are the .java files which represents the test cases of the AUT.

I. Test Suite

Test suite is set up to cover execution of the specified test case name and the priority of the execution takes place contiguously.

IV. Testing Automation Framework Design and Implementation

The information about the same type of web applications abstracts way from the web-based test automation framework and form into a single configuration file. By doing so, we ensure that test automation framework and the application to be tested should be avoided interfere with each other, relatively independent. The test automation framework divides diversity interface elements and polygonal interface elements into non-variance elements and variable collection of space. It ensures that this test automation framework can be compatible with the same type of many applications, does not need any modification.

We have designed a test automation framework by employing selenium test tools with supporting a variety of Web browser for solving web applications compatibility across the browsers (Figure 2). It provides testers with a simple interface. It lets testers to configure different browsers conveniently for web application test.

In order to provide testers with tool to simulate browser to send a variety of reasons of request functions to a web application server, Jmeter function was integrated into the test automation framework designed in this paper. It will do not cause any inconvenience to the performance test in which the browser was opened and PC resources were occupied. At the same time, a test automation framework can prepare a mass of data for performance test by directly configure data resources.

In order to ensure universality, the test automation framework designed in our work not only provides testers with unified test cases, but also leaves the extensibility space for introducing other test tools in the future.

Using the new test automation framework, testers can configure a test type easily just through modifying a test type and can switch among different tests without altering any elements related to test cases.

figure 2: a web-based test automation framewo

A. General Structure of the Integrated Automation Testing Framework

The integrated auto testing framework designed in this paper includes five components listed the following (Figure 3): implement name of workers (Translator, Actionworker, Comparator, testresultCollector).

Model: This component contains the object model which is converted from XML. Such as Action, Assertion, Element, ApplicationData, Cases, ToolsSetting.

Translator has two steps. The first step is to translate each test case into sets of actions related to the different testing types, such as UI, backend, and loading test. The second step is to translate each set of actions into specific tools' commands/scripts depending on the tool employed in doing the actual testing.

ActionWorker function is to call the corresponding tool to do the specific actions.

Comparator function is to compare the test result with the expected result. Comparator has two parts. One is to collect the test result and expected result. Another is to compare against the expected result.

figure 3: component diagram

a) Model (Overall Entity)

These classes in the below are entity, and they relate to the testsuite XML, application background XML (Refer to Figure 4).

b) Function Description

Functional tests are intended to help testers verify that a system, as a whole, functions as intended. Such tests verify that everything is wired together correctly. Therefore, we define a set of functions for the new test automation framework .

c) Overall Process Flow

The testing framework has basic five steps:

1) By using xmlObjectConvertor() to convert the test case to TestCase entity, convert the test steps of test case to TestCaseAction entity, convert the assertion of test case to Assertion entity, convert the application background xml to ApplicatonData entity;

2) To combined the test cases with application data;

3) By using translate() function to translate the case to TestToolCase;

4) To call the specific actionworker for specific testing tool to do the TestToolAction with the doAction() function;

5) To collect the test result for the specific testing tool by collectTestResult() function, and collect the expected test result by collectExpectedResult(), then compare the test result with the expected result with compare() function.

B. The hierarchical structures of The Integrated Automation Testing Framework

figure 4. overall entities

A) Translator

Translator has two levels. Translate the test case which is prepared by tester to a tool test case which can be recognized by a specific test tool. The translator layer process flow like the following:

To get a translator name with a specific test type by getTranslatorName() function;

To translate the test case to a scope testcase with a specific translator name by getTranslatorInstance() and translate() functions ;

To get a translator name with a specific test tool by getToolTranslatorName() function;

To get a tool testcase from a scope test case by the translator by getToolTranlsatorInstance() and translate() functions.

B) ActionWorker

This component creates a specific actionWorker and then does the specific actions.

The actionworker layer process flow like the following:

1) To get a actionworker name by getActionWokerName() function;

2) To get a actionworker instance by getActionWorkerInstance() function;

3) To do action by doAction() function with the actionworker in the last step.

C) Comparator

This component can make sure whether the test case is successful or not. This component collects the test result and collects expected result, and then do the comparison on the two kinds result.

The main steps are listed in the following:

1) To get an instance test result collector to collectTestResult() from the getTestResultCollectorInstance() function with getTestResultCollectorName();

2) To collect the expected result of the running test case by collectExpectedResult();

3) To get an instance comparator from the getComparatorInstance() function with the getComparatorName() function;

4) To compare the test result with the expected result by compare() function, and then give the result of comparing.

V. Testing the Framework

The web-based test automation framework, like any another being developed, needs testing. As a new test automation framework, there are no tests to perform and all tests need. We must evaluate its performance of reusability, extensibility, compatibility, and universality in particular.

In order to test the performance of sharing test processes and test data between UI test and performance test. The test processes are designed as following:

Step1. To prepare all data for IU system and data for test tools configuration item, that is, to prepare the test cases and test type configuration file for both UI test and load test.

Step2. To launch the test automation framework, start UI test for IU system, modify default browser class of configuration items in test tools

Step3. To Change test type into load test first, and then to launch the test automation framework, final modify test parameters of load test for examples, each request spacing interval, How many requests launch at same time, How many threads need to implement these requests?

VI. Conclusion

The new testing automation framework integrated by Selenium and Jmeter can share the test steps and test data among different testing, such as UI testing, backend testing, loading test and so on. It is convenient to switching in various types of testing for web applications. It supports multiple browsers and a variety of operating system. It can be widely used in web application test automation.