Friday, November 15, 2024
Google search engine
HomeLanguagesSelenium Basics – Components, Features, Uses and Limitations

Selenium Basics – Components, Features, Uses and Limitations

Selenium is a powerful tool for controlling web browser through program. It is functional for all browsers, works on all major OS and its scripts are written in various languages i.e Python, Java, C#, etc, we will be working with Python. Selenium has four major components – Selenium IDE, Selenium RC, Selenium Web driver, Selenium GRID.

Components-of-Selenium

Selenium Basics

Components

Selenium has been in the industry for a long time and used by automation testers all around the globe.
Let’s check the four major components of Selenium –

Selenium IDE

Selenium IDE (Integrated Development Environment) is the major tool in the Selenium Suite. It is a complete integrated development environment (IDE) for Selenium tests. It is implemented as a Firefox Add-On and as a Chrome Extension. It allows for recording, editing and debugging of functional tests. It was previously known as Selenium Recorder. Selenium-IDE was originally created by Shinya Kasatani and donated to the Selenium project in 2006. Selenium IDE was previously little-maintained. Selenium IDE began being actively maintained in 2018.

Scripts may be automatically recorded and edited manually providing autocompletion support and the ability to move commands around quickly. Scripts are recorded in Selenese, a special test scripting language for Selenium. Selenese provides commands for performing actions in a browser (click a link, select an option) and for retrieving data from the resulting pages.

Selenium RC (Remote control)

Selenium Remote Control (RC) is a server, written in Java, that accepts commands for the browser via HTTP. RC makes it possible to write automated tests for a web application in any programming language, which allows for better integration of Selenium in existing unit test frameworks. To make writing tests easier, Selenium project currently provides client drivers for PHP, Python, Ruby, .NET, Perl and Java. The Java driver can also be used with JavaScript (via the Rhino engine). An instance of selenium RC server is needed to launch html test case – which means that the port should be different for each parallel run. However, for Java/PHP test case only one Selenium RC instance needs to be running continuously.

Selenium Web Driver

Selenium WebDriver is the successor to Selenium RC. Selenium WebDriver accepts commands (sent in Selenese, or via a Client API) and sends them to a browser. This is implemented through a browser-specific browser driver, which sends commands to a browser and retrieves results. Most browser drivers actually launch and access a browser application (such as Firefox, Google Chrome, Internet Explorer, Safari, or Microsoft Edge); there is also an HtmlUnit browser driver, which simulates a browser using the headless browser HtmlUnit.

Selenium WebDriver does not need a special server to execute tests. Instead, the WebDriver directly starts a browser instance and controls it. However, Selenium Grid can be used with WebDriver to execute tests on remote systems (see below). Where possible, WebDriver uses native operating system level functionality rather than browser-based JavaScript commands to drive the browser. This bypasses problems with subtle differences between native and JavaScript commands, including security restrictions.

Selenium GRID

Selenium Grid is a server that allows tests to use web browser instances running on remote machines. With Selenium Grid, one server acts as the hub. Tests contact the hub to obtain access to browser instances. The hub has a list of servers that provide access to browser instances (WebDriver nodes), and lets tests use these instances. Selenium Grid allows running tests in parallel on multiple machines and to manage different browser versions and browser configurations centrally (instead of in each individual test).

The ability to run tests on remote browser instances is useful to spread the load of testing across several machines and to run tests in browsers running on different platforms or operating systems. The latter is particularly useful in cases where not all browsers to be used for testing can run on the same platform.
For More, check out – Components of Selenium.

Features

  • Open Source and Portable – Selenium is an open source and portable Web testing Framework.
  • Combination of tool and DSL – Selenium is combination of tools and DSL (Domain Specific Language) in order to carry out various types of tests.
  • Easier to understand and implement – Selenium commands are categorized in terms of different classes which make it easier to understand and implement.
  • Reduce test execution time – Selenium supports parallel test execution that reduce the time taken in executing parallel tests.
  • Lesser resources required – Selenium requires lesser resources when compared to its competitors like UFT, RFT, etc.
  • Supports Multiple Programming Languages – C#, Java, Python, PHP, Ruby, Perl, and JavaScript
  • Supports Multiple Operating Systems – Android, iOS, Windows, Linux, Mac, Solaris.
  • Supports Multiple Browsers – Google Chrome, Mozilla Firefox, Internet Explorer, Edge, Opera, Safari, etc.
  • Parallel Test Execution – It also supports parallel test execution which reduces time and increases the efficiency of tests.

For more, checkout – Features of Selenium Webdriver

Applications

Selenium WebDriver 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.

  • Open Source and Portable – Selenium is an open source and portable Web testing Framework.
  • Less burden and stress for testers – As mentioned above, the amount of time required to do testing repeated test scenarios on each and every new build is reduced to zero, almost. Hence, the burden of tester gets reduced.
  • Cost reduction for the Business Clients – The Business needs to pay the testers their salary, which is saved using automation testing tool. The automation not only saves time but gets cost benefits too, to the business.
  • Increased test coverage – With the uses of Selenium, testing time gets reduced and hence the tester can do more testing on other test scenarios at the same time.
  • Reduce test execution time – Selenium supports parallel test execution that reduce the time taken in executing parallel tests.

For more, checkout – Applications and Uses of Selenium WebDriver

Limitations

  • No support for desktop applications – Selenium does not support testing for desktop applications.
  • Expertise – Selenium requires expertise of your team — and resources to manage.
  • Maintenance and Scalability – Selenium is a maintenance-heavy framework — and is difficult to scale as one grows.
  • Open Source Forums – Since Selenium is open source software, one has to rely on community forums to get your technical issues resolved.
  • No support for REST and SOAP Platforms – We can’t perform automation tests on web services like SOAP or REST using Selenium.
  • No Reporting capability – Selenium does not have any inbuilt reporting capability, one has to rely on plug-ins like JUnit and TestNG for test reports.
  • Image Testing – It is not possible to perform testing on images. One needs to integrate Selenium with Sikuli for image testing.

For more, checkout – Limitations of Selenium Webdriver

Dominic Rubhabha-Wardslaus
Dominic Rubhabha-Wardslaushttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Recent Comments