PAT TASK 17 Selenium
Published: 2024-06-01 18:56:10

Q: What is selenium? Why do we use Selenium for automation ?
A: Selenium is a free(Open Source) automated testing suite for web applications across different browsers and platforms. It is primarily used for automating web based applications and is known for its ability to control the browser by directly communicating with it. Selenium provides a range of tools and libraries aims at supporting browser automation, including a playback tool for authoring functional tests across most modern web browsers, a test domain-specific language to write tests in various programming languages, and a collection of language specific bindings to drive a browser. selenium runs on windows , Linux and Mac OS and is released under the Apache license 2.0.
Multiple programming languages can be used such as JAVA, C, Python to create selenium test scripts. Hence testing done using selenium testing toll is usually referred to as selenium testing.
Selenium software is not just a single tool, Its a suite of software, each piece catering to different selenium QA testing needs of an organization.

In summary, Selenium is preferred for automation due to its versatility, cross-browser testing capabilities, language support, community backing, cost-effectiveness, and integration with CI/CD tools.

<u>Below are the list tools:</u>
1. Selenium Integrated development Environment : Selenium Integrated Development Environment (IDE) is the simplest framework in the Selenium suite and is the easiest one to learn.
It is a Chrome and Firefox plugin that you can install as easily as you can with other plugins
because of its simplicity, Selenium IDE should only be used as a prototyping tool. If you want to create more advanced test cases, 
you will need to use either Selenium RC or WebDriver

2. Selenium Remote Control (RC) : Selenium RC was the flagship testing framework of the whole Selenium project for a long time. 
This is the first automated web testing tool that allows users to use a programming language they prefer to use.
As of today version 2.25.0, and also RC can support the following programming languages:
Languages Supported: JAVA,C#,PHP,PYTHON,PERL,RUBY.

3. Web Driver : WebDriver proves to be better than Selenium IDE and Selenium RC in many aspects.
It implements a more modern and stable approach in automating the browser’s actions. 
WebDriver, unlike Selenium RC, does not rely on JavaScript for Selenium Automation Testing. 
It controls the browser by directly communicating with it.
Languages Supports: JAVA,C#,PHP,PYTHON,PERL,RUBY.

4. Selenium Grid : Selenium Grid is a tool used together with Selenium RC to run parallel tests across different machines and different browsers all at the same time. 
Parallel execution meaning running multiple tests at once.


**Selenium is used for automation due to several reasons:
**

1. Web Application Automation: Selenium is primarily used for automating web applications for testing purposes, but it is not limited to just that. It can also automate boring web-based administration tasks, making it a versatile tool for automation 

2. Cross-Browser Testing: It allows for testing web applications across different browsers and platforms, making it suitable for cross-browser testing 

3. Language Support: Selenium supports a number of popular programming languages, including JavaScript, C#, Groovy, Java, Perl, PHP, Python, Ruby, and Scala, making it accessible to a wide range of developers 

4. Community Support: Selenium has a rapidly growing community, with helpful documentation and tutorials available for developers and testers to start with Selenium automation testing.
Cost and Portability: Selenium is freeware with no upfront direct costs involved, and its community-based support is freely available. It can be freely downloaded and used, making it cost-effective and portable 

5. Integration and Scalability: Selenium can be easily integrated with different CI/CD tools like Jenkins, CircleCI, Bamboo, Azure DevOps, Docker, etc., and it offers features such as fast feedback loop, automation at scale, and parallel testing

**Advantages of Selenium for Automated Testing:
**
1. Language and Framework Support
Selenium supports all major languages like Java, Python, JavaScript, C#, Ruby and pearl for software test automation. 
we can write our steps in any of these programming languages, and Selenium will convert it into a Selenium compatible course in no time. 
There is no requirement for no in Selenium only languages. 
Also, every Selenium supported language has appropriated three works that help write test scripts for Selenium test automation. 

So when we go for Selenium as a tool for performing automation testing, 
we won’t have to worry about language and framework support as Selenium will do that for us.

2. Open Source Availability
The availability of open source code is one of the benefits of Selenium. 
Selenium is a publicly available automation framework that is free to use because it is an open-source product.
Work can be saved here and used for other beneficial purposes.
The Selenium community is always willing to assist developers and software engineers in automating web browser capabilities and functionality.

Selenium, as an open-source technology, also allows us to customize the code for easier management 
and to improve the functionality of preset methods and classes.

3. Multi-Browser Support
The Selenium community has been working on improvising every day on one Selenium script for all browsers. 
According to StatCounter, Chrome, Firefox, Safari, Internet Explorer, and browsers worldwide, 
and Selenium benefits are compatible with all these mentioned browsers. 
You must not write a script for every browser as just one script is required for all browsers.

4. Support Across Various Operations
Different people use various operating systems, and your automation tool must support all of them. 
Selenium is a highly profitable tool supporting and could work across different operating systems like Windows, Linux, Mac OS, Unix, etc.

5. Ease of Implementation
The selenium automation framework is very easy to use as it provides a user-friendly interface 
that helps users create and execute test scripts easily and effectively. 
we can also watch while the test runs and analyses detailed reports of the selenium test and takes follow-up actions.