DEV Community

Cover image for Selenium:Tool for Web Automation
Bala Venkatesh
Bala Venkatesh

Posted on

Selenium:Tool for Web Automation

Introduction

When it comes to topic of automation , particularly web based automation / testing, selenium is most heard word.

Here, In this post we try to provide simpler explanation of what selenium is, why it is used for web automation and how it interacts with browsers.

What is Selenium?
Selenium is open-source automation tool mainly used for automating web applications.

OPEN_SOURCE

Selenium provides tools/libraries which helps testers to automate browser interactions, user actions and validation of web element.

Some Popular Selenium Libraries:

  • Webdriver --> acts as interface between script and browser

  • Grid --> for parallel execution

  • Actions API --> Methods for mouse movements, keyboard actions, drag and drop

  • Wait API --> offers wait

Why we use Selenium for Automation

Listing down key features of selenium which explains selenium is a go to tool for automation,

  • Cross Browser Testing: we can test across different browsers.

cross-browser

  • Platform Independence: Supports different OS

OS

  • Language: As selenium accepts programming languages such as Java, Python, JS, Ruby and C# so , based on our need we can use required programming language.

Language

  • Easy Integration: It is easy integrate with frameworks such as TestNG and JUnit which helps in organizing and reporting.

Frameworks

  • Parallel Execution: Using selenium grid we can perform parallel execution across different browsers in different OS, which is time and cost effective in terms of testing.

How Selenium works with browser?

FlowChart

  1. We create script / program using webdriver commands which gets executed when required.

  2. When executed it reaches required browser drivers which starts translating to browser readable.

  3. Actions will be performed on browser as mentioned in webdriver commands.

Note: Current version of Selenium is Selenium 4
Enter fullscreen mode Exit fullscreen mode

Conclusion
Selenium is an essential tool for any automation testing project based on web and it has an added advantage to perform testing across different browsers and platforms, greater compatibility with frameworks.
With all these features in open-source is highly valuable.

Top comments (0)