You are on page 1of 10

Vol No. 1 Issue No.

1 International Journal of Interdisciplinary Engineering (IJIE) ISSN: 2456-5687

CONVIVIAL AUTOMATED TEST FRAMEWORK


B.Suryanarayana Murty1 Prof. P.V.G.K.Jagannadha Raju2
M.Tech (CSE) Pin: 14551D5802, Department of Computer science and Engineering,
Godavari Institute of Engineering and Technology, Godavari Institute of Engineering and Technology,
Rajahmundry, Andhra Pradesh, India. Rajahmundry, Andhra Pradesh, India
suryabh@hotmail.com pvgkjraju@gmail.com
ABSTRACT

Web, API application testing become challenging due to the requirement of various browsers, multiple versions and
operating systems. Also, itrequiresmore number of manual testers. Providing test reports in various formats and
publish them to stake-holders is a tedious job. At present lot of proprietary tools are available for writing tests but
maintenance, training, programming knowledge and licensing cost for using these tools are very expensive. Also,
these tools may not fit in Continuous integration development and delivery model which is very not helpful for the
testersto run automation and find code related issues with each push. Testers run the same tests multiple times in
different phases of project development life cycleincluding requirement prototyping, development, pre-production
and post-production. An automated testing framework has been proposed here for testing web applications. The
proposed framework is based on command driven framework in which an excel file containing the commands is
imported to the framework by using selenium WebDriver API.

Keywords: Software Testing, Automated Testing framework, Keyword Driven Framework, Selenium Web Driver

I. INTRODUCTION
There is a paradigm shift in the software development industry. It is being driven by business demands to
create larger and more complex software products in less time with great quality. How is this shift changing
the way software is produced? The paradigm shift may be characterized by two words: infrastructure and
automation. So what does all of this have to do with the developer?
In this paper, we propose our infrastructure and automation-based approach, together with the set of best
practices and later explain the implementation details and a new test automation framework architecture that
combines several control structures, which is easier to control the workflow of tests and test browsers. This
framework is namedas CATF, which is an abbreviation for Convivial Automated Test Framework. This
paper reports on applications of CATF for supporting automated testing steps in practical products and
benefits from using this framework.

II. BACKGROUND

This section introduces various frameworks and the analysis of the optimal framework for the application
under test. This also includes the background of CATF. There are many frameworks that provide support for
automated software testing such as, Fit, FitNesse, Silk, QTP, Winrunner, Test Automation FX, and
Concordion, ranging from decent to average and from free to very expensive.

Fit is an open source and free tool for automated customer tests. FitNesse is a Wiki built on top of the
Fitframework, which is used for automating acceptance criteria test cases. FitNesse is most suitable for
acceptance test tools to communicate between various stakeholders in the agileenvironment. FitNesse is
excellent as a collaboration tool for communication with customers, but weak as a basis for testing in
distributed environments. Yet it does not allow remote cloud execution.

Silk is a proprietary Automation tools which follows its own syntax and language. Limitation of Silk is
support to only few browsers and licensing cost per user which is expensive. If more testers want to execute
then companies have to spend lot of money. Also, every tester needs to learn itsown syntax and how to use it
effectively.

September 2016 Inside Journal (www.insidejournal.org) Page | 6


Vol No. 1 Issue No. 1 International Journal of Interdisciplinary Engineering (IJIE) ISSN: 2456-5687

STAF is an open source; multi-platform, multi-language framework designed around the idea of reusable
components called services. STAF does allow distributed execution, meaning that tests can be executed from
a STAF control machine which are sent to and executed locally on either the client or server machines. The
results are returned back to the control machine for reporting. It is designed to be used as pluggable STAF
Execution Engine (STAX) for automated test case distribution, execution, monitoring, and results analysis.
However, writing a STAX job file in xml/python and understanding the workflow of tests through xml file
are not easy.

Selenium and STIQ are software testing frameworks for web applications. Selenium tests can be written
as HTML tables or coded in a number of popular programming languages and can be run directly in most
modern web browsers. The STIQ tests are written using the FitNesse wiki, with Selenium commands and
can be run directly in most modern web browsers.

HP QuickTest Professional (QTP) is software for testing applicationswhich is designed by Lalwani.


Using this tool we can automate tests which can run across multiple browsers. We can also automate some
non-user interface based test automation such as filesystem database testing, web services testing and
operationstesting but it supports very few programming languages.

Concordion is an opensource tool for managing and writing automated acceptancetests in JAVA project
in various operating systems.This requires an HTML sourcedocument and executes using JUnit but it not
very effectivetool for testing web application because it does not allows totest the functionality of the web
applications.

III. PROPOSED METHODOLOGY

The objective is to create a reusable Framework which is an independent of application that could be
utilized specificallyover any application without investing an additionaltime. Keeping in mind the end goal
is to make all thecomponents of the framework is to work, it is vital to specifyits components and its
functionalities, and the coupling relationship between them.

A.The Proposed Framework Architecture

