[go: up one dir, main page]

0% found this document useful (0 votes)
885 views18 pages

Cognizant Internship: Selenium Testing Insights

The document summarizes Ilisha Aggarwal's internship report on their experience as a Programmer Analyst Trainee at Cognizant under the supervision of Ms. Aparna Deshpande and Dr. Naveen Babu from Shiv Nadar University's Department of Electrical Engineering. The report includes an abstract on learning Selenium, certificates of completion from supervisors, a table of contents, chapters on the introduction and stages of the internship, literature review on automation testing and the environment used, work completed covering various technologies, and conclusions and future prospects.

Uploaded by

naveenbabu19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
885 views18 pages

Cognizant Internship: Selenium Testing Insights

The document summarizes Ilisha Aggarwal's internship report on their experience as a Programmer Analyst Trainee at Cognizant under the supervision of Ms. Aparna Deshpande and Dr. Naveen Babu from Shiv Nadar University's Department of Electrical Engineering. The report includes an abstract on learning Selenium, certificates of completion from supervisors, a table of contents, chapters on the introduction and stages of the internship, literature review on automation testing and the environment used, work completed covering various technologies, and conclusions and future prospects.

Uploaded by

naveenbabu19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Cognizant Internship – Programmer Analyst Trainee

Spring 2020

Submitted by

Ilisha Aggarwal (1610110151)

Under supervision of

Ms. Aparna Deshpande

(Trainer, Cognizant, Pune)

and

Dr. Naveen Babu

(Dept. of Electrical Engineering)

Department of Electrical Engineering


School of Engineering

Shiv Nadar University (May, 2020)


Candidate Declaration

I hereby declare that the thesis entitled “Cognizant Internship” submitted for the
B Tech Degree program. This thesis has written in my own words. I have
adequately cited and referenced the original sources.

(Signature)

Ilisha Aggarwal

(1610110151)

Date: 15May 2020


CERTIFICATE

It is certified that the work contained in the project report titled “Cognizant Internship- Programmer
Analyst Trainee”, by “Ilisha Aggarwal”, has been carried out under my/our supervision and that
this work has not been submitted elsewhere for a degree.

Signature of Supervisor(s)

Dr. Naveen Babu

Department of Electrical Engineering

School of Engineering

Shiv Nadar University

May, 2020
Abstract
Selenium is a portable framework for testing web applications. It provides a playback tool for
authoring functional tests without the need to learn a test scripting language (Selenium IDE). It
also provides a test domain-specific language (Selenese) to write tests in a number of popular
programming languages, including C#, Groovy, Java, Perl, PHP, Python, Ruby and Scala. The
tests can then run against most modern web browsers. Selenium runs on Windows, Linux,
and macOS. It is open-source software released under the Apache License 2.0. After the learning
path, one was able to configure Selenium API’s and run tests on all browsers, demonstrate locator
Techniques & Tools used to identify elements/objects, identify the web element by
using absolute and relative Xpath concept. Get the image element and its attribute value,
understand JavaScript executor, implement TestNG Framework in Selenium Scripts and
structurize test cases using concepts such as annotations, grouping, sequencing, and
parameterization. Perform parallel tests as well as generate test reports of the executed tests,
understand the basic excel parsing using Apache POI, read the excel sheet data’s using selenium
Webdriver, understand the Test Automation Frameworks with Page Object Model (POM),
understand how to create and parse JSON and XML for selenium automation.

The final projects consisted of automating tasks which normally would be cumbersome while
handling large data.
Project 1: Get 5 mobiles from a popular online store, which has:
a. Price less than Rs. 30000
b. Mobiles which are newly arrived.
(Suggested site: [Link])
Project 2: Search and display all web development courses
a. should be for beginner’s level.
b. Courses offered in English language

c. Display first two courses with name, total learning hours and rating.
(Suggested Site: [Link])
Table of Contents

1. Introduction ……………………………………………………………….. 1

1.1 Stage 1…………………………………………………………… 1

1.2 Stage 2……………………………………………………………2

2 Literature Review …………….…………………………………………………3

2.1 Automation Testing………………………………………………3

2.1.1 Benefits of automated


testing…………………………………………3

2.2 Environment Specifications………………………………………4

2.2.1 Selenium………………………………………4

2.2.2 Eclipse IDE……………………………………4

2.2.3 TestNG………………………………………4

2.2.4 Apache POI…………………………………5

2.3 Automation Workflow…………………………………………5

