Upload
editorinchiefijcs
View
217
Download
0
Embed Size (px)
Citation preview
8/16/2019 IJCS_2016_0302009.pdf
1/4
117 | International Journal of Computer Systems, ISSN-(2394-1065), Vol. 03, Issue 02, February, 2016
International Journal of Computer Systems (ISSN: 2394-1065), Volume 03 – Issue 02, February, 2016
Available at http://www.ijcsonline.com/
Comparative Study of Automated Testing Tools: Selenium and Quick Test
Professional
R. Bhavithra, G. Lavanya, D. Thiruveni
Department of Information Technology,Vivekanandha College of Engineering for Women (Autonomous),Tamilnadu, India.
Abstract
Software testing helps in finalizing the software application or product against business and user requirements. Testers
play an important role in producing the high quality software product.It is the process of validating and verifying the
software program. Testing automation tools helps us to automate the entire process of testing in software
development.There are variety of software testing automation tools available.From which QTP supports the largest
range of technology in the industry whereas selenium is one of the few free tool on the market that appears to have
functionality that one would expect in a vendor tool. The objective of this paper is to conduct a comparative study of
automated tools which are Selenium free source and Quick test professional (QTP).
Keywords: Selenium web driver, QTP, Object repository.
I. I NTRODUCTION
Generally, while automating web application using any
automation tool, it would be an open source like selenium
web driver or commercial like UFT/QTP. It is quite
straight forward to identify locators for static elements.
But in some applications, it is quite challenge to identify
locators for dynamic elements. In this paper our
comparative study is about QTP and Selenium. Both QTP
and Selenium can handle dynamic objects but with some
restrictions and modifications.
Quick Test Professional (QTP) was originallydeveloped by Mercury interactive.Initially their legacy
testing solution winrunner is having some limitations.
Later Mercury team thought to develop a similar tool like
win runner with Microsoft named quick test professional
aka QTP. It is basically functional testing tool where we
can test functionality of any application under test(AUT).
It helps testing teams to automate manual test cases and
execute regression tests automatically. The main drawback
of QTP is it cannot run multiple threads. But the factor of
grid support available in selenium, where we can run
multiple instances of the application on different browsers
at the same time[5].
After that selenium was originally developed by Jason
Huggins in 2004 as an internal tool at Thought Works.
Paul Hanmant joined the team and steered thedevelopment of the second mode of operation that would
later become selenium Remote control(RC).This tool was
open sourced that year. Selenium is a portable software
testing framework for web applications. It provides a
record playback tool for authorizing tests without learning
a test scripting language (selenese) to write a test in anumber of languages include java, c++, python and ruby.
Selenium web driver is the successor of selenium
remote control which has been deprecated. This is
implemented through a browser specific browser driver,
which sends command to a browser and retrieves
results[4].
II. PROCESS OF HANDLING DYNAMIC OBJECTS
A.QTP:
In this paper we have to handle the dynamic objects in
QTP using the following methods
(i) GetRo:
To capture the value of a dynamic object in a web
application GetRo method is executed. In order to capturethe value of an object and that too of a dynamic object
then we will use this property which means Get Run time
object property. A sample code for gmail to count unread
emails from any account is given below.The prerequisite isthat you have to login to your gmail account and then run
this script
Inboxcount=Browser(“title:Gmail.*”).Page(“title:
Gmail.*”).Link(“innertext:Inbox.*).getRopr operty(“innert
ext”)
If inboxcount =”Inbox” Then
Print “No Unread Emails”
Exit action
Else
//replaces inbox with space
emailcount = replace(inboxcount,“Inbox”,”)
//removes all the spacesemailcount= trim(emailcount)
emailcount=replace(emailcount, “)”,”)
8/16/2019 IJCS_2016_0302009.pdf
2/4
R. Bhavithra et al Comparative Study of Automated Testing Tools: Selenium and Quick Test Professional
118 | International Journal of Computer Systems, ISSN-(2394-1065), Vol. 03, Issue 02, February, 2016
emailcount=replace(emailcount, “)”,”)
Print ”you have “ &emailcount& “unread emails in your
inbox”
End If.
B.SELENIUM:
(i).Absolute Xpath:
Xpath position or absolute Xpath are most frequently
used to resolve the dynamic element issues. Only problem
with using Xpath locators is that they are very fragile.
They are most prone to breakage in case of change in web page. This factor could get worse exponentially as the test
suite size and completely increases. An example is:
web_element_name=html/body/div[30]/div[2]/div[2]
(ii).Identify element by starting text:
If the dynamic elements have a definite pattern tothem, then we can also use javascript functions like ”starts
with” or “contains” in one element locators to separate the
dynamic part of locator from static part. So we can starts
with function here.
Xpath://button[starts-with(@id, „Submit-„)]
(iii).Identify element by containing text:
Here we can use „contains‟ function where dynamic
element is surrounded by a static value.
Xpath://input[contains(@class,‟suggest‟)]
(iv).Identify element by index:
If there are multiple elements present on the page with
same locator we can use java code in our selenium web
driver script to interact with element of particularindex.driver.findElement(By.xpath(“//submit”).get((page
number).
(v).Identify element with reference of a closest stable
element:We can use the DOM structure to find the closest
stable element which can be used as a reference element to
find the required element.
XPATH://span 1/../following – sibling:div//button
(vi).Identify element by stable preceding text:For web elements like text field text area we can
identify them by using the stable text lables nearby. This
approach might not be possible in all scenarios but it does
resolve the dynamic element issues where possible.
III. PRINCIPLES AND COMPONENTS
A. QTP
(i).Components of QTP in linear framework:
Here each test case has its own local object
repository and the data is hard-coded in the script. Linear
Framework is the framework where you write the scripts
in a step by step manner as depicted in the test case flow.
In this type of framework, we don‟t create any functions
and all the steps are written one after the other in a linear
fashion.Following diagram illustrates the components and the
typical workflow of the Linear Framework in QTP.
Figure 1: Components and typical workflow of the linear
framework in QTP.
(ii).Components and Workflow of Modular Framework:
In order to use the functions from the external library
file, the library file must be first associated to the test
cases. Once this is done, the test case can call all the
functions present in the library file.
Figure 2:Components and work flow of modular
framework in QTP.
Modular Framework is the approach where all the test
cases are first analyzed to find out the reusable flows.
Then while scripting, all these reusable flows are created
as functions and stored in external files and called in the
test scripts wherever required. Consider the following 2test cases.
a) Login > Create Order > Logout.
8/16/2019 IJCS_2016_0302009.pdf
3/4
R. Bhavithra et al Comparative Study of Automated Testing Tools: Selenium and Quick Test Professional
119 | International Journal of Computer Systems, ISSN-(2394-1065), Vol. 03, Issue 02, February, 2016
b) Login > Search Order > Logout
In order to use the functions from the external library
file, the library file must be first associated to the test
cases. Once this is done, the test case can call all the
functions present in the library file.
Figure 3:Components and workflow of modular
framework in QTP.
B.SELENIUM:
Selenium is a portable software testing framework for
web application. It provides a record/playback tool for
authoring test without learning a test scripting language
(selenium IDE).It also provides a test domain specific
language(selenese) to write tests in a number of popular
programming languages including java, python and
ruby[3].
The components of selenium testing tools are
(i).Selenium IDE:Selenium IDE is the integrated development
environment for building selenium test cases .It operates
as a firefox add -on.
(ii).Selenium RC:
Selenium RC is a test tool that allows us to write
automated web application. It tests in any programminglanguage.
(iii).Selenium Grid:
Selenium Grid is a server that allows test tool web
browser instances running on remote machines.
(iv).Selenium Web Driver:
Selenium Web Driver makes direct calls to the browser
using each browsers native support for automation. Web
driver is a tool for automating web application testing, and
in particular to verify that they work as expected.Once our project is setup, we can see that web driver
acts as just as any normal library:it is entirely self-contained ,and we usually don‟t need to remember to startany additional processes or run any installers before using
it, as opposed to the proxy server with Selenium-RC.
IV. COMPARATIVE STUDY
Table 1: Differences between selenium and QTP[2].
SELENIUM QTP
Open source Paid tool
Works on all OS Works on windows.
Tests only web
applications.
Tests desktop and web
applications.
Works on almost all
browsers.
Works on firefox3.5.x nad
IE.
No object repository. Has got an objectrepository.
Core engine is javascript. Core engine is not a
javascript.
V. CONCLUSION
There is difference between buying a branded car andassembling a car on your own. Branded car has its cost &
services attached whereas in assembled car, you need to
take care of everything on your own. But, there is a hybrid
solution where you can go to a custom workshop to get an
assembled car (sales and post-sales support) and pay for
their services. The same concept is now available in IT too
such as you go to a service provider who has everything.
One can select a testing tool based on the type of
application need to be tested, budget, and the efficiency
required.Both these tools are at the same level, the
difference is that QTP is mostly suitable for the desktop based application whereas selenium is an excellent tool forweb-based applications.
R EFERENCES
[1] Principle and components of Selenium.http://en.wikipedia.org/wiki/principles.
[2] QTP V/S Selenium, qtp-sel.blogspot.in/?m=1.
[3] Seleniumwebdriverhttp://www.seleniumhq.org/doc/03_webdriver.jsp
[4] selenium Introduction and its componentshttp://tfortesting.wordpress.com/2012/10/25/selenium-introduction-
and-its-components/[5] QTP Introduction.www.tutorialspoint.com/qtp/qtp_overview.html.
[6] Harpeet Kaur et al, “Comparative study of automated testing toolsQTP Selenium and TC”, Int. Journal of Engineering Research and
8/16/2019 IJCS_2016_0302009.pdf
4/4
R. Bhavithra et al Comparative Study of Automated Testing Tools: Selenium and Quick Test Professional
120 | International Journal of Computer Systems, ISSN-(2394-1065), Vol. 03, Issue 02, February, 2016
Applications.ISSN:2248-9622,Vol.3,Issue 5,Sep-oct2013,pp.1739-1743
[7] Innovative approaches of automated tools in software testing andcurrent technology as compared to manual testing Global journal ofenterprise of information system, an 2009-jan 2009.
[8] Sneha Khoria and Pragati Up adhyay,Performance Evaluation andComparison of Software Testing Tools VSRD International
Journal of Computer Science Information Technology, Vol. 2 No.10 & October 2012.
[9] Software Test Automation - http ://en.wikipedia.org/wiki/Testautomation
[10] Mohd. Ehmer Khan, “Different Forms of SoftwareTestingTechniques for Finding Errors,”IJCSI” International Journalof Computer Science Issues, Vol. 7, Issue 3, No 1, May 2010.
[11] Jovanovich and Irena, “Software Testing Methods andTechniques,” May 26, 2008.
[12] Quick Test Professional entry in Wikipedia: Http://en.wikipedia.org. /wiki/HP_ Quick Test_ Professional.
[13] Mercury Quick Test Professional tutorial, version 8.0.MercuryInteractive Corp oration, Documentation, 2004.
[14] Automationtesting- www.guru99.com/automationtesting. html.