The proposed Command driven framework is based on theidea of testing the web application using
specific commands. These commands have meaningful name and functions associatedthat are common to
almost every web application sothat any user can easily create automated test scripts usingthese commands
without any knowledge of programminglanguage. The proposed framework works with seleniumwebdriver
which is an open source tool hence, it is cost efficient framework. In the proposed framework tester can
create test cases byusing Microsoft excel using the variety of commands. As thetest get executed the
framework process the excel file andexecute the functions present in the driver script one by oneagainst the
commands present in the excel file. The specificactions are performed on the application according to
thefunctionality of the commands. Below figureshows the variouscomponents of the Command Driven
Framework and eachcomponent are discussed below.

Figure 1: Architecture

September 2016 Inside Journal (www.insidejournal.org) Page | 7


Vol No. 1 Issue No. 1 International Journal of Interdisciplinary Engineering (IJIE) ISSN: 2456-5687

Driver Script is the main file that operates with the logicprocessing of the Command scripts according to
which theactivities are performed on the application under test duringtest execution. It contains all the
methods and functions ofthe Commands and collaborates with the Selenium server tolaunch the web
browser. It includes importingthe Commands and data located in the Excel sheets and mayalter the report on
update.Commands trigger particular functions in the Framework toperform a particular operation on the
desired object in theapplication.

These essential Commands are stored in Excelsheet and fed to the Framework as an input.Test reports are
generated after execution of the test script.These reports are modified in the system such that theoutline
report and the detailed report are put in HTMLformat. This report indicates that which of test scripts
havefailed while running a test suite. The brief report givesdetailed elements of execution, length of time,
test begintime and end time. The detailed reports described the test cases handled, steps passed and steps
failed.These aides in performing powerful observation on theexecution report.

B.The Proposed Commands

The list and functionality of keywords that are considering in this command driven Framework for testing
web application are given below.

1.openBrowser: This keyword is used for opening a browser such as Firefox, Internet Explorer and Google
Chrome. Any one of the browser can be chosen for testing web application.
2.navigateTo: Command is used for giving the URL tothe Framework. URL name is given to in the same
excel fileas a parameter to driver script and the driver script will openthe same URL in the browser window.
3.clickElement: Command is used for clicking the HTMLelements present on the webpage like links,
button, images etc.
4.sendKeys: This keyword is used to give input to the textbox present on the page like email address or
password etc. The input associated with this keyword is also stored in thesame workbook.
5.verifyElement: This keyword is used to verify the element presenton the page or not. This function will
wait for the browser toload the webpage before verifying the element on the webpage. The Framework script
will not run furtherif the element is missing on the webpage.
6.closeBrowser: This keyword is used to close the runningbrowser after completing the test steps.

Figure 2: Framework flow

September 2016 Inside Journal (www.insidejournal.org) Page | 8


Vol No. 1 Issue No. 1 International Journal of Interdisciplinary Engineering (IJIE) ISSN: 2456-5687

IV.IMPLEMENTATION AND RESULTS

The functional testing has been carried out on manywebsites but here I am taking www.google.com
website as asite to explain the functionality of theproposed framework. In the proposed work command
driven testing framework, the data and the steps of test execution are not hard coded into the script file. A
separate excel file and config file which contains all the steps in the form of Commands is provided to the
Framework. The Framework script will read theexcel file and execute all the test steps which are embedded
in the excel file. Figure 3and 4 shows the sample of config and excel files which are used in the proposed
Framework to test calculator application at google.com
A. Implementation

Figure 3: Config file

Figure 4: Excel file

B. Experimental Results

When the driver script is execute by Java IDE application the following steps of automation will take
place, during the testing ofwww.google.com, calculator web application in the proposed Command Driven
Framework.

Step1: openBrowser
When the script read the first Command from excel file, it willautomatically open the specified
browser i.e. Mozilla Firefox (as shown in Figure5). Below screenshot shows the browser opening in Firefox.

September 2016 Inside Journal (www.insidejournal.org) Page | 9


Vol No. 1 Issue No. 1 International Journal of Interdisciplinary Engineering (IJIE) ISSN: 2456-5687

Figure 5: Black page open in Firefox

Step2: Navigate

In the second step when script read the navigate Command Frameworkwill open the desired website
that tester want to test, the URL to open is given as input data in the excel file and configuration
i.e.,www.google.in in this example.

Figure 6: Google home page


Step3: writeInInputById

In this step input text calculator will be entered in the google text box for searching by the test
framework and the text filed will be identified with the x-path location specified in the input excel file.
There are many ways to identify the elements in the web page. Here I used an example of x-path to locate an
element.

Figure 7: Enter text in the text box

September 2016 Inside Journal (www.insidejournal.org) Page | 10


Vol No. 1 Issue No. 1 International Journal of Interdisciplinary Engineering (IJIE) ISSN: 2456-5687

Step4: clickByName

In this step after entering word Calculator, click on searchbutton to navigate to the next page.
Again the element search button will be identified by the method we specify in the input excel. For this
method I have used the example of Identify the element by name method.

