LambdaTest Community

Find answers, support, and inspiration from other users

Questions 2
LambdaTest Community

What are the basics of Selenium testing?

Can anyone please tell me the basics of selenium testing.

Up Vote Down Vote 0 Votes
Posted 3 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

  1. Selenium Integrated Development Environment (IDE)
  2. Selenium Remote Control (RC)
  3. Selenium WebDriver
  4. 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[1] 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 0 Votes
Posted 3 months ago

Selenium is used for both web and mobile applications and it is having web drivers for web applications.

Benefits of selenium testing:

  • Platform Portability
  • Open Source Advantage
  • Flexibility and efficiency
  • Language Support

Steps to automate your test with Selenium:

  1. Create a WebDriver instance.
  2. Navigate to a Web page.
  3. Locate an HTML element on the Web page.
  4. Perform an action on an HTML element.
  5. Anticipate the browser response to the action.
  6. Run tests and record test results using a test framework.
  7. Conclude the test.

You can use a platform like QAppAssure which allows you to test on-cloud and on-field devices, across 100+ device, make and models, Integrate with Jira, CI/CD tools, and also use Appium, Calabash, Espresso, UIAutomator, XCUITest.

Up Vote Down Vote 0 Votes
Posted one month ago