3 Work done ………………….……………………………………………….6

3.1 Software Testing …………………………………………….6

3.2 Java……………………………………………………………6

3.3 SQL……………………………………………………………6
3.4 JDBC………………………………………………………………7

3.5 HTML + CSS………………………………………………………7

3.6 API Documentation………………………………………………7

3.7 JavaScript……………………………………………………………8

3.8 Xpath and Selectors…………………………………………………8

3.9 Selenium……………………………………………………………8

3.10 Final Projects……………………………………………………9

4 Conclusion ……………………………………………………………………. …10

5 Future Prospects……………………………………………………………………11

6 References…………………………………………………………………………12
Chapter 1

Introduction

Academy Internship program engaged the students with a comprehensive learning pathway, giving
an opportunity to interact with Subject Matter Experts (SME) and understand the corporate
environment and also groom before joining. The learning consisted of 2 Stages:

1.1 Stage 1- QEA Basics Learning Path

It comprised of the following:

a) Agile Methodologies and Phases of Software Testing life cycles(STLC)


b) Basics of Automation concepts
c) WebUI Concepts(HTML, CSS, XPATH)
d) Java script
e) DataSource(SQL, XML , JSON)
f) Behavioral Skills
g) Quizes & Coding Challenges
1.2 Stage 2- Selenium Learning Path

It comprised of the following:

a) Selenium configuration, WebDriver Basics


b) Selenium Automation Techniques & Dynamic XPath
c) Selenium Webdriver With POM & ApachePOI
d) Selenium SBA
e) Selenium with TestNG
Chapter 2

Literature Review

2.1 Automation testing:

Testing is an essential part of a software development process. While testing intermediate versions
of products/projects being developed, testing team needs to execute a number of test cases. In
addition, prior to release every new version, it is mandatory that the version is passed through a set
of “regression” and “smoke” tests. Most of all such tests are standard for every new version of
product/project, and therefore can be automated in order to save human resources and time for
executing them.

2.1.1 Benefits of using automated testing:

a) Reduction of tests’ time execution and human resources required

b) Complete control over the tests’ results (“actual results” vs “expected results”)

c) Possibility to quickly change test’s preconditions and input data, and re-run the tests
dynamically with multiple sets of data
2.2 Environment Specifications:

a. Selenium Webdriver

b. Eclipse IDE

c. TestNG

d. Apache POI

2.2.1 Selenium:

Selenium is a well know open source testing framework, which is widely used for testing
Web-based applications. It is designed to automate web browser interaction. It is primarily
used to write scripts for actions users might take on the website, testing site functionality
much faster than one could by hand. A short Selenium test might confirm that the browser
can load a page at all, while a more complex test could automate an entire journey from
log-in to a shopping cart. Selenium Webdriver supports most of all browsers to run test
cases and many programming languages like C#, Java, Python, Ruby, .Net, Perl, PHP, etc
to create and modify test scripts.

2.2.2 Eclipse IDE:

Eclipse is an integrated development environment (IDE) for Java. The Eclipse IDE is the
most known product of the Eclipse Open Source project.

2.2.3 TestNG:

It is a testing framework inspired from JUnit and NUnit. It has extended new functionalities
which made it more powerful and easier than the other testing frameworks.
2.2.4 Apache POI:

Properties file – We use properties file to store and retrieve the UI elements of an application
or a website and data set file paths. It contains id of the elements, name, xpath or Css selector
etc. Excel files – Excel files are used to pass multiple sets of data to the application. Xml file –
Is used to execute the test scripts. Based on the package or classes or Tests mentioned in the
xml file scripts will be executed.

2.3 Automation workflow:

There are seven basic elements of a Selenium test script, which apply to any test case and any
application under test (AUT):

a. Create a WebDriver instance.

b. Navigate to a Web page.

c. Locate an HTML element on the Web page.

d. Perform an action on an HTML element.

e. Anticipate the browser response to the action.

f. Run tests and record test results using a test framework.

g. Conclude the test.


Chapter 3

Work Done

3.1 Software testing

Covered Test case writing & bug reporting, Test management tools (Test link), Agile Testing
Basics, Black Box Techniques (Equivalence Partitioning-Boundary Value Analysis-Decision
Table Testing-State Transition Testing-Use Case Testing), White Box Techniques (Statement
Coverage-Decision Coverage-Path Coverage-MC/DC-Loop Coverage)

3.2 Java

