Selenium is used in many IT companies due to its numerous advantages compared to other automation testing tools in the market.We provide best Selenium training in Chennai with real time scenarios. We are the best training institute in Chennai providing the real time training in Chennai
2. What is TestNG?
â˘So far we had been doing Selenium tests without generating a proper
format for the test results. From this point on, we shall tackle how to
make these reports using a test framework called TestNG.
â˘TestNG is a testing framework that overcomes the limitations of
another popular testing framework called JUnit. The "NG" means "Next
Generation".
â˘Most Selenium users use this more than JUnit because of its
advantages. There are so many features of TestNG, but we will only
focus on the most important ones that we can use in Selenium.
3. Advantages of TestNG over JUnit
There are three major advantages of TestNG over JUnit:
Annotations are easier to understand
Test cases can be grouped more easily
Parallel testing is possible
4. What is Selenium Grid?
â˘Selenium Grid is a part of the Selenium Suite that specializes on
running multiple tests across different browsers, operating systems,
and machines in parallel.
â˘Selenium Grid has 2 versions - the older Grid 1 and the newer Grid 2.
We will only focus on Grid 2 because Grid 1 is gradually being
deprecated by the Selenium Team.
â˘Selenium Grid uses a hub-node concept where you only run the test
on a single machine called a hub, but the execution will be done by
different machines called nodes.
5. When to Use Selenium Grid?
You should use Selenium Grid when you want to do either one or both
of following:
â˘Run your tests against different browsers, operating systems, and
machines all at the same time. This will ensure that the application you
are testing is fully compatible with a wide range of browser-O.S
combinations.
â˘Save time in the execution of your test suites. If you set up Selenium
Grid to run, say, 4 tests at a time, then you would be able to finish the
whole suite around 4 times faster.
6. ⢠As we create software we always wish it should work differently with
a different set of data. When it comes to testing the same piece of
software, we can't be unfair to test it with just one set of data. Here
again, we need to verify that our system is taking all set of
combinations which it expected to support.
⢠Here comes Parameterization in picture. To pass multiple data to
the application at runtime, we need to parameterize our test scripts.
⢠This concept which we achieve by parameterization is called Data
Driven Testing .
7. Type of Parameterization in TestNG-
â˘To make parameterization more clear, we will go through the
parameterization options in one the most popular framework for
Selenium Webdriver - TestNG.
There are two ways by which we can achieve parameterization in
TestNG
â˘With the help of Parameters annotation and TestNG XML file.
â˘With the help of DataProvider annotation.
8. â˘Cross Browser Testing is a type of functional test to check that your
web application works as expected in different browsers.
Why do we need Cross Browser Testing?
â˘Web based applications are totally different from windows
applications. A web application can be opened in any browser by the
end user. For example some people prefer to open http://twitter.comin
Firefox browser, while other's can be using Chrome browser or IE.
â˘In the diagram below you can observe that in IE, the login box of
twitter is not showing curve at all corners but we are able to see it in
chrome browser.
9. â˘File IO is a critical part for any software process. We frequently create
a file, open it & update something or delete it in our Computers. Same
is the case with Selenium Automation. We need a process to
manipulate files with Selenium.
â˘Java provides us different classes for File Manipulation with Selenium.
In this tutorial we are going to learn how can we read and write on
excel file with the help of Java IO package and Apache POI library.
10. â˘Frameworks help to structure our code and make maintenance easy.
Without frameworks we will place all our code and data in same place
which is neither re-usable nor readable. Using Frameworks, produce
beneficial outcomes like increase code re-usage , higher portability ,
reduced script maintenance cost etc
There are mainly three type of frameworks created by Selenium
WebDriver to automate manual testcases
â˘Data Driven Test Framework
â˘Keyword Driven Test Framework
â˘Hybrid Test Framework
11. Before we learn about Page Object Model, lets understand -
Why POM ?
â˘Starting a UI Automation in Selenium WebDriver is NOT a tough task.
You just need to find elements, perform operations on it .
â˘Consider this simple script to login into a website
What is POM?
â˘Page Object Model is a design pattern to create Object Repository for
web UI elements.
â˘Under this model, for each web page in the application there should
be corresponding page class.
â˘This Page class will find the WebElements of that web page and also
contains Page methods which perform operations on those
WebElements.
12. Why do we need reporting ?
â˘When we are using Selenium or any other automation tool, we are
performing operations on the web application. But our purpose of
automation is not just to exercise the Application Under Test.
â˘We, as an automation tester are supposed to test the application, find
bugs and report it to development team or higher management.
Here the reporting gets importance for software testing process
â˘TestNG Reporting
â˘TestNG library provides a very handy reporting feature. After
execution, TestNG will generate a test-output folder at the root of the
project. This folder contains two type of Reports-
13. â˘If a simple XPath is not able to find a complicated web element for our
test script, we need to use the functions from XPath 1.0 library. With
the combination of these functions, we can create more specific XPath.
Let's discuss a 3 such functions â
â˘Contains
â˘Sibiling
â˘Ancestor
Let's study them in detail -
â˘Contains: By using 'contains' function in XPath, we can extract all the
elements which matches a particular text value.
â˘Sibling: Using sibling keyword, we can fetch a web element on the
which is related to some other element.
â˘Ancestor: To find an element on the basis of the parent element we
can use ancestor attribute of XPath.
14. To understand extensions, lets first understand the three pillars of
selenium IDE
â˘Action: What operation you are performing on UI Screen
â˘Assessors/Assertion: What verification you do on data you get from UI
â˘Locator Strategy: How can we find the element in UI.
15. â˘In this presentation, I have giv en the introduction of
webdriver and explained about comparison of selenium
RC.
â˘Further topics will be expain in nest presentation.
â˘If you are interested to join in the training reach us-
8122241286
â˘Visit us-http://thecreatingexperts.com/selenium-training-in-
chennai/