Académique Documents
Professionnel Documents
Culture Documents
Selenium WebDriver
EDUCREATION PUBLISHING
RZ 94, Sector - 6, Dwarka, New Delhi - 110075
Shubham Vihar, Mangla, Bilaspur, Chhattisgarh - 495001
Website: www.educreation.in
________________________________________________________________
© Copyright, Author
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or
transmitted, in any form by any means, electronic, mechanical, magnetic, optical, chemical,
manual, photocopying, recording or otherwise, without the prior written consent of its writer.
ISBN: 978-1-61813-470-7
Price: ` 815.00
The opinions/ contents expressed in this book are solely of the author and do not represent
the opinions/ standings/ thoughts of Educreation. The book is released by using the
services of self-publishing house.
Printed in India
ii
Narayanan Palani
EDUCREATION PUBLISHING
(Since 2011)
www.educreation.in
iii
"I prefer this book for any newbie to selenium. Like NP's previous
books, he again put his great practical experience and analysis in this
book. Several examples, sample codes and configuration snippets would
really help to learn practically, not just theoretically."
-Jagath Sathyanarayana, Automation & Service Virtualization
Consultant and Evangelist. Wipro Technologies, United Kingdom.
"This Book is a well written and well thought through book. There
is enough information to write selenium code in Java programming
language from scratch. This suits for both beginners and advance level
users"
- Rajkumar J. Bhojan, Principal Consultant,
Wipro Technologies, Boston, MA, USA.
vi
“It is really nice book , each and every basic concepts you have
explained nicely."
-Navya Padiyar, Test Specialist
"This book would definitely encourage and fulfil the thirst of young
automation engineers and beginners to achieve a great automation
experience. His handcrafted book will produce smart automation
engineers who can able to do the things 'just like that'..."
- Karthikeyan Sadaiyappan, Technical Lead.
vii
viii
Narayanan Palani
ix
CERTIFICATIONS
International Software Testing Qualifications Board-CTAL Test
Manager
International Software Testing Qualifications Board-CTFL
Certified Scrum Master
https://uk.linkedin.com/in/narayananpalani
xi
xii
https://www.linkedin.com/in/ponsailapathi-viswanathan-
224a755
xiii
W
xiv
Certificate of Merits
2005 – Office Data Management System
2004 – Coach Management System
2004 – Block Analysis System
2002 – FOIS Analytical Reporting System
My recent projects
MnMFramework 1.0 – alternative light weight components framework
MnMVirtualControlFramework 1.0-Innovative virtual controls
framework
My previous projects
xv
https://www.linkedin.com/in/mukesh-adhvaryu-79500219
xvi
- Mukesh Adhvaryu
xviii
Technical Skills
- Testing Tools: HP Quality Centre11, Bugzilla, JIRA, Selenium
- Database : Oracle 11g
- OS: Windows, Linux
- Functional Areas: Web Testing, System Testing, Regression Testing,
Sanity Testing,Optical Network testing &Localization Testing
- Test management activities like, test case designing, test case review,
test execution and test execution status reporting
https://sg.linkedin.com/in/shwetabhat
xix
When Mr. Narayanan Palani told me that he was working on part2 of the
book about Testing, I was very happy to hear it. The importance of open
source tool in the automation testing has been rising in the industry for
years, and there are lot of knowledge sharing happening across the
industry. It just required some way of organising the data, that would
help a beginner to understand the starting point and the point where a
learner should stop, and the experienced one would know where he
stands
When I saw the book I found it as a comprehensive guide & also
serves as a great reference as you go about your testing tasks, it not only
prepares you what to code but also how to code. The book has explained
the framework development in detail. Framework is all about defining
and refining class hierarchies. The framework keeps evolving as the
tester/developer gain experience. The code becomes more maintainable
and readable.
Detailed step by step approach of the book introduces to you to
achieve a good framework. Coding standards, creating automation POC,
details on configuration settings, how–to's and related examples on
Selenium web driver will help you code better i.e. maintainable. The
book also gives an insight on Selenium 3.0. Highlighted section in this
book is about preparing the reader for tackling job interviews. Author has
given a lot of tips & tricks, they would help you get ready to face the
interview, where the actual skills of yours speak.
All the best, happy coding & Testing.
- Shweta
xx
https://www.linkedin.com/in/arrchana-mohan-0b61b8106
xxi
-Arrchana Mohan
W
xxii
https://www.linkedin.com/in/dinesh-balaj
xxiii
-Dinesh Balaji
xxiv
https://www.linkedin.com/in/venkatesh-vi-6307259
xxv
xxvi
xxvii
xxix
xxxi
xxxiii
xxxiv
xxxv
xxxvi
xxxvii
xxxviii
xxxix
xl
xli
xlii
xliii
xliv
xlv
Dos:
- Minutely focus your attention for 25 minutes without being
interrupted on any chapter.
- Opt for a breather for 5 minutes to relax your mind. Perform Google
search to analyse your area of difficulty. Then, jot them down on a
paper. (Post these questions in quora.com or stackoverflow.com to
get answered by experts.)
- Write sample code and execute them to analyse results, exceptions or
errors, if occurred any.
- Revise the same chapter at least 4 times in order to strengthen your
concept as more concrete in its approach.
- A 15-minute break is advised to take and then continue reading the
next chapter.
- In case of meeting an alien programming language in the course of
reading, practicing Java programmes using ‗Java BlackBook by
Steven Holzner‘ is duly advised, thereafter, practicing scripts in
command and be prompt to compile and execute.
- Save the practised scripts and get them uploaded to git and be an
‗Open Source Framework Developer‘ at
github.com/narayananpalani/testautomation.
Don’ts:
- Never force yourself to complete the book overnight or within a
week.
Introduction
Test automation jobs have been considered as the most wanted in
Information Technology Industry and Selenium WebDriver as one of the
best automation tools in recent years; since the demand of Selenium
WebDriver based jobs are being increased day by bay in the market,
there is always a dire need felt to get test specialists build and maintain
the automation frameworks properly.
But no doubt, there are some challenges and obstructions faced
in the training and development process of new testers (junior testers),
and job seekers are trying various online and face to face selenium
trainings to secure a decent test automation job for themselves. Some of
the training programmes are designed in such a way that high priority is
given to Selenium IDE before getting into Selenium WebDriver training.
Moreover, Selenium IDE is not a best tool to start a training programme
as it is not regarded as the most wanted tool in software test automation;
similarly, there is a lack of certainty on choosing programming
languages in scripting Selenium WebDriver frameworks using Java,
DotNet, Python, Ruby or Javascript. Some training participants first try
their hands on Java until they are hindered by some issues in the code
and then they automatically bounce back to DotNet to continue scripting
which deviates their attention towards failures.
For the purpose of scripting Selenium frameworks and complete
designing of the overall automation framework, it is always strongly
recommended that Selenium learning beginners should be conformed to
one programming language before switching to different languages such
as DotNet; ‗Why Java based Selenium WebDriver Framework is widely
used across the industry?‘ A particular section has been explained in
detail in order to suggest the most suitable programming language to set
about learning the testing frameworks.
Before taking up first few chapters of the book to read, it is
highly recommended to download the entire well-built automation
frameworks from Github-Refer the section ‗Download Selenium Projects
from GitHub‘;
You are suggested to install required software with the help of
the section 'Install Java, Eclipse, Cucumber, TestNG'; these projects will
prove as a great help in the process of running the tests in parallel to
learning the new concepts in each chapter. Following two chapters will
suggest right steps to run such tests in Eclipse:
When job seekers complete their Selenium training and are ready to
apply for jobs, most of the CVs fail to match the requirements posted for
the available jobs. This has been regularized as the routine issue for
recruiters to compare each profile to select the best CV. Even job seekers
strive to overcome the hurdles to differentiate CV, resume, bio-data from
one another, while applying for technical roles; in order to suggest right
guidelines for posting the perfect resume on automation jobs, following
sections are to be referred thoroughly:
Automation Test Industry
Selenium-Brief History
Why Java based Selenium WebDriver Framework is widely used
across the industry?
Resume Guide for Selenium Experts
Resume Evaluation Process for Test Automation Jobs-A Case Study
Step1: Requirement for the Selenium Automation Tester Role posted
online
XSLT Reporting
Example XSLT report
How to add such XSLT Reports to the emails and send to
stakeholders?
Parameterization in Automation Framework
TestNG Scripting for Selenium Automation Framework
Next Generation Test Automation Results Management
Note: Installation and configuration of each jar files and respective
automation framework features are explained in detail as part of Part1 of
this book
The next big challenge put forward to the test team, while
implementing the automation frameworks in the testing projects, are
from Maintenance and Defect Prevention on such automation
frameworks over the period; The failure to run the tests by automation
frameworks due to configuration changes is an immensely challenging
task. In such cases, CMM Levels have been considered as the most
suggested implementation on test automation projects and the detailed
guidelines pertaining to this are given in the following chapters:
CMMI Level and Software Testing
CMMI Level Implementation in Automation Frameworks
While working as test automation specialists, various obstructions
have been faced in automation framework code and test run of various
scripts in the form of exceptions, failures and different issues; These
exceptions are to be addressed with high importance to run the ongoing
tests, failing in which, it impacts the overall test execution schedule; In
such circumstances, the test engineers are to refer stack overflow, Quora
or blogs to find right answers and risk mitigation steps to overcome
Selenium Framework based issues; But some of the latest challenges,
exceptions have been left unresolved and these common questions/
challenges/exceptions are detailed and answered in following chapters to
benefit automation test specialists:
Selenium Exceptions Guide
Problem Solving Section-Selenium WebDriver
The best practices on writing Selenium WebDriver based
frameworks are minutely explained in detail in the chapter below:
Selenium Test Automation Best Practices
Selenium 3 based test scripting and supported browser versions are
detailed in the section below:
Selenium 3.0 Test Scripting
Alternatively, this git project can be cloned and performed Git Pull
Action to update your local repository with up-to-date scripts.
Once projects are downloaded, there are four tools required to access the
automation frameworks and below section help in downloading and
configuring such tools.
11
Eclipse Installation
Download latest eclipse version from http://eclipse.org/downloads/
Once downloaded, please install it and open Eclipse from the location it
is downloaded by clicking on eclipse.exe
Cucumber Installation
Install the Cucumber Plug-in into Eclipse
12
TestNG Installation
Follow steps:
1. Click on Help > Install New software
2. Add the link http://beust.com/eclipse in Work with text box
3. TestNG feature will be shown, expand the tree node then verify the
version.
4. Tick the check box of TestNG
5. Click on Next button then Finish button.
Step1:
Place the AutomationFramework folder in C: Drive like this:
13
Step2:
Launch Eclipse from the folder where it has been installed (Unlike other
software applications, eclipse needed to be launched by exe every time to
open and access where as other software's available in shortcuts or
different links to access while launching them)
Open eclipse.exe (preferable Eclipse Luna):
Step3:
Choose the folder of the automation framework folder and click on OK
button:
14
15
16
Click on the Browse button to choose the project and select both the
checkboxes to search and copy the existing projects. Choose SAF project
in the list and click on OK Button:
17
18
Right click on the folder SAF, click on Build Path and click on
Configure Build Path as follows:
19
Please select JAR files from JarFiles folder of the project and click
Open to list the jar files within 'Libraries'. If there are existing JAR files
with incorrect path or highlighted with errors, remove them and add fresh
files from JarFiles folder.
Similarly if JRE System Library exists, that is good to run the test in
java based framework; If JRE System Library doesn't appear in the
Libraries above, click on 'Add Libraries' in the Libraries section, and
choose the default JRE (respective version display as third check box)
and click Next and Finish buttons to display JRE System Library.
20
21
22
Note: Where to start the execution?: Step ' Test Execution through
TestNG' in this chapter
SAF-->testoutput folder-->testng.xml file-->Right click-->Run As--
>TestNG Suite
23
References:
What if there is an error while installing and configuring the
selenium project in Eclipse?
http://stackoverflow.com/questions/2638016/why-no-projects-found-
to-import
24
How to setup?
http://www.assertselenium.com/eclipse-2/how-to-setup-a-
WebDriver-project-in-eclipse/
http://stackoverflow.com/questions/18492668/how-to-execute-a-
selenium-test-in-java
Challenges:
Designed with limited features, the newly built automation test
frameworks will have to evolve for some years to engage itself in the
competition against automation tools. By introducing such custom built
automation frameworks, it is indispensable to maintain development and
testing teams for such custom built automation tools.
Selenium-Brief History
JavaScriptTestRunner (later renamed to Selenium), one of the fine
initiative of ThoughtWorks, Chicago has been built by Jason Huggins,
Paul Gross and Jie Tina in initial days; Though the tool has been brought
to view to various technology experts in Demo sessions, but it is not yet
released as an open source release to public worldwide; There was a
possibility to expand this model to script in any language in 'driven'
mode after Paul Hammant took the initiative of open source release
(hence the tool works as an engine in order to interact with the clients in
various different languages while performing the test actions).
Selenium RC:
Now Selenium has been undergone to better design process but it still
needs browser accessibility using a browser driver, hence, a particular
25
browser is compatible enough to run the test and validate the test steps;
Dan Fabulich and Nelson Spoul from Bea bundled the browser driver
into a standalone server, Selenium RC (Remote Control); Now the script
can work as a server to interact with browser driver scripts but this
requires a stable release, hence, tester can avoid/reduce the test engine
failures in recognising objects of test elements. The trio of Pat
Lightbody, Nelson and Dan have worked on this problem and have come
up with a stabilized version of Selenium RC!
Selenium IDE:
"UI Element" extension of selenium has been developed by Haw-Bin
Chain in Chicago, and then, it has been invited to merge into Selenium
IDE.
Selenium WebDriver:
'WebDriver', being a different tool and brainchild of Simon Stewart, was
later merged to Selenium 2.0 hence it is called Selenium WebDriver.
Selenium Server:
Browsers, which are completely driven by the core scripts from
Selenium Server, communicate to clients through respective browsers.
So hereby you are requested to configure the Selenium Server at start up
by launching command line and to use the command given: java -jar
selenium-server.jar -h
The set of the scripts submitted by the clients (through IDEs such as
Eclipse) in the form of commands sent, are interpreted by server to drive
the browser and test the application and send back the results to the
client.
26
Reference:
http://www.codingdojo.com/blog/9-most-in-demand-programming-
languages-of-2016/
27
Selenium based Google Search Results prove that Selenium Jobs are
most wanted in Testing Domain
Let us watch Google Search Patterns on the most wanted test automation
tools:
28
29
30
Penetration Testing
Performance Testing
Automation Testing
Android Testing
31
Observations:
JMeter based Performance Test Jobs,Selenium based Automation
Test Jobs are most wanted in the industry where as knowing Appium is
an added advantage for the next ten years and it will be helpful when
Appium reaches the Growth Stage in Google Trends Life Cycle.
References:
Google. (2016, September 20), Google Trends. Retrieved from
https://www.google.com/trends/
32
Best and easy way to capture object properties using Mozilla Firefox:
Step1: Install Firefox from https://www.mozilla.org/en-GB/firefox/new/
Step2: Launch Firefox->Tools->Addons->Get Add-ons->Choose 'Xpath
Checker' and then 'Xpath finder'
33
Once installed and Firefox is restarted, launch the URL which need to be
tested.
Step3: Right click on the object and choose View Xpath as below:
34
Selenium Locators
Similar to 'Descriptive Programming' of Unified Functional Testing
(formerly QTP),Selenium scripting required basic knowledge on object
capturing techniques using Xpath. This section will explain the type of
xpath elements and usage guidelines.
Locating by Identifier
Assuming that 'right click' on the object user id text box and choose
'Inspect Element' result in following html tags:
<html>
<body>
<form id="SigninForm">
<input name="username" type="userID" />
<input name="password" type="password" />
<input name="continue" type="submit" value="Login" />
</form>
</body>
<html>
Here userID is the first identifier of the text box: user name hence it
is the Identifier. Using such identifiers will help in running the test
without object identification failures.
So this object can be updated to the script as follows:
35
driver.findElement(By.xpath("//input[@type='userID']"))..sendKeys("Joh
n");
If reusable components are designed then,
driver.findElement(By.type("userID")).sendKeys("John");
Locating by Id
Instead updating the first identifier, it is always suggested to pick id of
the object across the automation framework; As an example,navigate to
seleniumhq.org web page and identify the properties of the searcb box on
top right corner of the page:
Right click on the search box and click Inspect Element:
Once Inspect Element is clicked ,find the properties in the section below:
36
Locating by name
id="searchbox_016909259827549404702:hzru01fldsm"
title="seleniumhq.org Selenium Search"
action="http://www.google.com/cse">
<div>
<label title="Search SeleniumHQ.org's sites for selenium content"
for="q"></label>
<input type="hidden" value="005991058577830013072:2lr_j6t3fko"
name="cx"></input>
<input type="hidden" value="FORID:" name="cof"></input>
<input id="q" type="text" size="30" accesskey="s" name="q"></input>
<input id="submit" type="submit" value="Go"></input>
</div>
</form
In the list of properties available in html format, name="q" is the object
id of the search box which is important for testing and get this q to
update the script as below:
driver.findElement(By.name("q")).sendKeys("Selenium 3");
Locating by XPath
In XML documents, XPath is the language used to locate nodes which is
the same name used for automation tests to locate the object XPath. It
can be used to either locate the object element in absolute terms (but not
suggested), or relative to an element that does have an id or name
attribute within xml file.
37
Absolute XPaths contain the exact location of all elements from the root
(html) and as a result are likely to fail during execution with only the
slightest adjustment to the web application.
Find the item with id or name or any nearby object property which less
likely to change in near future and update the script with "//" like the
example below:
Example:
id="searchbox_016909259827549404702:hzru01fldsm"
title="seleniumhq.org Selenium Search"
action="http://www.google.com/cse">
<div>
<label title="Search SeleniumHQ.org's sites for selenium content"
for="q"></label>
<input type="hidden" value="005991058577830013072:2lr_j6t3fko"
name="cx"></input>
<input type="hidden" value="FORID:" name="cof"></input>
<input id="q" type="text" size="30" accesskey="s" name="q"></input>
<input id="submit" type="submit" value="Go"></input>
</div>
</form
38
Locating by DOM
Document Object Model shows the way how the document has been
designed as html and it can be updated in scripts by dom=label.
For an example,
<html>
<body>
<form id="signinForm">
<input name="username" type="text" />
<input name="password" type="pwd" />
<input name="continue" type="submit" value="Login" />
<input name="continue" type="button" value="Clear" />
</form>
</body>
<html>
39
Locating by CSS
Rendering of HTML and XML documents are described in Cascading
Style Sheets known as CSS.
How a selenium beginner understand CSS locator and how to capture
such object property is something explained in the below example:
Launch seleniumhq.org web page in firefox:
Selenium IDE is opened just to get more command options when the
object is right clicked!
Now right click on the Go button on top right corner:
40
Choose any command from the list available and click on it (for
example: choose verifyText id=submit) and then make sure that the
respective code automatically added in selenium IDE as below:
41
Now click on the dropdown in Target section and there must be list
of xpath options available for the same object which can be chosen
alternatively:
CSS of the Go button is #submit which is taken from this place and it can
be verified from Inspect Element:
42
XPath Examples
Examples to update xpath elements in selenium scripts based on
respective object properties:
Object Properties from Xpath to be updated in Selenium
Web Page WebDriver scripts
:submit //*[@submit]
43
:contains("name") //*[contains(text(),"name")]
:disabled //*[@disabled]
:first-child descendant::*[1]
:first-of-type descendant::p[1]
:last-child //*[last()]
:last-of-type //p[last()]
:nth-child(even) //*[(position() mod 2)=0]
:nth-child(n) //*[position() mod n = 1]
:nth-child(odd) //*[(position() mod 2)=1]
:nth-last-child(n) //*[(count() - position()) mod n = 1]
:nth-last-of-type(n) //p[(count() - position()) mod n = 1]
:nth-of-type(n) //p[n]
:only-child //*[count(*)=1]
:only-of-type //p[count(*)=1]
:root /*[1]
:selected //*[@selected]
:text //*[@type="text"]
div > p //div/p
div p //div//p
h1 + div //h1/following-sibling::div
h1 ~ div //h1/following-sibling::*[count(div)]
hasChildNodes //*[count(child::node() ) > 0]
p:not(#enter) //p[not(@id="enter")]
p.me //p[contains(concat(" ", @class, " "),
" me ")]
p[me!="email"] //p[@me!="email"]
p[me*="email"] //p[contains(@me,"email")]
p[me^="email"] //p[starts-with(@me,"email")]
p[me|="email"] //p[starts-
with(@me,concat("email",'-'))]
p[me~="email"] //p[contains(concat(" ",@me, " "),"
email ")]
p[me$="email"] //p[substring(@me,string-
length(@me)-2)="email"]
p#enter //p[@id="enter"]
44
Reference:
LAKSHAY SHARMA. (2016, September 10), FindElement and
FindElements Command [Web log post]. Retrieved from
http://toolsqa.com/selenium-WebDriver/findelement-and-
findelements-command/
Ellie Skobel. (2016, September 10), Selenium Minutes [Web log
post]. Retrieved from http://seleniumminutes.com/
45
assisting the testing teams to invest their precious time for planning their
cost saving options on the expenses of the project; CMMI also helps
testing teams to stabilize the high performance delivery and consistent
increment on Return on Investment(ROI).
Is CMMI all about process improvement only?
CMMI helps in improving the testing process and it can be applied
successfully to testing groups, set of people, rules and teams of different
projects as well.
Tool Selection:
Testing teams use tools for Requirements Gathering, Defect Tracking,
Test Execution, Configuration Management and many other testing
activities. CMMI performs a major role in this tool selection process and
provides quality standards to identify and select the right tool for the
testing activities.
46
47
Example:
AB Ltd has implemented companywide standards on defect raising
standards and followed across the testing teams. But it has been delayed
in getting the defects fixed and retested. This is definite to create
negative feedback from customers so organization has decided to take
control of the defect fix duration. So the list of defects has been raised
and the defect fixing dates have been evaluated and analysed at the same
time to comprehend the reason behind such delays experienced and what
preventive measures can be formulated to avoid such delays.
Level5 Optimized-'Process is focused on continuous improvement':
After the collection and review of the measurements as part of Level 4,
the innovative solutions and technologies are being implemented in
organization to avoid the delays in the project and also to overcome the
challenges within the testing teams.
Case Study:
AB Ltd identified that there are at least 80% of the defects which are
consuming four man-days to fix the bugs and another two man-days for
defect retests. So it consumes at least six man-days to close a bug since
the date it has been raised. AB Ltd puts forward a demand to get these
defects be fixed and retested within two man-days, hence, organization
introduced the defect managers in each testing projects who control and
assign the defects to right developers and get them fixed on time on the
same day or the next. The responsibility of defect retest to get completed
within eight hours post fix and deployment to testing environment is
being rested upon the defect managers. Hence, AB Ltd achieves highest
quality improvement by implementing Level 5 of CMMI standards.
What CMMI means for Automation Testing World?
Test Managers introduce Automation Frameworks with most of the tests
converted to automated scheduled tests as an Innovation and 'Solution' to
overcome long-term expenses and resource need. This helps in reducing
the number of testers working in projects, reducing overall project
expenditure and increasing comfort over running huge set of tests
multiple times and increased opportunity to find more bugs.
48
50
Requirements Management
A framework can handle objects in exclusive object properties file,
similarly, cross browser compatibility, log4j enablement, XSLT
reporting are some of the capabilities within the automation framework
and was once derived by test managers and test leads as a basic
requirement to include in the scripts; Hence, these requirements are to be
managed in a document for further analysis and improvements over a
period of time.
51
Intergroup Coordination
When stable automation frameworks/tools are produced, it can be shared
across other teams for different projects by managerial coordination; It
will help in reducing the chances the repeated work of designing brand
new automation frameworks; For example, business analysts can
produce requirements in terms of feature file scenarios rather than SPSD
documents which reduces burden of work for both development and
testing team; These feature files can be reutilized for automation tests of
testing team and used for unit tests by developers as well; Similarly, tests
which are not automated can be executed directly by referring to the
cucumber feature file by functional testing teams.
52
53
Training Program
The purpose of the Training Program key process area is to develop the
skills and knowledge of testing professionals so that their performance in
their automation roles can be effectively and efficiently madeviii.
It is advisable to pre-plan the formal training on the developed
automation framework before the recruitment process of new resources
to testing teams. Clear documentation on the automation frameworks
54
along with recorded video sessions of test leads whereas explaining the
automation frameworks would reduce lot of time invested in the training
by testing resources during their tight project timelines;
For example, a new resource has joined in test automation team but
the entire team is undergoing stress due to the last three weeks of project
delivery to the clients; In such circumstances, it is impossible to provide
required training for the new resources and management expected to
make the productivity of resources since the day 1 which is a
contradiction to the plan (as the training itself not provided or
Incomplete); In these project situations, recorded video sessions and
documentations contribute as major advantages on the training plans for
the new resources included in the test automation teams.
55
56
57
defects and the implications of the defects for future activities are
determined for the framework implementation.
Avoiding the defects within test automation framework needs a
continuous monitoring on the scripts to amend and repeat the latest
objects associated with the projects; Also when browsers, operating
systems are upgraded, compatible browsers are to be deployed within
framework immediately to avoid the defects within the framework.
58
Alternative Script:
System.setProperty("WebDriver.chrome.driver",
System.getProperty("user.dir")+"//BrowserDrivers//chromedriver.exe");
driver = new ChromeDriver();
Selenium 3 onwards:
Gecko driver need to be downloaded and respective path has to be
provided in system set property in order to run the tests in Firefox
browser.
Example:
System.setProperty(GeckoDriverService.GECKO_DRIVER_EXE_PRO
PERTY,"E://AutomationProject//Training//SFS//BrowserDrivers//gecko
driver.exe");
WebDriver driver = new FirefoxDriver();
Wait<WebDriver> wait=new WebDriverWait(driver,30);
driver.get("http://www.raghava.uk");
Alternative Script:
System.setProperty("WebDriver.ie.driver",
System.getProperty("user.dir")+"//BrowserDrivers//IEDriverServer.exe";
driver = new InternetExplorerDriver();
59
Note:
Make sure that Internet Explorer Driver is imported using the code,
import org.openqa.selenium.ie.InternetExplorerDriver;
60
61
driver.findElement(By.xpath("//input[@name='FirstName034']")).sendK
eys("FirstName");
/* FirstName034 refers to the object id captured by xpath identification
techniques (refer the appropriate section to learn how it can be
discovered) and FirstName is the parameter used in the class file and the
name of the column in excel where this details are provided.*/
/*To locate alert on the web page using the object Alertpopup, please
switch to alert box from web page:*/
Alert Alertpopup = driver.switchTo().alert();
//Read the text present in the alert popup and save it in a string in order to
print it later:
String Alerttext = Alertpopup.getText();
/*Get the text of alert to be printed during execution in test logs so that
tester can verify during run time or after execution*/
System.out.println(Alerttext);
Thread.sleep(2000);
// Click Cancel on alert popup perform dismiss action:
Alertpopup.dismiss();
If alert popup request input from user to enter user id once again for
authentication confirmation,that can be done by sending the keys as
below:
driver.findElement(By.xpath("//input[@value='OBJECT
NAME']")).click();
/*To locate alert on the web page using the object Alertpopup, please
switch to alert box from web page:*/
Alert Alertpopup = driver.switchTo().alert();
//Read the text present in the alert popup and save it in a string in order
to print it later:
String Alerttext = Alertpopup.getText();
/*Get the text of alert to be printed during execution in test logs so that
tester can verify during run time or after execution*/
System.out.println(Alerttext);
Alerttext.sendKeys("User123");
Thread.sleep(2000);
//To accept/Click Ok on alert popup perform accept action:
Alertpopup.accept();
How to compare the text presented in the web page with expected
texts using Selenium WebDriver?
During the test execution, certain texts are to be validated; When
customers submit the personal details, some of the websites display form
submission status such as 'thank you for registration' or relevant
messages as described in the Business Specifications. This has to be
validated using assertequals method in selenium WebDriver.
Example:
63
@Test
public void assertion_method () {
Actualtext = driver.findElement(By.xpath("<ObjectID>")).getText();
/*Text from the webpage is saved in Actualtext object and compared in
the below script*/
Assert.assertEquals(Actualtext, "Form Submission Successful");
System.out.print("\n assertion_method execution successful");
}
How to find whether the checkbox selected (or not )using Selenium
WebDriver?
During test execution, certain checkboxes are bydefaulted selected, some
or not.This can be verfied using isSelected command in asserTrue.If
executed, it update pass when checkbox selected,otherwise it fails the
step and stop the test!
@Test
public void asserttrue1() {
System.out.print("\n"+checkbox.isSelected());
Assert.assertTrue(chkbox12.isSelected());
System.out.print("\n asserttrue1 - > Executed - means assertion is
pass");
}
64
How to click on the sub menu from menu using mouse hovering
event in Selenium WebDriver?
When menu bar of the web page has sub menu items, it is difficult to click
on them at times; This is solved by mouse hovering commands where
selenium move the mouse over menu to open sub menu and clicks on the
respecive submenu item as below:
Actions mouse_actions = new Actions(driver);
WebElement mouse_moveonmenu =
driver.findElement(By.xpath("<Object ID>"));
mouse_actions.moveToElement(mouse_moveonmenu);
mouse_actions.perform();
65
@Test
public void sampletest () throws InterruptedException, IOException
{
//Capture entire page screenshot and then store it to destination drive
File snapshot =
((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(snapshot, new File("C:\\screenshot.jpg"));
System.out.print("Snapshot is saved in C: Drive");
}
66
How to select multiple items from the list box using Selenium
WebDriver?
When list boxes are designed with multiple user selections, it is easy to
select the items as below:
Use the below line of code to use select user interface within the code:
import org.openqa.selenium.support.ui.Select;
@Test
public void sampletest () throws InterruptedException
{
Select listbox = new Select(driver.findElement(By.xpath("<Object
ID>']")));
67
How to get the Page Title of web page using Selenium WebDriver?
When tester validate particular page, it is good to check the title using
driver.getTitle(); to make sure the text presented as expected and
mentioned as per system specifications.
/*Use the below command and print in the logs to validate the title of the
page */
String pagetitle = driver.getTitle();
System.out.print(pagetitle);
68
driver.findElement(By.id("uploadnewfile")).sendKeys("E:\AutomationPr
oject\Training\DataDrivenFramework\ExcelFolder\TestInput.xlsx");
Reference:
Andreas Ebbert-Karroum. (09/07/10), File Downloads With
Selenium - Mission Impossible? [Web log post]. Retrieved from
https://blog.codecentric.de/en/2010/07/file-downloads-with-
selenium-mission-impossible/
69
Explicit Wait:
WebDriverWait wait = new WebDriverWait(driver, 20);
wait.until(ExpectedConditions.textToBePresentInElementLocated(By.xp
ath("//div[@id='<Object ID>']"), "Enter Your Personal Details"));
/*Introduce the instance of WebDriverWait and set the timer for 20
seconds and literally this means, the wait command wait only until the
text getting visible on the object;If the text present in 3 seconds and the
wait completes waiting at 3rd second and move to next line of command
hence tester can avoid waiting 20 long seconds and save 17 seconds in
this example.*/
Sleep command:
Introducing the line below gives 10 seconds sleeping time to the overall
test execution and halt the entire tests until given duration.
Thread.Sleep(10);
What is Polling?
Polling time is basically next iteration wait time for driver. If object not
found during test execution, WebDriver will come to check the
availabilty of object after 2 sec in the example above
Refer:.pollingEvery(2, SECONDS)
70
What is Timeout?
Maximum time to wait for an object and it waits for 20 sec in the
example above
What is Ignoring?
Ignores any given exception in the statement. In the above example, if
object not found, browser throws nosuchelementexception and it is
caught by the line below.
Refer:
.ignoring(NoSuchElementException.class)
@Test
public void sampletest ()
{
JavascriptExecutor javascript = (JavascriptExecutor) driver;
Sample code:
@Test
public void test () throws InterruptedException
{
//Generating Alert Using Javascript Executor
JavascriptExecutor javascript = (JavascriptExecutor) driver;
javascript.executeScript("alert(' Regression Tests are started
Successfully');");
Thread.sleep(3000);
72
driver.switchTo().alert().accept();
}
Select by Index:
Select listbox = new
Select(driver.findElement(By.xpath("//select[@name='car']")));
listbox.selectByIndex(0);
Deselect by Value:
Select listbox = new
Select(driver.findElement(By.xpath("//select[@name='City']")));
listbox.deselectByValue("Bengaluru");
Deselect by Index:
Select listbox = new
Select(driver.findElement(By.xpath("//select[@name='State']")));
listbox.deselectByIndex(2);
Deselect All:
Select listbox = new
Select(driver.findElement(By.xpath("//select[@name='Country']")));
listbox.deselectAll();
73
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.Select;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@Before
public void beforetest() {
driver.manage().window().maximize();
driver.get("page url")
}
@Test
public void test () throws InterruptedException
{
//Selecting value from drop down using visible text
Select drpdwn = new Select(driver.findElement(By.id("Cars")));
drpdwn.selectByVisibleText("Lambogini");
}
@After
public void aftertest() {
driver.quit();
}
}
74
Sample code:
@Test
public void webelementtest () throws InterruptedException
{
for (int attempt=1; attempt<4; i++)
{
//To verify element is present on the respective page or not:
String XPath = "//input[@id='emailID"+i+"']";
Boolean iselementpresent =
driver.findElements(By.xpath(XPath)).size()!= 0;
if (iselementpresent == true)
{
System.out.print("\nTargeted Email ID Box"+i+" Is Present On The
Page");
}
else
{
System.out.print("\nTargeted Email ID Box"+i+" Is Not Present On The
Page");
76
}
}
}
// Get and store both window handles in array in such a way that all new
pages are getting loaded in Array:
Set<String> AllWindowHandles = driver.getWindowHandles();
String window1 = (String) AllWindowHandles.toArray()[0];
System.out.print("window1 handle code =
"+AllWindowHandles.toArray()[0]);
String window2 = (String) AllWindowHandles.toArray()[1];
System.out.print("\nwindow2 handle code =
"+AllWindowHandles.toArray()[1]);
77
driver.switchTo().window(window2);
driver.findElement(By.xpath("//input[@name='firstname']")).clear();
driver.findElement(By.xpath("//input[@name='fname']")).sendKeys("Ra
ghava");
Thread.sleep(5000);
driver.close();
//Once Again switch to window1(parent window) and performing actions
on top of the Home Page:
driver.switchTo().window(window1);
driver.findElement(By.xpath("//input[@value='Female']")).click();
Thread.sleep(5000);
}
Reference:
Aravind. (2016, September 07). Software testing tutorials and
automation [Web log post]. Retrieved from http://www.software-
testing-tutorials-automation.com/p/selenium-WebDriver.html
Syam. (2015, January 29). XLS Reading for DDF [Web log post].
Retrieved from http://pssqtp.blogspot.co.uk/2015/01/xls-reading-
for-ddf.html
zhaozhiwen (2016, June 16). 手把手教你搭建数据驱动测试框架
[Web log post]. Retrieved from
http://www.jianshu.com/p/206654aeae29
78
Screenshot:
80
import org.openqa.selenium.firefox.*;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.remote.DesiredCapabilities;
public class LaunchBrowser_Firefox {
static WebDriver driver;
public static void main(String[] args){
//Firefox47.o above and Selenium 3.o -option1:
/*
System.setProperty("WebDriver.gecko.driver","E://AutomationProject//
Training//SFS//BrowserDrivers//geckodriver.exe");
FirefoxProfile p= new FirefoxProfile();
p.setPreference("plugin.disable_full_page_plugin_for_types",
"application/pdf,application/vnd.adobe.xfdf,application/vnd.fdf,applicati
on/vnd.adobe.xdp+xml");
*/
//Firefox47.o above and Selenium 3.o -option2:
/*DesiredCapabilities capabilities=DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
WebDriver driver = new FirefoxDriver(capabilities);*/
//Firefox47.o above and Selenium 3.o -option3:
/*String currentDir = System.getProperty("user.dir");
String marionetteDriverLocation = currentDir +
"//BrowserDrivers//geckodriver.exe";
System.setProperty("WebDriver.gecko.driver",
marionetteDriverLocation);
@SuppressWarnings("deprecation")
WebDriver driver = new MarionetteDriver();*/
//Firefox 45.o and Selenium 2.45-option2:
/*
DesiredCapabilities dc=DesiredCapabilities.firefox();
driver = new FirefoxDriver(dc);
*/
//Firefox 45.o and Selenium 2.45-option3:
/*
FirefoxBinary binary = new FirefoxBinary(new File("C:\\Program
Files\\Mozilla Firefox\\firefox.exe"));
FirefoxProfile profile = new FirefoxProfile();
WebDriver driver = new FirefoxDriver(binary, profile);
//https://github.com/seleniumhq/selenium-google-code-issue-
archive/issues/7954
81
*/
//Firefox 45.o and Selenium 2.45 -Option1:
WebDriver driver = new FirefoxDriver();
driver.get("http://www.yahoo.com");
}
}
When launching the tests, click OK for the security Alerts which may
pop up during first time test execution:
82
package com.sfs.SuiteOne;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
public class LaunchBrowser {
static WebDriver driver;
public static void main(String[] args){
System.setProperty("WebDriver.chrome.driver","E://AutomationProject/
/Training//SFS//BrowserDrivers//chromedriver.exe");
ChromeOptions options=new ChromeOptions();
83
options.addArguments("--disabled-extensions");
driver = new ChromeDriver(options);
driver.get("www.yahoo.com");
}
}
Script Reference:
https://github.com/narayananpalani/testautomation/tree/master/017L
androverTestProject_Shivani
84
Please download the complete project from above link using Download
Zip option and read the details further for better understanding and
clarity of the project design.
Steps to implement:
Create a project within Eclipse and create two packages in the name
cucumber and cucumber.features (follow the pictures for examples);
Once created packages,create TestRun.java file and just copy the below
code:
package cucumber;
//import cucumber.api.CucumberOptions;
import org.junit.runner.RunWith;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@Cucumber.Options(format = {"pretty","html:target/cucumber-html-
report", "json:target/cucumber-report.json"},
features = {"src/cucumber/testlandrover.feature"})
public class TestRun {
}
This TestRun is the primary file to run the tests using Cucumber;The
next step is to create a .feature file within cucumber.features package like
the below:
85
86
87
This IOException helps in catching the issues during the compilation and
test execution:
import java.io.IOException;
import org.apache.commons.io.FileUtils;
Selenium files to handle automation engine control over the target
application:
import org.openqa.selenium.By;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
Various drivers for the automation project are listed here. Based on the
needs, user can pick respective driver for the test:
//import org.openqa.selenium.android.AndroidDriver;
import org.openqa.selenium.chrome.ChromeDriver;
//import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.interactions.Actions;
//import org.openqa.selenium.iphone.IPhoneDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
//import org.openqa.selenium.safari.SafariDriver;
Java Utility file:
import java.util.concurrent.TimeUnit;
//import com.sun.jna.platform.FileUtils;
Cucumber files to help the given, when, and, then model of scripts are
listed here. If Then is missing in the import(as an example),it throw error
during compilation:
//import cucumber.api.java.After;
import cucumber.api.java.Before;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
//import cucumber.api.java.en.And;
//import cucumber.runtime.PendingException;
public class landrover {
//private static final String FILE = null;
public WebDriver browser;
See the below script on @Before. This is the primary reason why
following test results are logged during test execution:
Console based Test Results:
88
89
browser.get("<website URL>");
}
'When' script in the step definition file which connects from feature file
and execute the action below:
@When("^I click on AboveandBeyond Tab and verify FINDOUTMORE
button$")
public void
I_click_on_AboveandBeyond_Tab_and_verify_FINDOUTMORE_button
()
{
The id mentioned in the line below has to be identified using xpath within
the page and then update in this code. (refer object capturing techniques
chapter: 'Object Capturing Techniques for Automation Testing' related
to this method)
browser.findElement(By.id("MainNavigation:ABOVE AND
BEYOND:/above-and-beyond/index.html")).click();
//browser.findElement(By.id("HeroCarousel:FIND OUT
MORE:https://live.landrover.co.uk/")).click();
browser.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
//String value = browser.findElement(By.id("295-82654")).getText();
//browser.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
//browser.findElement(By.cssSelector("span.image.backgroundImage")).
click();
browser.findElement(By.id("MainNavigation:ABOVE AND
BEYOND:/above-and-beyond/index.html")).click();
browser.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
browser.findElement(By.id("HeroCarousel:FIND OUT MORE:/above-
and-beyond/reborn.html")).click();
}
'Then' script which updates the test results with TEST PASS:
@Then("^I see the AboveandBeyond Section of Landrover Page$")
public void I_see_the_AboveandBeyond_Section_of_Landrover_Page()
{
System.out.println("TEST PASS");
}
}
90
91
package com.stta.SeleniumBasics;
import java.util.concurrent.TimeUnit;
JUnit tests are using Before,After and Test methods of Junit and
following imports are required in such cases:
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
This section is getting executed before the actual test using JUnit and
@Before is the tag of JUnit:
@Before
public void setUp() throws Exception {
//DesiredCapabilities dc=DesiredCapabilities.firefox();
//driver = new FirefoxDriver(dc);
Property of browser is set to take the browser file from respective local
machine's location. Tester has to get this path updated before running the
test:
92
System.setProperty("WebDriver.chrome.driver",
System.getProperty("user.dir")+"//BrowserDrivers//chromedriver.exe");
driver = new ChromeDriver();
This particular function exactly search and match the results to validate
the search results:
@Test
public void basicGoogleFindTest() {
GoogleSearch googleweb = new GoogleSearch(driver);
googleweb.searchFor("Software Automation Testing Secrets Revealed");
boolean txt_result = googleweb.searchResultPresent("Software
Automation Testing Secrets Revealed");
assert (txt_result == true);
}
After finishing those main tests, @After can be called and driver.close();
or driver.quiet(); can be used based on needs:
@After
public void tearDown() throws Exception {
driver.quit();
}
}
This assert section helps in verifying the search result page fro
google.com:
assert (verifyPage() == true);
93
Before searching in every test, search box has been cleared out to get
right results:
driver.findElement(searchBox).clear();
Search term has been sent to the search box and sendKeys is used to send
the particular text through object searchTerm:
driver.findElement(searchBox).sendKeys(searchTerm);
Once search item entered on search box, search button can be pressed
using click(); command:
driver.findElement(searchBoxSubmit).click();
}
94
Reference:
Matt,B. (2016, June 30)cucumber-js-selenium-WebDriver-example
[Web log post]. Retrieved from https://github.com/Matt-
B/cucumber-js-selenium-WebDriver-example
Dave H@tourdedave ,elemental-selenium-tips [Web log post].
Retrieved from https://github.com/tourdedave/elemental-selenium-
tips
URL of the website has been sent through the code below:
ENV['txt_url'] = 'http://www.google.co.in'
95
Browser initialised in this section to visit the particular url given in the
code earlier:
def initialize(driver)
@driver = driver
visit
verify_page
end
96
This is the main section of this ruby code to run the search query and
compare results:
run {
google = GoogleSearch.new(@driver)
google.search_for 'Software Automation Testing Secrets Revealed'
result = google.search_result_present? 'Software Automation Testing
Secrets Revealed'
result.should == true
}
Reference:
Dave H@tourdedave ,elemental-selenium-tips [Web log post].
Retrieved from
https://github.com/tourdedave/elemental-selenium-tips
1. Definition
Test Automation Implementation required strong project expertise and
sampling results how certain automation tools provide benefits to the
project; In order to implement any new tool to the testing projects and
cycles, it is highly recommended to perform Proof of Concept on such
tools and evaluate the fitment. Selenium WebDriver2.o has been taken
97
into consideration in this PoC to understand how best it fits to the project
and provide Return on Investment.
2. Introduction
Selenium WebDriver based Automation Framework consists of set of
tools and processes to get implemented in web based testing cycles
carried over agile projects; This can be done by downloading the
Selenium WebDriver based java jar files from SeleniumHQxix.
Selenium 2.o version has been identified to construct the automation
framework and then it eventually support Firefox 33.o browser along
with Chrome and IE browsers for the PoC.
4. PoC Considerations
Java based Selenium Automation Framework has been considered for the
PoC and other frameworks such as C#,Python, Ruby and Java Script
based frameworks are not included in the PoC; Similarly Selenium 2.o is
identified to be used for the tests rather than selecting other tools such as
TestComplete, UFT (formerly QTP),Rational Functional Test, Silk Test
etc; Eclipse IDE (Luna version) has been selected rather than using latest
IDEs such as IntelliJ etc.
Following Page has been considered to get automated to validate the
Page Input Submission:
https://docs.google.com/forms/d/1vlQmYGyNXYMPhuLRSAJ25LtWN
eZyzYxXYMdz7WUo98w/viewform?c=0&w=1
98
99
<div class="ss-form"><form
action="https://docs.google.com/forms/d/e/1FAIpQLScLxTQWgPTnbx
Ti3uLQNPE2z4r8S_ZRcGTbfSU--WfGNDzQ0Q/formResponse"
method="POST" id="ss-form" target="_self" onsubmit=""><ol
role="list" class="ss-question-list" style="padding-left: 0;">
<div class="ss-form-question errorbox-good" role="listitem">
<div dir="auto" class="ss-item ss-item-required ss-text"><div class="ss-
form-entry">
<label class="ss-q-item-label" for="entry_1000000"><div class="ss-q-
title">Full Name
<label for="itemView.getDomIdToLabel()" aria-label="(Required
field)"></label>
<span class="ss-required-asterisk" aria-hidden="true">*</span></div>
<div class="ss-q-help ss-secondary-text" dir="auto"></div></label>
5. PoC Outcomes
Following line of codes are written to automate the target web page:
package com.stta.SuiteOne;
import java.io.IOException;
import org.openqa.selenium.By;
import org.testng.SkipException;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import org.testng.asserts.SoftAssert;
import com.stta.utility.Read_XLS;
import com.stta.utility.SuiteUtility;
//SuiteOneCaseOne Class Inherits From SuiteOneBase Class.
//So, SuiteOneCaseOne Class Is Child Class Of SuiteOneBase Class And
SuiteBase Class.
public class SuiteOneCaseOne extends SuiteOneBase{
Read_XLS FilePath = null;
String SheetName = null;
String TestCaseName = null;
String ToRunColumnNameTestCase = null;
String ToRunColumnNameTestData = null;
String TestDataToRun[]=null;
static boolean TestCasePass=true;
100
@BeforeTest
public void checkCaseToRun() throws IOException{
//Called init() function from SuiteBase class to Initialize .xls Files
init();
//To set SuiteOne.xls file's path In FilePath Variable.
FilePath = TestCaseListExcelOne;
TestCaseName = this.getClass().getSimpleName();
//SheetName to check CaseToRun flag against test case.
SheetName = "TestCasesList";
//Name of column In TestCasesList Excel sheet.
ToRunColumnNameTestCase = "CaseToRun";
//Name of column In Test Case Data sheets.
ToRunColumnNameTestData = "DataToRun";
//Bellow given syntax will Insert log In applog.log file.
Add_Log.info(TestCaseName+" : Execution started.");
//To check test case's CaseToRun = Y or N In related excel sheet.
//If CaseToRun = N or blank, Test case will skip execution. Else It will
be executed.
if(!SuiteUtility.checkToRunUtility(FilePath,
SheetName,ToRunColumnNameTestCase,TestCaseName)){
Add_Log.info(TestCaseName+" : CaseToRun = N for So Skipping
Execution.");
//To report result as skip for test cases In TestCasesList sheet.
SuiteUtility.WriteResultUtility(FilePath, SheetName, "Pass/Fail/Skip",
TestCaseName, "SKIP");
//To throw skip exception for this test case.
throw new SkipException(TestCaseName+"'s CaseToRun Flag Is 'N' Or
Blank. So Skipping Execution Of "+TestCaseName);
}
//To retrieve DataToRun flags of all data set lines from related test data
sheet.
TestDataToRun = SuiteUtility.checkToRunUtilityOfData(FilePath,
TestCaseName, ToRunColumnNameTestData);
}
101
102
driver.findElement(By.xpath("id('entry_1000002')")).sendKeys(DataCol
4);
driver.findElement(By.xpath("id('entry_1000003')")).sendKeys(DataCol
5);
driver.findElement(By.xpath("id('entry_1000004')")).sendKeys(DataCol
6);
driver.findElement(By.xpath("id('entry_1000005')")).sendKeys(DataCol
7);
driver.findElement(By.xpath("id('group_1000006_1')")).click();
driver.findElement(By.xpath("id('group_1000006_2')")).click();
driver.findElement(By.xpath("id('group_1000006_3')")).click();
driver.findElement(By.xpath("id('group_1000007_1')")).click();
driver.findElement(By.xpath("id('group_1000007_2')")).click();
driver.findElement(By.xpath("id('group_1000008_1')")).click();
driver.findElement(By.xpath("id('group_1000008_2')")).click();
driver.findElement(By.xpath("id('entry_1000009')")).sendKeys(DataCol
8);
driver.findElement(By.xpath("id('group_1000011_1')")).click();
driver.findElement(By.xpath("id('group_1000011_2')")).click();
driver.findElement(By.xpath("id('group_1000011_3')")).click();
driver.findElement(By.xpath("id('group_1000011_4')")).click();
driver.findElement(By.xpath("id('group_1000011_5')")).click();
driver.findElement(By.xpath("id('group_1000011_6')")).click();
driver.findElement(By.xpath("id('group_1000011_7')")).click();
driver.findElement(By.xpath("id('group_1000011_8')")).click();
driver.findElement(By.xpath("id('group_1000011_9')")).click();
driver.findElement(By.xpath("id('group_1000011_10')")).click();
driver.findElement(By.xpath("id('group_1000011_11')")).click();
driver.findElement(By.xpath("id('group_1000012_1')")).click();
driver.findElement(By.xpath("id('group_1000012_2')")).click();
driver.findElement(By.xpath("id('group_1000012_3')")).click();
driver.findElement(By.xpath("id('group_1000012_4')")).click();
driver.findElement(By.xpath("id('group_1000012_5')")).click();
driver.findElement(By.xpath("id('ss-submit')")).click();
String Result = getElementByName("txt_Result").getAttribute("value");
//To Convert data from String to Integer
int ActualResultInt = Integer.parseInt(Result);
//Compare actual and expected values.
if(Testfail){
103
//At last, test data assertion failure will be reported In testNG reports and
It will mark your test data, test case and test suite as fail.
s_assert.assertAll();
}
}
104
}
//This data provider method will return 4 column's data one by one In
every Iteration.
@DataProvider
public Object[][] SuiteOneCaseOneData(){
return SuiteUtility.GetTestDataUtility(FilePath, TestCaseName);
}
//To report result as pass or fail for test cases In TestCasesList sheet.
//@AfterTest
public void closeBrowser(){
//To Close the web browser at the end of test.
closeWebBrowser();
if(TestCasePass){
Add_Log.info(TestCaseName+" : Reporting test case as PASS In
excel.");
SuiteUtility.WriteResultUtility(FilePath, SheetName, "Pass/Fail/Skip",
TestCaseName, "PASS");
}
else{
Add_Log.info(TestCaseName+" : Reporting test case as FAIL In
excel.");
SuiteUtility.WriteResultUtility(FilePath, SheetName, "Pass/Fail/Skip",
TestCaseName, "FAIL");
}
}
}
105
7. Risks Associated
Re-installation of browsers and additional Addins to the browsers and
change of Operating System to the target machine are critical factors to
relook and amend the automation framework to work in latest test
environments. If Selenium 3.o is implemented to the framework, gecko
driver is to be used for firefox tests which is a high risk at the moment as
beta version of Selenium 3.o is likely to fail for gecko driver or
marionette drivers as on 28Aug2016 (which may change later period of
time based on the upgraded versions of Selenium)
If the browsers are upgraded to later versions for firefox (example
47 and above) which will not be compatible to the automation
framework constructed as part of this PoC. Similarly change in
Operating Systems from Win 2007 to later versions may impact the
current automation framework built for the PoC.
8. Problems in Automation
It is not possible to automate the applications other then web pages in
selected Selenium based Automation Framework.
106
LoadWebBrowser();
Called in the test case at
SAF/src/com/stta/SuiteOne
LoadWebBrowser Function
in
SAF/src/com/stta/TestSuiteBase
Browser Selection
In param.properties
SAF/src/com/stta/property
Test Execution
107
Screenshot Utility
SAF/src/com/stta/utility
Screenshot Parameter
in param.properties
SAF/test-output
Location of Screenshots
SAF/screenshots
108
Test
included in TestNG XML
SAF/test-output
Test Case
Updated in SuiteOne Folder
SAF/src/com/stta/SuiteOne
Reusable Components
Updated in SuiteBase
SAF/src/com/stta/TestSuiteBase
Object Properties
Updated in object.properties
SAF/src/com/stta/property
Figure 71 Object Repository
109
Test
included in TestNG XML
SAF/test-output
driver.get(“SiteURL”);
Test Case
Updated in SuiteOne Folder
SAF/src/com/stta/SuiteOne
Reusable Components
Updated in SuiteBase
SAF/src/com/stta/TestSuiteBase
SiteURL
Updated in param.properties
SAF/src/com/stta/property
Figure 72 Parameter Management
110
“testng-results.xml” “emailable-report.html”
Updated in XML Test Execution XSLT updated in
SAF/test-output SAF/test-output
111
Logging Capability
Tests
Included in TestNG XML
SAF/test-output
Test Execution
Logs
“applog.log”
updated in
SAF/src/com/stta/Logging
113
Standalone Automation No
Android Automation No
Reference:
Aravind. (2016, September 07). Software testing tutorials and
automation [Web log post]. Retrieved from http://www.software-
testing-tutorials-automation.com/p/selenium-WebDriver.html
115
Syam. (2015, January 29). XLS Reading for DDF [Web log post].
Retrieved from http://pssqtp.blogspot.co.uk/2015/01/xls-reading-
for-ddf.html
zhaozhiwen (2016, June 16). 手把手教你搭建数据驱动测试框架
[Web log post]. Retrieved from
http://www.jianshu.com/p/206654aeae29
Reference:
https://github.com/narayananpalani/testautomation/tree/master/SAF/s
rc/com/stta/TestSuiteBase
Where you can find this file in framework:
SAF\src\com\stta\TestSuiteBase
File Name: SuiteBase.java
Coding Style: Java Programming
116
Step4: When the click event getting changed in the project to user inputs
based text box, tester is required to update just one line in the function
below:
public WebElementClick(String Key){
try{
return driver.findElement(By.id(Object.getProperty(Key))) .
sendKeys("what is your date of birth");
}catch(Throwable t){
Add_Log.debug("Object not found for key or not ready--"+Key);
return null;
}
117
118
Reference:
Aravind. (2016, September 07). Software testing tutorials and
automation [Web log post]. Retrieved from http://www.software-
testing-tutorials-automation.com/p/selenium-WebDriver.html
Syam. (2015, January 29). XLS Reading for DDF [Web log post].
Retrieved from http://pssqtp.blogspot.co.uk/2015/01/xls-reading-
for-ddf.html
zhaozhiwen (2016, June 16). 手把手教你搭建数据驱动测试框架
[Web log post]. Retrieved from
http://www.jianshu.com/p/206654aeae29
Download the zip file and extract all to a local file folder.
Launch Eclipse:
119
Choose the Workspace (or create a new location to be the workspace for
this test):
120
121
122
Step1:
123
124
Click on OK and move to src folder. Right click on src folder to create a
package:
Once Package is created, create a java class file (main test file) in the
name ExcelDataCheckTest.java:
125
Import below set of files which are originally configured to the project
path through jar files:
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
126
Once created, right click and go to properties to see the path of the file
and open it in windows and create TestInput.xlsx data file:
127
Code:
Workbook sampleExcel = null;
//These lines are splitting the file name from extension to understand
what filetype the excel based on? (either xls or xlsx)
String extType = fileName.substring(fileName.indexOf("."));
//Check if xlsx file
if(extType.equals(".xlsx")){
//If it is xlsx file ,following class has to be created:
sampleExcel = new XSSFWorkbook(inputStream);
}
128
129
Next Step:
This ReadExcel class has to be called in any main function and use the
test data into the main program.
130
131
}
//This step is required to read the sheet name within the excel file:
Sheet winexcelSheet = sampleExcel.getSheet(sheetName);
//Find number of rows in excel file
int numberOfRows = winexcelSheet.getLastRowNum()-
winexcelSheet.getFirstRowNum();
//Read the excel data from a loop:
for (int a = 0; a < numberOfRows+1; a++) {
Row row = winexcelSheet.getRow(a);
//Print the data using a loop
for (int b = 0; b < row.getLastCellNum(); b++) {
//Print data in console output to read and understand how it is executed
System.out.print(row.getCell(b).getStringCellValue()+"|| ");
}
System.out.println();
}
}
private static WebDriver driver = null;
public static void main(String[] args)throws IOException{
System.setProperty("WebDriver.chrome.driver","E://AutomationProject/
/Training//SalesforceTestAutomation//BrowserDrivers//chromedriver.ex
e");
driver = new ChromeDriver();
driver.get("https://login.salesforce.com");
ExcelDataCheckTest objExcel=new ExcelDataCheckTest();
String fileLocation =
System.getProperty("E:\\AutomationProject\\Training\\DataDrivenFram
ework\\ExcelFolder\\TestInput.xlsx");
objExcel.ReadExcel(fileLocation, "TestInput.xlsx", "TestSheet1");
LoginPOM.txt_sfusername(driver).sendKeys("Narayanan@narayanan.co
m");
LoginPOM.txt_sfpwd(driver).sendKeys("HelloWorld");
LoginPOM.btn_sfLogin(driver).click();
driver.quit();
}
}
Expalanation: Following set of three line code call the entire test data
input class file (called ReadExcel) and take the test inputs:
ExcelDataCheckTest objExcel=new ExcelDataCheckTest();
132
String fileLocation =
System.getProperty("E:\\AutomationProject\\Training\\DataDrivenFram
ework\\ExcelFolder\\TestInput.xlsx");
objExcel.ReadExcel(fileLocation, "TestInput.xlsx", "TestSheet1");
Test excel sheet's user inputs are taken into the main class and
successfully printed!
Note: JXL API is not used in the test example above as it is not
supported to get data inputs from xlsx based data files.
Data inputs (to test execution) to feed as user inputs and data
outputs(from test execution) of test results to excel files are explained in
the next section.
Reference:
Guru99. (2016, September 22), All About Excel in Selenium: POI &
JXL [Web log post]. Retrieved from http://www.guru99.com/all-
about-excel-in-selenium-poi-jxl.html
Data Driven Tests using Excel Files with Selenium Web Driver
This section explains how the excel file based test data are used within
the automation framework and one of the key section for Data Driven
Framework Design.
Knowing the fact that Selenium WebDriver doesn't support excel
based test data directly and this challenge can be rectified by writing
class files to get excel files talk to Selenium based Automation
Framework.
JXL library is used for data driven testing framewrowks to provide
classes and methords and interact with excel files in xls format.If Apache
POI library has been used, tester can access xls or xlsx within the project.
133
Reference:
https://github.com/narayananpalani/testautomation/tree/master/SAF/s
rc/com/stta/utility
Where you can find this file in framework: SAF\src\com\stta\utility
File Name: Read_XLS.java
Coding Style: Java Programming
Example:
134
Example:
Example:
To write result In test suite list sheet ' writeResult' scripts are written.
Basically test automation frameworks are expected to get the inputs from
test excel files and then return the results after testing the application to
the same excel files or different excel files based on the need. In this
automation framework, test results are updated in the same excel files
with PASS/FAIL status to clarify whether the tests are execute, passed or
failed. In the script of ' writeResult', it is updating the results of Suites
(not the test cases):
Example:
Reference:
Aravind. (2016, September 07). Software testing tutorials and
automation [Web log post]. Retrieved from http://www.software-
testing-tutorials-automation.com/p/selenium-WebDriver.html
Syam. (2015, January 29). XLS Reading for DDF [Web log post].
Retrieved from http://pssqtp.blogspot.co.uk/2015/01/xls-reading-
for-ddf.html
zhaozhiwen (2016, June 16). 手把手教你搭建数据驱动测试框架
[Web log post]. Retrieved from
http://www.jianshu.com/p/206654aeae29
136
Reference:
https://github.com/narayananpalani/testautomation/tree/master/SAF/s
rc/com/stta/utility
Where you can find this file in framework: SAF\src\com\stta\utility
File Name: ScreenshotUtility.java
Coding Style: Java Programming
137
Following three important elements are imported from TestNG jar file to
support screenshot capture:
import org.testng.ITestContext;
import org.testng.ITestListener;
import org.testng.ITestResult;
Example:
This method will execute only on the event of fail test and get it saved in
Failure folder within automation framework:onTestFailure
Example:
138
This method will execute before the main test start (see '@Test'
within suiteonecaseone java file for example); So it takes control of the
test and receive test result:onTestStart
This method will execute only if any of the main test(@Test) get
skipped:onTestSkipped
Following lines are the main function to capture screenshot and
name it with date,time and then save in the location:captureScreenShot
To capture screenshot:File scrFile
Following is the format in which name suffix getting updated hence
tester can pick up right screenshot based on timings: dateFormat
Example:
XSLT Reporting
The best part of Selenium-TestNG based automation framework is that
the reporting can be extended as html email-able reports using XSLT
reporting! This can be done simply by using xsl file ' testng-results.xsl'.
Reference:
https://github.com/narayananpalani/testautomation/tree/master/SAF/s
rc/com/stta/xslt
Where you can find this file in framework: SAF\src\com\stta\xslt
File Name: testng-results.xsl
Coding Style: XSL Programming
When tests are getting executed,reports can be accessed from the file:
test-output folder
Example in Git folders:
https://github.com/narayananpalani/testautomation/blob/master/SAF/test-
output/emailable-report.html
139
140
Click on the HTML file and select the type as 'Insert as Text':
141
When the test results added as text, it convert the email with html test
results within the message section:
Figure 111 Insert As Text result in adding the HTML Test Results
within Email Content
142
These lines given above are samples and it can be condensed with
multiple test environment details such as:
#Web Application URL
TestEnvironment1_URL=http://abc.com
TestEnvironment2_URL=http://def.com
TestEnvironment3_URL=http://ghi.com
#set Mozilla or Chrome or IE7 or IE8 or IE9 or Opera
testBrowser=Chrome
#Set Screenshot flags "Yes" or "No"
screenShotOnFail=Yes
screenShotOnPass=Yes
Step3: When test has to be executed, amend param file with respective
settings such as browser, url and other details to compile and run the
project.
Note: There are two types of browser exes such as 32 bit and 64 bit; If
incorrect exe file is placed in 'BrowserDrivers' folder then the test will be
very slow; Always verify target machine's system property (32 bit or 64
143
144
TestNG Files:
File1: SuiteOne.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--SuiteOne:Login -->
<suite name="SuiteOne">
<!-- SuiteOneCaseOne: Login with valid user id and password of
customers using Chrome-->
<test name="SuiteOneCaseOne">
<classes>
<class name="com.stta.SuiteOne.SuiteOneCaseOne" ></class>
</classes>
</test>
<!-- SuiteOneCaseTwo: Login with valid admin id and password of
Administrator using IE7-->
<test name="SuiteOneCaseTwo">
<classes>
<class name="com.stta.SuiteOne.SuiteOneCaseTwo" ></class>
</classes>
</test>
</suite>
File2: SuiteTwo.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- SuiteTwo:Add to Shopping Cart-->
<suite name="SuiteTwo">
<!-- SuiteTwoCaseOne: Add one product to shopping cart using Firefox-
->
<test name="SuiteTwoCaseOne">
<classes>
<class name="com.stta.SuiteOne. SuiteTwoCaseOne " ></class>
145
</classes>
</test>
<!-- SuiteTwoCaseTwo:Add multiple products to shopping cart using
Chrome-->
<test name="SuiteTwoCaseTwo">
<classes>
<class name="com.stta.SuiteOne. SuiteTwoCaseTwo " ></class>
</classes>
</test>
<!-- SuiteTwoCaseThree:Add multiple products to shopping cart and
delete multiple products from shopping cart using IE8-->
<test name="SuiteTwoCaseThree">
<classes>
<class name="com.stta.SuiteOne. SuiteTwoCaseThree " ></class>
</classes>
</test>
<!-- SuiteTwoCaseFour:Add products to shopping cart,logout and login
to validate the products added to shopping cart in earlier session using
Firefox-->
<test name="SuiteTwoCaseFour">
<classes>
<class name="com.stta.SuiteOne.SuiteTwoCaseFour " ></class>
</classes>
</test>
</suite>
File3:testng.xml
<?xml version="1.0" encoding="UTF-8"?>
<suite name="Calc Suite">
<!-- Enter the listeners such as ScreenshotUtility,QC Integration
Utility,Defect Raising Utility in the section below-->
<listeners>
<listener class-name="com.stta.utility.ScreenshotUtility"></listener>
</listeners>
<!-- Enter the list of TestNG xml files in this section below;Those test
xml files will be called from this file and respective tests from those files
will get executed through this single file-->
<suite-files>
<suite-file path="./SuiteOne.xml" />
<suite-file path="./SuiteTwo.xml" />
146
</suite-files>
</suite>
Note: If TestNG is not installed to the framework, tester won't get the
TestNG logo in this list of options.
147
TestNG Annotations
While using Selenium WebDriver based java test automation
frameworks, TestNG has been added to configure and execute test suites
and test cases within the framework build. So entire selenium based tests
are executed from TestNG xml files. Certain annotations are used in
TestNG similar to JUnit and this section provide sample code snippets
for some of the popular annotations of TestNG.
Case1:
In order to execute a particular web based test, browser has to be
launched and url has to be updated on the browser- @BeforeTest of
TestNG can be used to perform these actions in every tests.Proper tests
can be scripted under the annotation @Test of TestNG; Similarly once
the test has been executed, browser has to be closed and this action can
be scripted in @AfterTest annotation based section.
Sample Code:
In the test described below, web page getting launched with respective
url using @BeforeTest annotation of TestNG and @Test section getting
executed and then the final section @AfterTest is getting executed.
package junitreporttestpackage;
import java.io.IOException;
import org.openqa.selenium.By;
148
import org.testng.SkipException;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
Execution:
Run the tests and observe the console output for this test.
@BeforeTest section executed
@Test section executed
@AfterTest section executed
149
Case2:
Perform the same set of scripts with more than one test in a given test
execution and validate the outputs.
Sample Code:
package junitreporttestpackage;
import java.io.IOException;
import org.openqa.selenium.By;
import org.testng.SkipException;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
150
drpdwn.selectByVisibleText("APSRTC");
}
@AfterTest
public void aftertest() {
driver.quit();
}
}
Execution:
Run the tests and observe the console output for this test.
@BeforeTest section executed
@Test section executed for SampleTest1
@AfterTest section executed
@BeforeTest section executed
@Test section executed for SampleTest2
@AfterTest section executed
151
System.setProperty(GeckoDriverService.GECKO_DRIVER_EXE_PRO
PERTY,"E://AutomationProject//Training//SFS//BrowserDrivers//gecko
driver.exe");
WebDriver driver = new FirefoxDriver();
Wait<WebDriver> wait=new WebDriverWait(driver,30);
@BeforeClass
public void beforetest() {
driver.get("http://www.yahoo.com");
driver.manage().window().maximize();
}
@Test
public void SampleTest1 () throws InterruptedException
{
//Selecting value from drop down using visible text
Select drpdwn = new Select(driver.findElement(By.id("Bus")));
drpdwn.selectByVisibleText("KSRTC");
}
@Test
public void SampleTest2 () throws InterruptedException
{
//Selecting value from drop down using visible text
Select drpdwn = new Select(driver.findElement(By.id("Bus")));
drpdwn.selectByVisibleText("APSRTC");
}
@AfterClass
public void aftertest() {
driver.quit();
}
}
Execution:
Run the tests and observe the console output for this test.
@BeforeClass section executed
@Test section executed for SampleTest1
@Test section executed for SampleTest2
@AfterClass section executed
152
153
driver.findElement(By.type("userID")).sendKeys(UserName);
driver.findElement(By.type("Password")).sendKeys(Pwd);
driver.findElement(By.type("LoginButton")).Click();
}
@DataProvider
public Object[][] LoginDetails() {
return new Object[][]{{"Narayanan"}, {"HelloWorld"}};
}
}
154
}
@Test(priority=3)
public void SampleTest1 () throws InterruptedException
{
//Selecting value from drop down using visible text
Select drpdwn = new Select(driver.findElement(By.id("Bus")));
drpdwn.selectByVisibleText("KSRTC");
}
@Test(priority=2)
public void SampleTest2 () throws InterruptedException
{
//Selecting value from drop down using visible text
Select drpdwn = new Select(driver.findElement(By.id("Bus")));
drpdwn.selectByVisibleText("TNSTC");
}
@Test
public void SampleTest3 () throws InterruptedException
{
//Selecting value from drop down using visible text
Select drpdwn = new Select(driver.findElement(By.id("Bus")));
drpdwn.selectByVisibleText("APSRTC");
}
@Test(priority=1)
public void SampleTest4 () throws InterruptedException
{
//Selecting value from drop down using visible text
Select drpdwn = new Select(driver.findElement(By.id("Bus")));
drpdwn.selectByVisibleText("MHRTC");
}
@AfterClass
public void aftertest() {
driver.quit();
}
}
Execution:
Run the tests and observe the console output for this test.
@BeforeClass section executed
@Test section executed for SampleTest3
155
Reference:
TestNG (2016 September22)Annotations [Web log post]. Retrieved
from http://testng.org/doc/documentation-main.html#annotations
Aravind (2016 September22)Example Of Difference Between
@Before/@After VS @BeforeClass/@AfterClass In JUnit With
WebDriver [Web log post]. Retrieved from http://www.software-
testing-tutorials-automation.com/2014/03/example-of-difference-
between.html
StackOverflow2016 September22)Difference between BeforeClass
and BeforeTest in TestNG [Web log post]. Retrieved from
http://stackoverflow.com/questions/30587454/difference-between-
beforeclass-and-beforetest-in-testng
Ram Mokkapatty(2015, February28) TestNG DataProvider Example
[Web log post]. Retrieved from
https://examples.javacodegeeks.com/enterprise-java/testng/testng-
dataprovider-example/
156
Script sample:
mongodbconnect.java file within Utility folder of stta within com folder:
Package Name of the file where the java file has been placed is as
follows:
package com.stta.utility;
TestNG has to be installed in the automation framework and use the
following import:
import org.testng.Assert;
Download the mongodb jar file from:
http://grepcode.com/snapshot/repo1.maven.org/maven2/org.mongodb/m
ongo-java-driver/2.10.1
once downloaded,place it in the project folder SAF\JarFiles\
Once placed for backup (to reuse the jar whenever required), bring the
jar file to project build path by:
Right click on the project SAF, Choose Build Path and Configure Build
Path,click on Libraries and click on Add External JARs and finally pick
the mongo JAR file to click OK button:
157
Once Jar file is added to the project path, following imports are required
to add the files to project:
import com.mongodb.MongoClient;
import com.mongodb.DB;
import com.mongodb.DBCollection;
import com.mongodb.BasicDBObject;
import com.mongodb.DBCursor;
158
Setting search query with the required key-value pair for example,
testid=23 which means picking the test id from the entire test lists:
BasicDBObject searchQuery = new BasicDBObject();
//searchQuery.put("key", "value");
searchQuery.put("testid", "23");
DBCursor with the find query result which can be select te.error from
test te where te.testid=23:
//DBCursor cursor = dbCollection.find(searchQuery);
DBCursor cursor = dbCollection.find("select te.error from test te where
te.testid=23");
Script Reference:
Hitesh Singh, (2012,August 14), Selenium Web, Mobile Automation
and for Complete Automation Tutorials using WebDriver [Web log
post]. Retrieved from
159
http://silenumnmisc.blogspot.co.uk/2014/08/connection-
between-through-mongodb-and.html
artoftesting(2016,September24) MongoDB Automation in Java[Web
log post]. Retrieved from
http://artoftesting.com/automationTesting/mongoDBAutomation.
html
160
MaxUserPort = 32768
TcpTimedWaitDelay = 30
Solution: Get the Firefox based Gecko Driver Downloaded from below
link and retry:
https://github.com/mozilla/geckodriver/releases
161
162
163
How to fix a problem when driver throws Null Pointer exception in the
code?
Code Snippet:
165
Error:
Solution:
Driver is not initialised in this script using driver.get(" ") command
hence null pointer exception is thrown during test execution. Driver has
to be initialised in row 15 to solve this issue.
Sample code (launch browser) to rectify this problem:
166
167
Solution:
POIXML exception is caused due to formatting error while sending from
excel file to selenium framework. The best suggestion to overcome such
issues would be to convert the value to string using toString() method.
Solution:
Check the driver and try to use Firefox version 46 or 33 to overcome the
exceptions; If chrome browser is renamed and placed in location which
is referred in script using line19, it is possible to get such exceptions
hence use the right browser for authentication.
168
When this test is executed with priority=1, following will be the results:
a Executed with result 4
Reason: TestNG identify the tests based on alphabetical order of the
classes and execute the first test of priority=1 and nothing else!
If all the priority are removed then, it executes the tests in the order of a,
b, c and d hence the results will be 4,2,3,1
What would be reason why the correct browser driver gives an exception?
Exception thrown as 'Unsupported Class Version Error':
Configuration
Target machine Time); : 64 bit (where the test is getting executed
during Run
Driver configured : 32 bit Chrome Driver;
Eclipse : Mars2 version;
Java : JDK 1.7
Problem:
169
Solution:
Step1:
WebDriver.chrome.driver has to be updated in set property to avoid the
exception.
Step2:
Replace the existing 32 bit chrome browser driver to 64 bit chrome
browser driver since the target machine is 64 bit
Step3:
Downgrade(Uninstall) the chrome browser in target machine if it is
higher version then the browser driver and keep the right version of
chrome to install in the target machine (which should match the
automation framework chrome driver's version)
Why TestNG tests fail only in eclipse and works fine in command
prompt?
At times it is possible that the tests works fine from command prompt
but it may fail due to configuration due the classpath in eclipse with the
below error:
170
Suggestions:
Class path may have been made different from setting path to read config
or excel sheets or input data files which result in such TestNG
Exceptions. It is advised to revise the class path and rerun the tests.
171
172
Script Reference:
https://github.com/narayananpalani/testautomation/tree/master/016C
andidateVerificationFormAutoTest
Please download the complete project from above link using
Download Zip option and read the details further for better
understanding and clarity of the project design.
Example:
173
Once project is created already, create an ruby file within spec folder.
Example:
Note: Only RSpec file (from spec folder) and test_helper.rb are
explained within this book as rest of the ruby gems can be accessible and
downloadable from GitHub and referred directly.
174
When the page is opened in firefox, right click on the first textbox(of full
name) and choose XPath Checker (Pre-requisite:Xpath Addon) and copy
the id which is available within the brackets:
Similarly right click on Email ID text box and choose Xpath Checker to
capture the id as entry_1000013 which need to be placed within the ruby
script of automation framework in testhelper file:
Right click on Contact text box and choose Xpath Checker to capture the
id as entry_1000014 which need to be placed within the ruby script of
automation framework in testhelper file:
175
Follow the xpath identification steps for rest of the fields till submit
button and then feed the xpath details and write code in test_helper.rb as
below:
Code Revision1: Writing the code mentioned above will lead to test
failure! The reason is on row92! Experience is a radio button which
needs to be clicked instead of sending the inputs of experience hence that
needs to be revised as:
driver.find_element(:id,'entry_1000000').send_keys(fullname)
driver.find_element(:id,'entry_1000013').send_keys(emailid)
driver.find_element(:id,'entry_1000014').send_keys(contactnumber)
driver.find_element(:id,'group_1000001_1').click
driver.find_element(:id,'entry_1000002').send_keys(sapexp)
driver.find_element(:id,'entry_1000003').send_keys(netweaverexp)
driver.find_element(:id,'entry_1000004').send_keys(kernelexp)
driver.find_element(:id,'entry_1000005').send_keys(currentcompany)
driver.find_element(:id,'ss-submit').click
176
Code Revision2: At times in many machines, Submit button may not fit
to the browser screen hence user may need to press scroll down bar to
view submit button which is not scripted in code as generally it is not the
problem in all machines and applicable only to small screens.
177
login_spec.rb:
This line refers to the test helper file to extend the script and get the
relevant ruby scripts:
load File.dirname(__FILE__) + '/../test_helper.rb'
Specification details:
describe "User Auth" do
include TestHelper
Prerequisite to the tests-run before the actual test1:
before(:all) do
@driver = $browser = Selenium::WebDriver.for(browser_type)
@driver.navigate.to(site_url)
sleep 10
end
Post completion of tests, following scripts are to be executed:
after(:all) do
@driver.quit unless debugging?
end
178
test_helper.rb:
Similar to Import in Java framework, 'require' is used in ruby based
scripting:
Rubygems required for scripting:
require 'rubygems'
Selenium required to execute the tests:
require 'selenium-WebDriver'
RSpec is required to script the behavior/specification of the tests:
require 'rspec'
Use utils in RWebSpec and better integration with TestWise:
require "#{File.dirname(__FILE__)}/rwebspec_utils.rb"
When running in TestWise, it will auto load TestWiseRuntimeSupport,
ignore otherwise:
if defined?(TestWiseRuntimeSupport)
::TestWise::Runtime.load_WebDriver_support # for selenium
WebDriver support
else
require "#{File.dirname(__FILE__)}/testwise_support.rb"
end
# this loads defined page objects under pages folder
require "#{File.dirname(__FILE__)}/pages/abstract_page.rb"
Dir["#{File.dirname(__FILE__)}/pages/*_page.rb"].each { |file| load file
}
The default base URL for running from command line or continuous
build process:
179
$TXT_URL =
"https://docs.google.com/forms/d/e/1FAIpQLScLxTQWgPTnbxTi3uLQ
NPE2z4r8S_ZRcGTbfSU--WfGNDzQ0Q/viewform"
# This is the helper for your tests, every test file will include all the
operation
# defined here.
module TestHelper
include RWebSpecUtils
if defined?(TestWiseRuntimeSupport) # TestWise 5
include TestWiseRuntimeSupport
else
include TestWiseSupport # TestWise 4
end
def browser_type
if $TESTWISE_BROWSER then
$TESTWISE_BROWSER.downcase.to_sym
elsif ENV["BROWSER"]
ENV["BROWSER"].downcase.to_sym
else
RUBY_PLATFORM =~ /mingw/ ? "ie".to_sym : "firefox".to_sym
end
end
alias the_browser browser_type
def site_url(default = $TXT_URL)
$TESTWISE_PROJECT_TXT_URL || ENV['TXT_URL'] || default
end
def driver
@driver
end
alias browser driver
def page_text
driver.find_element(:tag_name => "body").text
end
def visit(path)
driver.navigate.to(site_url + path)
end
Following section is the primary element within the Ruby Framework; It
has to be updated with respective xpath of the objects and get the inputs
through the parameters:
180
def verify(fullname,
emailid,contactnumber,experience,sapexp,netweaverexp,kernelexp,c
urrentcompany)
driver.find_element(:id,'entry_1000000').send_keys(fullname)
driver.find_element(:id,'entry_1000013').send_keys(emailid)
driver.find_element(:id,'entry_1000014').send_keys(contactnumber)
driver.find_element(:id,'group_1000001_1').click
driver.find_element(:id,'entry_1000002').send_keys(sapexp)
driver.find_element(:id,'entry_1000003').send_keys(netweaverexp)
driver.find_element(:id,'entry_1000004').send_keys(kernelexp)
driver.find_element(:id,'entry_1000005').send_keys(currentcompany
)
sleep 10
driver.find_element(:id,'ss-submit').click
end
end
Note: verify is the function called within the RSpec file and sent the raw
inputs through that and received by test helper file. When this test is
executed, RSpec file talks to Test Helper and feed the test inputs to the
browser page and perform the actions.
Test Execution:
Open the project from TestWise by clicking
CandidateVerificationFormAutoTest.tpr and navigate to Spec folder.
Click on .rb file within spec folder and click on the Run Icon in TestWise
or Run->Run Test in Tabs and verity the test execution:
181
Test Output section displays the list of tests and their duration of test run:
Test Report section displays the overall test status with respect to the
specifications:
Reference:
https://github.com/Matt-B/cucumber-js-selenium-WebDriver-
example
Where you can find this file in framework: cucumber-js-selenium-
WebDriver-example-master\cucumber-js-selenium-WebDriver-
example-master\features
182
The below scripts are written by understanding the core concepts given
in the git project in reference section above. So download the project
from git and replace feature file and step definitions with the scripts
given in this section:
Feature File:
Feature: Candidate Verification Form
As an internet user
In order to find out job in SAP
I want to be able to submit the candidate verification form
'use strict';
var expect = require('chai').expect;
module.exports = function() {
this.World = require('../support/world.js').World;
this.When(/^I Launch HR Candidate Verification Form$/, function
(searchQuery) {
this.driver.get('https://docs.google.com/forms/d/e/1FAIpQLScLxTQWgP
TnbxTi3uLQNPE2z4r8S_ZRcGTbfSU--WfGNDzQ0Q/viewform');
183
});
this.Then(/^I should enter details to submit the Form$/, function () {
this.driver.findElement({ name: ' entry_1000000' })
.sendKeys("Albert Einstein");
this.driver.findElement({ name: ' entry_1000013' })
.sendKeys("albert@einstein.co.uk");
this.driver.findElement({ name: ' entry_1000014' })
.sendKeys("07867563478");
this.driver.findElement({ name: ''group_1000001_1' })
.click();
this.driver.findElement({ name: ' entry_1000002'})
.sendKeys("2");
this.driver.findElement({ name: ' entry_1000003'})
.sendKeys("1.5");
this.driver.findElement({ name: ' entry_1000004'})
.sendKeys("1");
this.driver.findElement({ name: ' entry_1000005'})
.sendKeys("1");
this.driver.findElement({ name: ' ss-submit'})
.click();
});
};
184
'Then' condition sends the user inputs to the page and click on submit
button hence form is getting submitted.
Prerequisite for this project-Chrome Driver:
Chrome driver can be installed from
http://chromedriver.storage.googleapis.com/index.html
Once installed, add the reference to the 'Path' in Linux box as follows (if
the driver is placed in drivers folder within D drive),
export PATH=$PATH:~/D:/Drivers/chromedriver
Validate if it is working as expected (by entering chromedriver in your
terminal and validate the response like the below):
[naru@computer ~]$ chromedriver
Starting ChromeDriver (v2.11) on port 9515
Only local connections are allowed.
Press Ctrl+C to come out of the above message and navigate to the folder
where the script is placed by entering cd <path> command;
If the project folder is selenium – automation – framework - using
javascript, enter as:
185
cd selenium-automation-framework-using-javascript
Once navigated to the project folder,enter:
npm install
node_modules/grunt-cli/bin/grunt
The above lines to navigate to step definitions using gruntfile.js to run
the tests and produce results like the below:
[naru@computer selenium-automation-framework-using-javascript]$
grunt
Running "jshint:files" (jshint) task
>> 4 files lint free.
Running "exec:run_cucumber_tests" (exec) task
Feature: Candidate Verification Form
As an internet user
In order to find out job in SAP
I want to be able to submit the candidate verification form
Scenario: Successful Submission of Candidate Information#
features/google.feature:6
When I Launch HR Candidate Verification Form #
features/google.feature:7
Then I should enter details to submit the Form #
features/google.feature:8
1 scenario (1 passed)
2 steps (2 passed)
Done, without errors.
186
Install Firefox:
URL:
https://ftp.mozilla.org/pub/firefox/releases/33.0/win32/en-GB/
Once Firefox is installed, install Selenium IDE addin and restart firefox.*
Make sure you have right compatible firefox browser version installed.
*Note:This is described clearly in the first chapter.
Install JMeter:
URL:
http://jmeter.apache.org/download_jmeter.cgi
In the search box, search for Selenium IDE and download. Alternatively
navigate to http://www.seleniumhq.org/download/ and download from
the below link:
Basic Definition
Load test is the simplest form of performance test to understand the
scalability, reliability of the AUT under a specific expected load and this
load can be number of users on the application performing a specific
number of transactions within the set of duration.
Main Objectives
To enhance the quick responsiveness of the AUT and better user
experience
To improve the usability
To make a comfortable end user journey
To ensure that the AUT performs the number of
processes/transactions as per the key performance indicators
expected
To provide better comparison results and metrics to understand
which system perform better
To measure particular part of the system or workload which cause
the system performance badly
General Observation
System performance is mostly measured by Response Time Per User
Activity
189
After a brief wait, Jmeter launches a command prompt for its script to
run in background and launches the GUI of JMeter like the below:
191
Note:
192
193
194
195
Once clicked on Run in Selenium IDE, wait until the tests get completed:
196
Expand the Recorder in JMeter and identify those new tests created using
Selenium IDE:
197
Expand those each element validate those steps which are recorded using
Selenium IDE into JMeter:
Now Save the test plan of JMeter using, 'File' menu, select 'Save Test
Plan As':
198
Now the scripts are recorded in JMeter which can be used further to
run the Non Functional/Performance Tests for the same project hence
Selenium scripts are reused in JMeter for Performance Tests with almost
same set of steps followed in Selenium while creating those steps!
Reference:
Ellie Skobel. (2016, September 10), Selenium Minutes [Web log
post]. Retrieved from http://seleniumminutes.com/
199
Refer the html file 'selenium_projects6.html' and try to open the file in a
browser such as firefox and following scripts will be viewed in tabular
column:
selenium_projects6
open /projects/
clickAndWait link=Selenium Projects
clickAndWait link=Download
clickAndWait link=Documentation
verifyText css=a.reference.internal Note to the Reader - Docs
Being Revised for Selenium
2.0!
verifyElementPresent link=Introduction
verifyText link=Test Automation for Test Automation for Web
Web Applications Applications
verifyText link=exact:To Automate exact:To Automate or Not to
or Not to Automate? Automate?
assertText link=Introducing Introducing Selenium
Selenium
verifyElementPresent link=Brief History of The
Selenium Project
assertElementPresent link=Selenium‘s Tool
Suite
verifyText link=Choosing Your Choosing Your Selenium Tool
Selenium Tool
assertText link=Supported Browsers Supported Browsers and
and Platforms Platforms
verifyText link=Flexibility and Flexibility and Extensibility
200
Extensibility
assertElementPresent link=exact:What‘s in this
Book?
verifyText link=The Documentation The Documentation Team–
Team–Authors Past and Authors Past and Present
Present
assertElementPresent link=Selenium-IDE
verifyText xpath=(//a[contains(text(),' Introduction
Introduction')])[2]
verifyTitle Selenium Documentation -
Selenium Documentation
assertElementPresent link=Installing the IDE
verifyElementPresent link=Installing the IDE
assertElementPresent link=Opening the IDE
verifyText link=IDE Features IDE Features
verifyElementPresent link=Building Test Cases
assertText link=Using Base URL to Using Base URL to Run Test
Run Test Cases in Cases in Different Domains
Different Domains
verifyText link=Using Base URL to Using Base URL to Run Test
Run Test Cases in Cases in Different Domains
Different Domains
assertElementPresent link=Selenium Commands
– ―Selenese‖
assertElementPresent link=Script Syntax
verifyText link=Test Suites Test Suites
assertText link=Commonly Used Commonly Used Selenium
Selenium Commands Commands
verifyText link=Verifying Page Verifying Page Elements
Elements
assertText link=exact:Assertion or exact:Assertion or
Verification? Verification?
verifyElementPresent link=Locating Elements
verifyText link=Matching Text Matching Text Patterns
Patterns
assertElementPresent link=The ―AndWait‖
Commands
verifyElementPresent link=The waitFor
Commands in AJAX
applications
verifyText link=Sequence of Sequence of Evaluation and
Evaluation and Flow Flow Control
Control
assertElementPresent link=Store Commands and
Selenium Variables
201
202
203
204
Selenium-IDE
assertElementPresent link=Using User-
Extensions With Selenium
RC
verifyElementPresent link=.NET client driver
configuration
assertText link=Importing Sel2.0 Importing Sel2.0 Project into
Project into Eclipse using Eclipse using Maven
Maven
verifyText link=Importing Sel2.0 Importing Sel2.0 Project into
Project into IntelliJ Using IntelliJ Using Maven
Maven
assertText link=Migrating From Migrating From Selenium RC
Selenium RC to Selenium to Selenium WebDriver
WebDriver
verifyText link=How to Migrate to How to Migrate to Selenium
Selenium WebDriver WebDriver
assertText link=Why Migrate to Why Migrate to WebDriver
WebDriver
verifyText link=Before Starting Before Starting
assertText link=Getting Started Getting Started
verifyElementPresent xpath=(//a[contains(text(),'
Next Steps')])[2]
assertText link=Common Problems Common Problems
verifyText css=#mainContent > Selenium Documentation
div.related > ul > li > a
assertText css=#mainContent > next
div.related > ul > li.right >
a[title="Note to the
Reader - Docs Being
Revised for Selenium
2.0!"]
verifyElementPresent id=footerLogo
selectWindow null
verifyElementPresent link=Selenium
Documentation
assertText link=next next
verifyText link=Note to the Reader - Note to the Reader - Docs
Docs Being Revised for Being Revised for Selenium
Selenium 2.0! 2.0!
assertText css=em Docs Being Revised for
Selenium 2.0
verifyElementPresent name=submit
verifyText name=submit
assertElementPresent css=a > img
assertValue css=li > java
205
input[type="image"]
verifyValue //input[@value='csharp'] csharp
assertText //input[@value='python']
verifyText //input[@value='ruby']
assertValue //input[@value='php'] php
verifyValue //input[@value='perl'] perl
assertValue //input[@value='javascript javascript
']
206
Once both the tools are installed, they will appear as small icons in
Selenium IDE. In order to get these Plugins worked for a test case, they
have to be clicked as below:
207
Once both the tools are clicked, run the test by click on Run button and
see the Test Results.If all steps are passed, edit any of the commands
with empty values and rerun to see atleast one failure in order to validate
the failure reports which are captured by these two tools.
Example: Perl id has been updated incorrectly as Per in selenium IDE
selenese script and then test run as below to see 1 error:
208
This action of clicking on View Test Coverage would have opened a file
directory within Firefox as below:
This file contains the error report with the page where the object has
been failed to identify as per the object id entered.
209
This action of clicking on View Failure Report would have opened a file
directory within Firefox as below:
This file contains the failure screenshot report with the page where the
object has been failed to identify as per the object id entered.
210
When there are multiple test steps involved in tests and test execution
shows number of issues in logs, it is extremely difficult to go though the
table structure and understand what are the actual issues. In order to
simplify this search, Log Toolbar placed bottom of Selenium IDE to
enable testers to perform 'Find' option on the test Logs.
Install LogToolbar from following URL:
https://addons.mozilla.org/en-US/firefox/addon/log-search-bar-selenium-
ide/
Open selenium IDE to run the test using Run button and observe the list
of logs in Log Panel (bottom). Search for /Projects in LogSearchBar
plugin and it finds the relevant search query for testers as below:
211
Reference:
AMAL BOSE. (2016, September 12), 8 Selenium IDE Plugins you
Should be Aware OfRetrieved from http://axatrikx.com/selenium-
ide-plugins/
LogToolBar,ScreenShotOnFail,PageCoverage Plug-ins are designed
by Samit Badle
Selenium IDE is designed by Jason Huggins, Adam Goucher, Shinya
Kasatani, Dave Hunt, Samit Badle
Selenium IDE Plugins section from
http://www.seleniumhq.org/download/ can be referred for multiple
useful Plugins to use as part of Selenium IDE tests
212
213
Figure 187 Show All Available Commands (Option visible only when
Selenium IDE opened in background)
214
215
216
217
Expand the project in Package Explorer and view the empty project as
follows:
Note: If JRE System Library is empty, java home and path setup must be
incorrect. Please refer initial chapters to set Java installation and
Home/Path setup
If Package Explorer is not visible, press Alt+Shift+Q, P to open or
navigate to Window-->Show View-->Package Explorer to open:
218
Alternatively watch online video ' Learn how to open Package explorer
tray in any Eclipse version'xxv
Next step is to add necessary JAR files to the project in order to
reference libraries related to our tests.Download latest selenium
WebDriver JAR files from seleniumhq.org and save them in a folder
called JARFiles within the project folder and then follow the steps below
to include all those downloaded jar files to the build path.
For example,
Navigate to http://www.seleniumhq.org/download/ and go to the section
'Selenium Client & WebDriver Language Bindings' and click on
download on the row where Java referened.
Extract the zip file when downloaded,use all the jar files referenced
below to add as external jars:
219
Note: All these jar files are to be included, not just one jar file displayed
in section1.
220
Add relevant JAR files (refer all the jar files from section 1 and 2 and
include all of the here) which will be listed in the Project in Package
Explorer under the section 'Referenced Libraries' once added:
Once jar files are included, the next step is to write initial set of test
scripts to execute the test cases; In order to write tests, it is recommended
to create a package inside the src folder of project and create java file
within the package created (Project-src-package-java file).
221
222
223
Download and Paste the latest Chrome Browser Driver under this folder:
Note: https://sites.google.com/a/chromium.org/chromedriver/downloads
is used to download the chrome driver. Choose right driver based on
windows or operating system specification. If win32 chrome driver is
downloaded and used for windows 64 bit operating system, it may lead
to exception and failures hence download right driver for the test
224
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
225
Note: The path has to updated for every project and // to be used for
every folder level.
Now the driver instance has been created with the help of code
above.The next step is to launch the browser to get particular web page
such as https://login.salesforce.com.
Enter the line of code below at section6:
driver.get("https://login.salesforce.com");
Now the scripts are written to launch the browser and open particular
web page. Next step is to enter values to user name and password fields
and then click on Login button.
Capture the object ids of user name by right click on username textbox
and choose Inspect Element:
227
228
Enter following line of codes in section 7 to fill the user inputs for user
name,password and click on Login button:
driver.findElement(By.xpath("//*[@id='username']")).sendKeys("Naraya
nanP@Raghava.co.uk");
driver.findElement(By.xpath("//*[@id='password']")).sendKeys("Hello
World");
driver.findElement(By.xpath("//*[@id='Login']")).click();
229
Enter script to quit the browser once the test has been completed at
section8:
driver.quit();
230
While executing the test, observe the log outputs from console section:
231
Example:
Functional Encapsulation by sending User Input to UserName TextBox
within Object Repository:
public void setSFUserName(String strUserName){
driver.findElement(txt_sfusername).sendKeys(strUserName);
}
This line has been called in test case (class file) as the below:
objSFLogin = new LoginPageObjects();
objSFLogin.setSFUserName("NarayananP@Raghava.co.uk");
If there are plans to replace the automation engine from selenium
WebDriver to any other licensed automation tools, it can be considered
to automate using POM as the rework to assemble callable functions are
easy and feasible comparing to rebuild the whole automation framework.
232
233
234
Once the java file has been created, it looks like the below:
Enter the line of code below to the section1 and watch yellow bulb
highlighted in left side(which says that the line of code is not used
anywhere at the moment):
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
235
Enter the line of code below to the next section to enter value in
username textbox:
public void setSFUserName(String strUserName){
driver.findElement(txt_sfusername).sendKeys(strUserName);
}
Enter the line of code below to the next section to enter value in
password textbox:
public void setSFPassword(String strPassword){
236
driver.findElement(txt_sfusername).sendKeys(strPassword);
}
Enter the line of code below to the next section to click on login button:
public void setSFLogin(){
driver.findElement(btn_sflogin).click();
}
237
238
driver.findElement(btn_sflogin).click();
}
}
239
Introduce below line of code to send user inputs to username field within
POM design based framework:
objSFLogin = new LoginPageObjects();
objSFLogin.setSFUserName("NarayananP@Raghava.co.uk");
240
Below line of code inserted to enter password within the page using
POM design:
objSFLogin.setSFPassword("HelloWorld");
241
242
243
244
Find the code to encapsulate username input function within the object
repository hence this function has been called within test script for every
need of username input:
245
Once code is written, overall page object factory looks like the below
screenshot:
246
247
Navigate to test scripts (main java file of test cases) and import this page
object factory:
Once entire line of code written in main java file, it looks like the below
screenshot:
248
249
References
Guru99. (2016, September 10), Page Object Model (POM) & Page
Factory in Selenium: Ultimate Guide [Web log post]. Retrieved from
http://www.guru99.com/page-object-model-pom-page-factory-in-
selenium-ultimate-guide.html
LAKSHAY SHARMA. (2016, September 10), Page Object Model |
POM [Web log post]. Retrieved from http://toolsqa.com/selenium-
WebDriver/page-object-model/
250
Few observations:
- most of the job descriptions turn to be the copy-paste from generic
job profiles. Same JD has been used over the period of time mostly
without a word change.
- If the JD is unique and more descriptive, it hardly matches perfectly
to any profile to get shortlisted
To understand this gap, we should know the traceability between JD
and CV
251
Suggestions:
CVs have to be customized and updated as per the particular job opening
and applied exclusively for the particular role which is described in JD.
Especially every line in JD has to match with the skill set and work
experience of the candidate applied to the job opening
Suggestions:
Due to following psychological reasons, digital representations of profile
get more visibility:
1. Visual Display of Profile attracts more than the words in a page
2. Bullet points are always up to the message and better than the
paragraphs
252
Useful points:
1. In case the CV is processed by an external consultant to particular
organization, make sure that the consultant/recruiter understood the
CV's strengths and weaknesses as well as the JD itself.
2. It is duly suggested to have a telephonic discussion with the recruiter
on the profile match.
Once the CV is made and it is powerful, what should be the next step?
Edit and update the CV as an ongoing activity
Your CV is your own sculpture so make sure it represents the best of
your strengths.
List of top skill sets required for automation testers are compared in the
table below:
Technical Skills Functional Junior Senior Automation
Tester/ Automation Tester/Software
Manual Tester Development
Tester/ QA Engineer in Test
(SDET)
Programming Optional Mandatory Mandatory
Languages
(Ruby, Java, DotNet,
C#, Javascript, VB
Script)
Unit Testing Optional Optional Mandatory
(Test Driven
Development)
HTML Optional Optional Mandatory
CSS Optional Optional Mandatory
OOPs Design Patterns Optional Mandatory Mandatory
253
254
RESUME
Name: Confidential
London.
Contact Number: 09990009990
E-mail: abc@abc.com
EXPERIENCE
October, 2014 – present: Proven capabilities through high quality test
scenario and test case design, test execution and test reports. Currently,
on an intensive work experience internship at CHF Labs in central
London. Working under the supervision of the test manager, on live
projects, the internship involves working on various projects using
manual and automation testing, particularly, using Selenium IDE/RC as
well as other tools such as cucumber and eclipse.
PROJECT EXPERIENCE
255
EXPERTISE
Preparation of test case documentation
Test case execution
256
SKILLS
Ability to write test scenarios from any given requirements
Proficiency in writing accurate test cases
Paying attention to detail when it comes to tracking defects
Ability to compile good and accurate test reports
Comfortability in SQL and ability to create, update, modify and
delete records
Savvy understanding of VBscript, HTML, Java, Javascript and OOPs
Efficaciously implementing Selenium IDE automation for web-based
functionality testing
Deep understanding regarding both Manual and Automation
software testing and considerable talent in achieving targets
EDUCATIONAL QUALIFICATIONS
2006-2010 St Antony College/ University of San Diego
BSc (Hons) Computing and information Systems
Specialized in network engineering and telecommunication systems
Project Work: Designed a mobile application for cinema reservations
and bookings by the help of Java Micro Edition as the main software
and other supporting software
257
Reference
Available on request
258
Reference:
https://www.google.com/trends/explore?date=all&q=selenium%20W
ebDriver,QTP&hl=en-GB
259
260
http://github.com/narayananpalani/testautomation
These well built frameworks will reduce the chances of rework to a great
extent and at the same time will assist you to get the solutions ready in
few hours.
261
262
Implementation Stage1
When sprint 1 functional test cases are prepared, that is the perfect time
to select right automation framework for the project and perform Proof
of Concept (refer the PoC section to understand sample steps). During
the Sprint 1 manual test execution, PoC and Automation Framework
design, automation of sprint 1 manual (functional) tests can be performed
during Sprint1-so these test cases can be executed as 'Regression Tests'
in cycle2 onwards.
Implementation Stage2
Once automation framework has been implemented and performed with
few test cycles, this time is considered as ideal to use schedulers such as
Jenkins or Hudson and schedule overnight tests. If parallel test execution
is possible, it can be implemented in multiple test environments
successfully and lessen the overall test execution time.
263
Implementation Stage3
Agile projects reach the stage where the test results load into hundreds of
folders which results in difficulty to maintain and identify similar test
results. So this time ideal to implement test results repositories such as
MongoDB to store the results direct from automation framework.
Implementation Stage4:
If the automation framework is developed, implemented and scheduled
to run in multiple test beds/target machines, it is ideal to reuse the same
set of frameworks for performance tests with the help of Openstack or
other environmental setup.
Let us take a next step to understand how the impact affects the whole
project:
Case1:Mark has been designing a mobile device software from initial
releases and never identified any defect by himself during the
development. He has released the product to market and identified
negative customer feedbacks on certain features as not working at all.
Though Mark has fixed the problems (known as 'bugs' or 'defects') and
released to the customers again in the market, do you think he will
receive the same reputation and enthusiastic approach from his clients
what he had received in the past? Answer: No.
After few months, customers returned with new set of defects and
complained about the invisibility of certain contacts and gallery images
as those have been lost from their phones, and at the same time, the
inability in installing any new application in their devices and so on.
How many times Mark can fix the problems and go back with the new
excuses?
264
Case2: After learning from the failures of the first product, Mark brought
Anderson into the project to perform testing activities. Now, Anderson
made sure of the proper validation of the mobile device software (called
as 'tested') and most of the problems (known as 'defects') were identified
and resolved (known as 'fixed'), then the mobile device was released to
the market.
Do you think the mobile device is free of any defect now?
The answer is No! As the existence of a defect free product is beyond the
bounds of possibility (as an assumption made to help every software
tester).
The mobile device may come back with further failures but those
failures are limited to the scope of something Anderson missed to find
during his testing activities.
Case3: 'Palani', an another software tester, was introduced by Mark to
the testing team and he worked along with Anderson and found some
more bugs. Do you think the mobile device is defect free now? (Since
Anderson performed a test and found some bugs them the rest of the
bugs which were missed by Anderson were later detected by Palani,
hence, both of them found all the failures of the mobile device software.)
The answer is same as the answer of Case2. No matter how many testers
testing the software, the defects may exist and remain unidentified even
after testing (but majority of the critical defects and major issues would
have been identified and fixed during the testing process since the new
defects may affect with low priority).
265
266
267
268
Very Difficult: Software has been released to customers and some of its
functionalities were not found in workable condition. Now, Anderson
tested it within his test environment according to the customer‘s
identification and realised that the bug is valid and needs to be fixed
soon. Martin has no other option than releasing a new version of the
software to customers with all the problems rectified.
Refer: ‗Maintenance‘ in the graph below. It is 100x times of the total
cost of the project taken by the defect fix. Expensive defect comparing to
the defects identified in earlier stages.
269
270
271
272
273
3. Early Testing
Why the test should be performed early and why such approach required
when development takes long time to prepare the software?
The actual answer is related to the defects and how fast those
defects are needed to be fixed?
If the defects are identified earlier that gives a healthy environment
of bringing high quality software on time.
Case1: Aravind is the leading software tester for the enterprise software
who has been given the duration of seven weeks to test the software in
seven cycles (one week per cycle).
He has found three minor/low priority defects for six cycles and
identified two major/high priority bugs in the last week. Thus, project
manager is left with remaining just 6 days to get the defects rectified and
fixed. But the valuable questions are as follows;
- When Aravind is going to retest the fix and ensure that the fix is
working as expected?
- If he finds the fix is open and needs to be fixed again, how many
more days it takes to fix, retest and prove that the latest fix is
working fine?
Due to the situation above, there is a fair chance of extension in the
delivery date of the software for further testing and it impacts overall
cost and customer satisfaction on the late delivery of the software.
What needs to be done to avoid the situation of late delivery of the
software and last minute defects?
Test Early!
4. Defect Clustering
―Small number of modules contain high number of defects and lead to
operational failure‖
Case1: Rajavarman tests 20 modules of ABC bank‘s payment system
and found 55 defects within the account details module itself. The total
number of defects found in the entire functional testing is 57 which show
that the number of defects within account details module is higher than
19 other modules.
274
5. Pesticide Paradox
―If same tests are being repeated in every Regression Cycle, the chances
of the occurrence of new defects in AUT is less.‖
Case1: Jagan looked after the automation tests and has designed 1800
automation test cases using selenium to run in every drop of the product
release. He is recycling the use of the same tests for every drop (as
expected in Regression Tests).
In the very first drop, he found 130 defects which has become single
digit of defects in further drops. In fact, Drop 19 produced no defect after
his Regression Test Execution. The real question is relying on the test
cases and when they are really designed. If the test cases are not updated
over time, there is no point of reusing them as the expected defects are
already raised or discussed with development team, and there is no use of
this automation test pack, hence, this situation is a named as pesticide
paradox. Jagan started updating the test scripts to match with the latest
user stories and run them as part of test cycles which led him to identify
new defects. Thus, redesigning and improving is the ideal solution for
pesticide paradox.
275
FMEA
Failure Mode and Effective Analysis
Process Name: Registration Page Testing Activities of Test Team A
Process Number:000234
Date:XXYYZZZZ
Revision:01
Risk
Probability of Probability
Failure Severity Preference
Occurrence of Detection
Mode (A) Number
(B) (C)
(RPN)
276
Rate 1-10
Rate 1-10 in
in which Rate 1-10 in
which 1 is Calculation
1 is least which 1 is least
least and 10 of A*B*C
and 10 is and 10 is most
is most
most
Defect1:
Failure to 10 2 4 80
Login
Defect2:
Issue in
8 4 4 128
Colour
Code
Defect3:
Failure to
2 6 5 60
Submit
the form
Defect4:
Server
Error on
10 4 8 320
the
HTTP
Response
277
Understanding Risks:
Risks are the uncertainties expected in future with probability of
occurrence and expected potential losses as outcome, hence, it impacts
the software testing projects, and right mitigation actions are expected to
take care to overcome such risks. Risks can be anything which cause the
losses such as financial losses or losses of customers or even the
corporate brand image damage to the product.
Identifying loss making risks and controlling with right action plan
are the key elements in every software testing project.
Formula:
Risk=Damage to the project*Probability or Occurrence
Example:
Risk of the Login Failure of Web Page within project AB=Lost of 800
CAD per failure*10 times occurrence expected in current
year=8000CAD Loss due to the Risk for the current year
278
279
sick leave for two days in the middle of the test cycle which created
additional backlog of 28 test cases on top of 52 existing backlogs, and
Surendar has no other option than increasing the duration of the project
at the last week which has created tension around the delivery date. This
situation shows a clear example of poor planning from the test
management. If leaves were organized earlier and Surendar had planned
at least 16 working days of tests to include 2 days as backup, then it
would have sort out the leave issues on time. Because the total backlog
of tests 80 (means 52+18) would have executed with the help of last
working day availability.
Operational Risk
Software testing projects plan to improve the quality standards by
implementing industry‘s best practices as new set of processes. If there is
a mistake in implementing such processes, it creates lot of expenses to
overall project budgeting. Hence, such operational risks lead to project
failures in most of the occasions.
281
When test teams move from different testing tools to selenium, there are
two main challenges faced:
1. Choosing right method of migration to test automation tool (code
conversion or rewrite scripts)
2. Choosing right programming language
When two automation test tool frameworks scripted with different
programming languages, it will be an expensive attempt to convert the
code from one programming language to other and fix the code to get it
worked; Also it has a direct impact on Return On Investment (ROI) and
reduce the profit from test automation projects.
Instead converting the code using code conversion tools from
VBScript to Java (for example), it is always suggested to take the
opportunity to review the automation scripts and rewrite to the new
automation tool.
For example, majority of the web automation test frameworks are
developed using HP UFTxli (Unified Functional Testing) [formerly QTP]
in recent years. If testing teams decided to convert VB Script based UFT
code to Selenium based Java Automation Framework, it would be an
expensive attempt.
It is possible to migrate the VB Script based UFT Automation
Framework scripts to VBSWebDriverxlii which is a VBScript bindings for
Selenium 2! In this way UFT Automation Framework can easily be
migrated and components/functions reused in Selenium Automation
Framework in VBScript programming language!
But the real question comes to picture on desktop applications based
test automation; Since Selenium set of tools support only web based test
automation, this is one of the leading open question in recent years.
'Twin' Tool:
Details of the project explained more in the location given below,
https://code.google.com/archive/p/twin/
Download and use the project from following github location,
282
https://github.com/JamesMGreene/twin
'White' Tool:
Download and use the project from following github location,
https://github.com/teststack/white
Wiki page to understand build and FAQ,
https://github.com/teststack/white/wiki
Note:
For more information on Twin and White tools, please listen to Q&A
part of following talk,
Simon Stewart (2016 September 14),Learn Using Selenium 3 0 [Youtube
Video] Retrieved from https://www.youtube.com/watch?v=bistojJPR98
283
284
Appendix A
285
https://github.com/im-zeeshan/serenitybdd-automation-
framework/blob/master/src/test/resources/stories/AcceptanceTe
stSuite/Capability/Feature/STR101-LookupADefinition.story
https://github.com/techGen/WebDriver_Framework
https://github.com/rkumar2131/MineSweeperAutomation
https://github.com/SkillsFundingAgency/specflow-selenium-
framework/tree/master/Specflow_Selenium_PO_Example2/Fea
tures
https://github.com/irishshagua/web-automation-sample-
framework
https://github.com/hemano/Automation_FW_Cucumber
https://github.com/agalyad/WebDriver_Java_TestNG_Ant
C# Based Selenium Frameworks Available:
https://github.com/michaelthecsguy/PayoffAutomationJUnit
https://github.com/kapilsethi/AutomationUsingWebDriverAnd
PageObjectPattern
https://github.com/agalyad/WebDriver_C_NUnit
Java Script Based Selenium Frameworks Available:
https://github.com/Matt-B/cucumber-js-selenium-WebDriver-
example
Python Based Selenium Frameworks Available:
https://github.com/gowtham88k/selenium_python
https://github.com/Rosalita/Selenium
https://github.com/hermanwahyudi/selenium/
https://github.com/shahriarqureshi/Python
Ruby Based Selenium Frameworks Available:
https://github.com/testwisely/agiletravel-ui-tests
General Selenium Related Frameworks Available:
https://github.com/jenglezou/chilaca
https://github.com/yuliabro/WebDriver
https://github.com/3vilvetal/WebDriver/tree/master/HelloWorld
https://github.com/camiloribeiro/cello
https://github.com/IntelligentSigma/selenium-test-automation-
framework
https://github.com/axatrikx/axa-framework
https://github.com/Webaib/Selenium-LWF
https://github.com/Natalya11444/Cucumber-Selenium-JUnit-
Test-Framework
286
https://github.com/Natalya11444/Selenium-TestNG-Test-
Framework
REST API Based Selenium Frameworks Available:
https://github.com/kvyasHacks/APITestAutomationFramework
/tree/master/nasa-test-base
https://github.com/lnikod4s/automation-selenium-testing-
framework
https://github.com/michaelthecsguy/PayoffAutomationJUnit
Appium Based Framework Available:
https://github.com/agalyad/iOS_Appium_Java
Selenium using Excel VBA -Projects Available:
https://codingislove.com/browser-automation-in-excel-
selenium/
https://github.com/florentbr/SeleniumBasic
http://www.makeuseof.com/tag/how-to-automate-firefox-or-
chrome-with-vba-and-selenium/
https://www.youtube.com/user/xtremeExcel/search?query=sele
nium
Excel VBA and Internet Explorer Based Automation
Framework Available:
http://automatetheweb.net/
Selenium Queries can be answered at:
http://grokbase.com/g/gg/selenium-users
287
Appendix B
288
Appendix C
This section explains about the list of changes within the toolset of
selenium in each version. This information may not be accurate at times
as the changes may have been quick and suggesting readers to go
through http://www.seleniumhq.org/ for clear information. This table is
given as an abstract based on the recent webinars in the year 2016 by
Simon on Selenium 3 and other references from the URLs given below
References
Simon Stewart (2016 May 26),Selenium 3 0 Retrieved from
https://www.youtube.com/watch?v=gS4ZqLpA9r4
Simon Stewart (2016 September 14),Learn Using Selenium 3
0Retrieved from https://www.youtube.com/watch?v=bistojJPR98
W3C (2016 September 14),World Wide Web Consortium from
https://www.w3.org/
SeleniumHQ(2016 September 14),Selenium from
https://www.seleniumHQ.org/
289
Expected during
Christmas
(of 2016 or 2017)
Release Period
Selenium
HTML Table- COM object
Selenium Core WebDriver is
Selenium collection used to
removed planned to be
IDE communicate for
removed
tests
Legacy Selenium
RC libraries can be
used as leg-rc
Chrome, Opera
Three extended to used as (but it is highly
columns part of WebDriver recommended to
tests. move from
Selenium RC to
Selenium
WebDriver)
Selenium Introduced Jason
Core' Wire Protocol
Designed by representing
290
291
WebDriver in
next
version(in
selenium2.o)
Selenium
WebDriver:
Guarenteed
Selenium IDE:
Guarenteed
Selenium RC:
Limited [Since
Selenium
Selenium Core is
Life Span
Core:
removed in
Limited [Not
selenium 3 onwards,
used in
scripts are to be
Selenium 3.o
migrated to
onwards]
Selenium
WebDriver]
Appium:
Guarenteed [Not yet
migrated to
Selenium 3.o as on
Sept2016]
292
Appendix D
Part 1:
293
References
Aravind. (2016, September 07). Software testing tutorials and
automation [Web log post]. Retrieved from http://www.software-
testing-tutorials-automation.com/p/selenium-WebDriver.html
Syam. (2015, January 29). XLS Reading for DDF [Web log post].
Retrieved from http://pssqtp.blogspot.co.uk/2015/01/xls-reading-
for-ddf.html
294
295
W
i
TechCity UK(2016, September 24) TechNation Visa Scheme [Web log
post]. Retrieved from http://www.techcityuk.com/tech-nation-visa/
ii
NARAYANAN PALANI. (2016, September 14), Certified Member
Profile[Web log post]. Retrieved from
http://www.ibm.com/certify/profile?palanin6
iii
UNICOM. (2016, September 14), India Testing Awards 2016[Web log
post]. Retrieved from
296
http://www.unicomlearning.com/2016/India_Testing_Awards/index.html
iv
NARAYANAN PALANI. (2016, September 14), LinkedIn[Web log post].
Retrieved from https://uk.linkedin.com/in/narayananpalani
v
DOCUMENTS.MX, (2016, September 14), ADCOM 2009 CONFERENCE
PROCEEDINGS[Web log post]. Retrieved from
http://documents.mx/documents/adcom-2009-conference-proceedings.html
vi
Matthew Dwyer, (1997), Software Management Spring 1997[Web log post].
Retrieved from
http://people.cs.ksu.edu/~dwyer/courses/748/resources/cmm-
tr25/tr25_l3g.html
vii
Stress Marq, (2016, September 14), 5 Free Image Analysis Software Tools
for Microscopy[Web log post]. Retrieved from
http://www.stressmarq.com/5-free-image-analysis-software-tools-for-
microscopy/?v=79cba1185463
viii
Matthew Dwyer, (1997), Software Management Spring 1997[Web log post].
Retrieved from
http://people.cs.ksu.edu/~dwyer/courses/748/resources/cmm-
tr25/tr25_l3c.html
ix
Matthew Dwyer, (1997), Software Management Spring 1997[Web log post].
Retrieved from
http://people.cs.ksu.edu/~dwyer/courses/748/resources/cmm-
tr25/tr25_l3b.html
x
Matthew Dwyer, (1997), Software Management Spring 1997[Web log post].
Retrieved from
http://people.cs.ksu.edu/~dwyer/courses/748/resources/cmm-
tr25/tr25_l3a.html
xi
Matthew Dwyer, (1997), Software Management Spring 1997[Web log post].
Retrieved from
http://people.cs.ksu.edu/~dwyer/courses/748/resources/cmm-
tr25/tr25_l4b.html
xii
Matthew Dwyer, (1997), Software Management Spring 1997[Web log post].
Retrieved from
http://people.cs.ksu.edu/~dwyer/courses/748/resources/cmm-
tr25/tr25_l4a.html
xiii
Matthew Dwyer, (1997), Software Management Spring 1997[Web log post].
Retrieved from
http://people.cs.ksu.edu/~dwyer/courses/748/resources/cmm-
tr25/tr25_l5c.html
xiv
Ranorex GmbH., (2016,September 24),Ranorex [Web log post]. Retrieved
from http://www.ranorex.com/
xv
IBM(2016 September24),Rational Functional Tester[Web log post].
Retrieved from http://www-03.ibm.com/software/products/en/functional
xvi
http://selenium-release.storage.googleapis.com/3.0-beta2/selenium-java-
3.0.0-beta2.zip
xvii
AutomatedTester, (2016,September 14), mozilla/geckodriver[Web log post].
Retrieved from https://github.com/mozilla/geckodriver/releases
xviii
http://chromedriver.storage.googleapis.com/index.html
xix
http://selenium-release.storage.googleapis.com/3.0-beta2/selenium-java-
297
3.0.0-beta2.zip
xx
philip@armorgames.com, (2011,October 26), sessionId should not be null;
has this session been started yet? #2716[Web log post]. Retrieved from
https://github.com/seleniumhq/selenium-google-code-issue-
archive/issues/2716
xxi
Yatendra Goel, (2009,September 13), Selenium - Exception while executing
selenium.stop()[Web log post]. Retrieved from
http://stackoverflow.com/questions/1417666/selenium-exception-while-
executing-selenium-stop
xxii
Matej Tymes, (2016,APRIL 19), Matej Tymes's Weblog[Web log post].
Retrieved from http://matejtymes.blogspot.co.uk/2014/10/WebDriver-fix-
for-unreachablebrowserexc.html
xxiii
Cheryl Feldman,Keir Bowden,Nick Hamm. (2016,September 14),[Web log
post]. Retrieved from https://trailhead.salesforce.com/
xxiv
Cheryl Feldman,Keir Bowden,Nick Hamm. (2016,September 14),[Web log
post]. Retrieved from
https://trailhead.salesforce.com/trail/getting_started_crm_basics
xxv
Youth by mind not by age(2014 September 17),Learn how to open Package
explorer tray in any Eclipse version;Retrieved from
https://www.youtube.com/watch?v=x_oeur6_0jw
xxvi
UPI.COM. (2015,May 02):"Boeing finds software glitch in 787 that can cut
jet's power in flight[Web log post]. Retrieved from
http://www.upi.com/Top_News/US/2015/05/02/Boeing-finds-software-
glitch-in-787-that-can-cut-jets-power-in-
flight/4271430546448/?spt=sec&or=tn
xxvii
Wikipedia, (2016,September 14), Mars Climate Orbiter[Web log post].
Retrieved from https://en.wikipedia.org/wiki/Mars_Climate_Orbiter
xxviii
BALASUBRAMANYAM SESHAN, (2011,October20), Forget the Hype:
10 Defects of Apple iPhone 4S That You Overlooked[Web log post].
Retrieved from http://www.ibtimes.com/forget-hype-10-defects-apple-
iphone-4s-you-overlooked-324822
xxix
BALASUBRAMANYAM SESHAN, (2011,October20), Forget the Hype:
10 Defects of Apple iPhone 4S That You Overlooked[Web log post].
Retrieved from http://www.ibtimes.com/forget-hype-10-defects-apple-
iphone-4s-you-overlooked-324822
xxx
TECHOPEDIA, (2016,September 14),Software Testing [Web log post].
Retrieved from https://www.techopedia.com/definition/17681/software-
testing
xxxi
WIKIPEDIA, (2016,September 14),Software Testing [Web log post].
Retrieved from https://en.wikipedia.org/wiki/Software_testing
xxxii
istqbexamcertification.com, (2016,September 14), [Web log post]. Retrieved
from http://istqbexamcertification.com/what-is-a-software-testing/
xxxiii
Whatis.com, (2016,September 14),Software Testing[Web log post].
Retrieved from http://whatis.techtarget.com/definition/software-testing
xxxiv
(2016,September 14),Software Testing[Web log post]. Retrieved from
http://www.codeproject.com/Tips/351122/What-is-software-testing-What-
are-the-different-ty
xxxv
TESTINGSTANDARDS, (2016,September 14),Glossary of terms used in
software testing[Web log post]. Retrieved from
298
http://www.testingstandards.co.uk/bs_7925-1_online.htm
xxxvi
TESTINGSTANDARDS, (2016,September 14),Glossary of terms used in
software testing[Web log post]. Retrieved from
http://www.testingstandards.co.uk/living_glossary.htm
xxxvii
Cancer Research UK, , (2016,September 14), [Web log post]. Retrieved
from http://www.cancerresearchuk.org/about-cancer/cancer-
symptoms/why-is-early-diagnosis-important
xxxviii
iSixSigma, (2016,September 14),[Web log post]. Retrieved from
https://www.isixsigma.com/industries/software-it/defect-prevention-
reducing-costs-and-enhancing-quality/
xxxix
Cancer Research UK, , (2016,September 14), [Web log post]. Retrieved
from http://www.cancerresearchuk.org/about-cancer/cancers-in-
general/tests/pet-scan
xl
Michael (2016 August 25)TAKING YOUR SELENIUM TESTS FOR WEB
AND MOBILE BEYOND YOUR LOCAL FIREFOX BROWSER[Web log
post]. Retrieved from
http://www.jug.ch/html/events/2016/selenium_tests.html
xli
HP(2016 September 24),Unified Functional Testing (UFT) [Web log post].
Retrieved from http://www8.hp.com/uk/en/software-solutions/unified-
functional-automated-testing/
xlii
henrytejera @ gmail dot com (2016 September 23)VBS WebDriver Just a
VBScript bindings for Selenium 2. [beta] Current version is 1.0.0 Beta [Web
log post]. Retrieved from http://htejera.users.sourceforge.net/vbsWebDriver/
xliii
Google code(2016 September 24)Twin,Paragraph4 [Web log post].
Retrieved from https://code.google.com/archive/p/twin/
299