Core Java was covered including topics like Object Oriented Programming (OOPS) and Data
Structures.

3.3 SQL

Through the course the following was covered: Creating, Modifying and Deleting Tables in a
Database (DDL), Inserting, Updating and Deleting Data from Tables (DML), Select Queries,
Joins, Aggregate Functions, Subqueries, Database Design, Creating Databases.
3.4 JDBC

The following was covered:

a. Connect to a MySQL Database with Java

b. Submit SQL statements to insert, update and delete data

c. Handle SQL parameters with Prepared Statements

d. Calls stored procedures and handle various parameter types (IN, INOUT etc.)

e. Read and write BLOB and CLOB data files

f. Configure the database connection information with properties files

3.5 HTML+ CSS

One learnt writing HTML Code, CSS Code, Understand the CSS Box Model and finally
combine CSS and HTML to build websites

3.6 API Documentation

This course taught how to document structured data, focusing on the two most popular
structured data formats: JSON and XML.
3.7 JavaScript

JavaScript is one of the most popular programming languages in the world, and growing
faster than any other programming language. As a developer, one can use JavaScript
to build web and mobile apps, real-time networking apps, command-line tools, and games.

3.8 Xpath and selectors

This course covered HTML Basics, Locating Elements Using ID, Name, Class, Creating
XPath, Creating CSS Selectors, using Locaters in Selenium WebDriver Scripts, Using
XPath and CSS in Selenium WebDriver Scripts.

3.9 Selenium WebDriver

One learnt about Selenium Webdriver, Selenium Grid, Selenium Framework Design,
TestNG, Maven, and Apache POI.

After the course, one was able to design Selenium Automation Framework and proficient
in Automation Scripting.
3.10 Final Projects

The final projects consisted of automating tasks which normally would be cumbersome
while handling large data.

Project 1: Get 5 mobiles from a popular online store, which has:

a. Price less than Rs. 30000


b. Mobiles which are newly arrived.
(Suggested site: [Link])

Project 2: Search and display all web development courses

a. Should be for beginner’s level.


b. Courses offered in English language
c. Display first two courses with name, total learning hours and rating.
(Suggested Site: [Link])
Chapter 4

Conclusion

Selenium WebDriver tool is used to automate web application testing to verify that it works
as expected. It supports many browsers such as Firefox, Chrome, IE, and Safari.
However, using the Selenium WebDriver, we can automate testing for web applications
only. It does not qualify for window-based applications. It also supports different
programming languages such as C#, Java, Perl, PHP and Ruby for writing test scripts.
Selenium Webdriver is platform-independent since the same code can be used on
different Operating Systems like Microsoft Windows, Apple OS and Linux. It is one of the
components of the selenium family, which also includes Selenium IDE, Selenium Client
API, Selenium Remote Control and Selenium Grid.

Selenium WebDriver does not handle window component, but this limitation can be
overcome by using external tools such as AUTO IT tool, Sikuli etc. It has different location
strategies as well such as ID, Name, Link text, Partial link text, Class name, CSS selector
and Xpath. It also has better support dynamic web pages like Ajax, where elements of the
web page may change without the page itself being reloaded. By using different jar files,
we can also test API, Database Test etc. using Selenium WebDriver.

One successfully learnt all the tools and technologies and also wrote scripts for
automation.
Chapter 5

Future Prospects

Nowadays, software quality assurance (QA) has become an integral part of each project. Many
organizations even adopt test-based development approach to make the coding compatible with
testing modules. The QA professionals further use several test automation tools and frameworks to
facilitate test management. As a compact and robust software testing framework, Selenium is used
widely for web application. The open source framework was originally developed by a team of
testers at ThoughtWorks in 2014.

The open source and free nature of the framework helps enterprises in curtailing testing costs. They
can further use the web application testing frameworks along with several commercial tools to
optimize test management.

But the testers have option to write the test scripts in a variety of programming languages in
addition to Selenese. The Selenium Client API supports a number of widely used programming
languages like C#, Java, Perl, PHP, Ruby and Python. So the QA professionals can choose the
client API according to their choice of programming language, and call methods to communicate
with Selenium smoothly.

But within a decade, Selenium has become synonymous with internet application testing. A number
of recent reports have highlighted that Selenium skills has become one of the most commonly and
widely required test automation technology. As each enterprise has to optimize the look, feel and
performance of a web application to deliver user experience, Selenium testing is expected to grow
steadily over next few years.
References

[1] [Link]

You might also like