Figure 8:Search the word by name

Step 5: clickLink_linktext

In this step in the search results, it selects the link to get into calculator page. Again the link to click is
driven by the excel with the link address or reference to the link location.

There are many ways to identify the link in the results page
1. Identify the link with name Here we cant expect the exact name of the link to be clicked since
the order of google results may change based on the ranking algorithm
2. Identify the link with location Alignment may change for each browser or version
3. Identify the link in the order This is more appropriate to use hence I used this method to
identify the element in the results page. Also this covers all the examples that we can use with
this framework.

Figure 9: Calculator landing page

September 2016 Inside Journal (www.insidejournal.org) Page | 11


Vol No. 1 Issue No. 1 International Journal of Interdisciplinary Engineering (IJIE) ISSN: 2456-5687

Step 6: clickButton

In this step click link (link name specified in the googleconfig properties file)

Figure 10: Select button

Step 7: WriteInputByID

In this step the framework will selectBall volume calculator as specified in the excel file and enters value
2
Each text or number to select in the next page is driven by the framework to ensure that tester can change
the values of these parameters during run time.

Figure 11: Write input page

September 2016 Inside Journal (www.insidejournal.org) Page | 12


Vol No. 1 Issue No. 1 International Journal of Interdisciplinary Engineering (IJIE) ISSN: 2456-5687

Step 8: selectByText

In this step framework execution will select the type in the drop down to convert the volume as specified
in the excel or properties file

Figure 12: Select by text

Step 9: clickByName: In this step the framework execution will click on the button Calculate identified
with the name.

September 2016 Inside Journal (www.insidejournal.org) Page | 13


Vol No. 1 Issue No. 1 International Journal of Interdisciplinary Engineering (IJIE) ISSN: 2456-5687

Figure 13: Click by name

Step 10: closeBrowser

This step is to close the result page.

Figure 14: Close browser page

In this example very few scenarios I have covered, but majority of the scenarios are used by Testers and
Automation engineers in their day to day testing. If the testers or developers getting familiar with these set
of commands, then they run automate and run the scenarios of all most all the browsers. Any new methods
that are not covered and required by the teams can always be added and framework is easily expandable for
the latest browsers. The selenium version upgrades always depends upon the requirement.

V.CONCLUSION AND FUTURE WORK

Software testing is the method of testing application in orderto find the variation between the output and the
actualoutput. Automated testing does not required much humaneffort as the testing of application is
performed with the helpof other application but it is a tedious job as we need to testthe application again and
again for every small code change. To overcome with these problems a Command Driven Framework is
proposed in this paper. Here a excelworkbook which contains all the Commands is used for whichthe
functions or methods are created in the Framework scriptfile. The proposed framework does not require
theknowledge of programming language for testing webapplication as all the code is already embedded in
the framework script file. Moreover there is no need to alter thecode to test different applications and only
the excelworkbook is changed which is very easy. The experimentalresults prove that the framework is cost
efficient and veryeasy to use.This Framework could be made versatile by adding morefeatures like
automated email reminder when test cases arefinished, automated screenshot generation of the failed
testcases.

ACKNOWLEDGEMENTS
I would like to thank my project Guide Prof. P.V.G.K.Jannadha Raju for his valuablefeedback and
support in reviewing this paperthroughout its evolution. Additional thanks to head of the department CSE
Dr.B.Sujatha for her continuous encouragement and advice.

September 2016 Inside Journal (www.insidejournal.org) Page | 14


Vol No. 1 Issue No. 1 International Journal of Interdisciplinary Engineering (IJIE) ISSN: 2456-5687

REFERENCES

[1] Softwaretesting-TestingTutorial.Availableat:http://www.tutorialspoint.com/softwaretesting, 2013.


[2] G. J. Myers, C. Sandler, and T. Badgett, The art ofsoftware testing. John Wiley & Sons, 2011.
[3] C. J. Budnik, W. K. Chan, and G. M. Kapfhammer,Bridging the gap between the theory and practice
ofsoftware test automation, in proc. of the 32ndACM/IEEE International Conference on
SoftwareEngineering-Vol. 2, pp. 445_446, Cape Town, SouthAfrica, May, 2010.
[4] C. Rankin, The software testing automationframework, IBM Systems Journal, vol. 41, pp. 126-139, January,
2002.
[5] T. Lalwani, S. N. Kanoujia, T. Howarth, and M. Smith,QuickTest Professional Unplugged.
KnowlegeInbox,2011.
[6] R. Mugridge and W. Cunningham, Fit for developingsoftware: framework for integrated tests.
PearsonEducation, 2005.
[7] R. Stejskal and H. Siy, Test-driven learning in highschool computer science, in proc. of IEEE
26thConference on Software Engineering Education andTraining (CSEE&T), pp. 289-293, San Francisco,
CA,November, 2013.

September 2016 Inside Journal (www.insidejournal.org) Page | 15

You might also like