Selenium Document
Selenium Document
Selenium Document
Selenium is a set of open-source web automation tools that leverages the power of
web browsers and helps in automating workflows of how users interact with the web
application within the browser.
Selenium is not just an automation tool. It is a suite of tools, and each tool in the
suite have specific unique capabilities that help in designing and development of
automation framework.
The various components of the Selenium Suite:
1. Selenium IDE
2. Selenium Grid
3. Selenium RC
4. Web Driver
What is Selenium IDE?
Selenium IDE is an extension available for both Firefox and Chrome, which has the
record and replay functionality available. Selenium IDE also now has the capability of
exporting the code in various predefined languages. It also gives the ability to use
one test case inside another.
Selenium features
Open Source – Selenium is open source, which means that no cost is
required to set up and use Selenium. Selenium is free to download and use.
Mimic User Actions – Almost all real-world user actions like button click,
drag, and drop selection, checkboxes, key presses, taps, scrolling can
automate using Selenium.
Easy Implementation – Selenium is famous for being user friendly. Users
can develop custom extensions for their use since code is open source.
Language Support – The most significant benefit of Selenium is the
extensive support for various languages. Selenium supports maximum
programming languages like Java, Python, JavaScript, C#, Ruby, Perl,
Haskell, Go, among others.
Browser Support – Selenium can work on all the browser vendors that are
out there. Selenium has support for Chrome, Firefox, Edge, Internet Explorer,
and Safari.
OS Support – Selenium bindings are available for all the primary OS like
Linux, macros, Windows.
Framework Support – Selenium supports multiple frameworks like Maven,
TestNG, PYTest, NUnit, Mocha, Jasmine, etc. Selenium integrates well with
CI tools like Jenkins, Circle CI, GOCD, Travis CI, Gitlab, etc.
Code Reusability – Scripts written for Selenium are cross-browser
compatible. Same code can be run for multiple browsers using respective
browser.
The commands provided by Selenium Web Driver can be broadly classified in following
categories:
1. Browser Commands
2. Navigation Commands
3. Web Element Commands
The very basic browser operations of Web Driver include opening a browser perform
few tasks and then closing the browser.
Given are some of the most commonly used Browser commands for Selenium Web
Driver.
1. Get Command
2. Get Title Command
3. Get Current URL Command
4. Get Page Source Command
5. Close Command
6. Quit Command
Selenium Web Driver - Navigation Commands
Web Driver provides some basic Browser Navigation Commands that allows the browser to
move backwards or forwards in the browser's history.
we can also access the navigation methods provided by Web Driver by typing
driver.navigate().
some of the most commonly used Browser Navigation commands for Selenium Web
Driver.
1. Navigate To Command
2. Forward Command
3. Back Command
4. Refresh Command
Selenium Web Driver - Web Element Commands
The term web element refers to a HTML element. The HTML documents are
composed of HTML elements. It consists a start tag, an end tag and the content in
between. For instance, a HTML element is written as: "<tagname> content
</tagname>".
1. Clear Command
2. Sendkeys Command
3. Click Command
4. IsDisplayed Command
5. IsEnabled Command
6. IsSelected Command
7. Submit Command
8. GetText Command
9. GetTagName Command
10. getCssValue Command
11. getAttribute Command
12. getSize Command
13. getLocation Command