LambdaTest Community

Find answers, support, and inspiration from other users

Questions 2
LambdaTest Community
Answered

What are the basics of Selenium testing?

What are the basics of Selenium testing?

Up Vote Down Vote 1 Votes
Posted 5 months ago

Answers 2


Selenium is a popular automation testing framework that is primarily used for cross browser testing. It is open source and is ideal for automating testing of web applications across different browsers like Firefox, Chrome, Internet Explorer, Microsoft Edge, etc.

Selenium has become a renowned framework and is giving stiff competition to other test frameworks like HP QTP (Quick Test Professional) and AKA HP UFT (Unified Functional Testing). This tutorial for selenium WebDriver will help you develop the basic understanding of the components of Selenium suite, Selenium WebDriver architecture & will show you how to run automation to test a website for cross browser compatibility using selenium webdriver for Google Chrome, Mozilla Firefox and Internet Explorer.

Selenium is a combination of different tools and each tool/block plays a critical role in the automating web-app/website testing. Let’s deep dive into the Selenium WebDriver tutorial.

Components of the Selenium Suite

Below are the core components of the Selenium Test Suite

  • Selenium Integrated Development Environment (IDE)
  • Selenium Remote Control (RC)
  • Selenium WebDriver
  • Selenium Grid Now, let’s have a look at these components in details, in this Selenium WebDriver tutorial.

Selenium Integrated Development Environment (IDE)

Selenium IDE is a simple Firefox Plugin and it is used to record & playback scripts. However, the Selenium IDE can only be used to write automation scripts for automating testing of simple use cases. Selenium IDE does not support Conditional statements, Exception handling, loops, screenshot capture, etc. For automating complex use cases, a majority of developers and testers prefer to opt for Scripting testing instead of Record & Replay testing. The Selenium test suite consists of Selenium Remote Control (RC) or Selenium WebDriver.

Selenium IDE is available for different operating systems namely Windows, Linux, Mac OS, etc. Selenium IDE for Firefox can be downloaded from here.

Selenium Remote Control (RC)

For testing complex scenarios, Selenium Remote Control (RC) can be used. It is based on the client-server model which makes it possible to execute tests on the browser that is controlled by the server. There are client libraries in different programming languages which make it easy for developers to write effective test cases in a programming language in which they are comfortable & have expertise with. Since version 2.25.0, RC has support for Java, C#, Python, Perl, Ruby, etc.

Selenium Server is the core component of the Selenium RC. Some of the core features/responsibilities of the Selenium RC are below

  • Contains the core Selenium Framework and it is mainly responsible for injecting the same in the browser (Chrome, Firefox, Internet Explorer, Microsoft Edge, etc.).
  • The client program sends commands to the RC which are then interpreted by the server and then sent to the browser.
  • After execution, the results are sent back to the client.
  • The Client & Server communicate via the normal mechanism of HTTP GETS and POSTs. Which is well versed with client-server concepts can manage to write test code with Selenium & WebDriver with ease. As mentioned earlier in our Selenium WebDriver tutorial, the Selenium RC supports different browsers, unlike Selenium IDE which is only available for Mozilla Firefox. The downside of Selenium RC is that it does not support record & playback functionality which can be vital in the automation of test cases where tasks are repetitive, especially for regression testing. Before executing the tests using Selenium RC, an instance of the Selenium RC Server should be manually invoked and that instance should be running throughout your entire test cycle.

Selenium WebDriver

The primary focus of our Selenium WebDriver tutorial. By far, we know that Selenium IDE is GUI based, where Selenium RC is a standalone Java program that will allow you to execute HTML test suites. Selenium WebDriver framework is more widely used when compared to Selenium IDE & Selenium RC. Unlike Selenium RC which is based on the client-server model, Selenium WebDriver framework is implemented through a browser-specific driver e.g. each browser will have its corresponding WebDriver application on which the automation testing would be performed.

Hence, Selenium WebDriver directly communicates with the browser due to which it does not require any separate component like the Selenium Server. It supports top programming languages helpful for a software tester namely C#, Ruby, Java, Python, Perl, etc. Before you go ahead in this Selenium WebDriver tutorial, make sure to download the Selenium WebDriver for the browser on which cross browser testing is being performed. You can download Selenium WebDriver from the links that are mentioned below:

Selenium Grid

Serial testing is fine till the time you have to test code that is confined to few browsers, operating systems, or devices. However, the testing methodology would falter once testing has to be formed in an environment that has multiple combinations. This is where Parallel testing can be extremely useful since it can accelerate the whole testing process. Parallel testing can allow you to perform a similar test case across different test configurations, simultaneously. You could also simultaneously execute different test cases in the same browser.

Up Vote Down Vote 4 Votes
Posted 5 months ago

Selenium is the set of API's which are used while performing automation testing.

Imagine you are on a mission to find 10 people in some country, what will you need to find them ?

Person's name or address or the looks, right ?

Similarly, assume there is a webpage and you want to click some buttons, write some values in the text fields, select values from the drop down and submit the page at the end.

So you need some way to find them, once you find them, you can guide the Selenium with those addresses or names and Selenium will do the job for us.

Rest of the stuff can be find on internet, like what are locators ? Which programming languages can be used with selenium ? How we can create unique locators and stuff like that.

Up Vote Down Vote 3 Votes
Posted 5 months ago