Test Automation with Selenium? Start here!

Let’s quickly go over a few basics. What is Selenium?
Selenium is an open source, cross-operating system, cross-browser, cross-platform tool for automating actions carried out on the web browsers. It’s used for automated testing but it can also be used for automating actions on the browser other than testing.

  • Test scripts can be written in many programming languages such as C#, JavaPython,  JavaScriptRubyPerl, PHP
  • Tests/Actions can be carried out in any operating system: WindowsMac or Unix
  • Tests can be carried out using any browser: Mozilla FirefoxInternet ExplorerGoogle ChromeSafari or Opera
  • It can be integrated with tools such as TestNG & JUnit for managing test cases and generating reports
  • It can be integrated with MavenJenkins & Docker to achieve Continuous Testing

To develop automated tests using Selenium first, you need to prepare the necessary infrastructure.

The key elements of this infrastructure are determined by how the selenium tool is integrated with browsers.

  1. Browser(s).

    First, you need to have browsers installed, Selenium does not contain browsers, it uses browsers that are already installed on the system. Chrome, Firefox, Internet Explorer most common browsers that we are going to use in this documentation.

  2. Browser Drivers

    Secondly, for each browser you need an additional auxiliary executable file, for Chrome – chromedriver, for Firefox geckodriver, for Internet Explorer – IEDriverServer and so on.
    It is useful to download all the drivers and put them in a separate folder for ease of access. For example, C:\Tools
    Download browser drivers on Selenium HQ website at https://www.seleniumhq.org/download/

  3. Language-specific Client Libraries

    Thirdly, in order to create tests in a specific programming language, we need a client library for that language that will connect to auxiliary executable files and control the browser through them. Each programming language has its own client library.
    In this tutorial, we will be creating scripts using C#, Java, and Python. Language-specific libraries for these languages can be downloaded at https://www.seleniumhq.org/download/

    Please see tutorials for each language which will provide details regarding the installation of Language-specific libraries.

    NOTE: Each programming language, usually has a standard package repository to distribute libraries, and client libraries for Selenium are distributed through these standard package repositories.

    For example, in Visual Studio, C# Selenium libraries are distributed through NuGet Package Manager.

    Select Installation Packages
  4. Interpreter or compiler for your language.

    • Java
    • Install .NET for C# (Installing Visual Studio should take care for installing all the necessary files)
    • Install Python
  5. Integrated Development Environment (IDE)

    • Visual Studio for C#
      Eclipse or IntelliJ IDEA for Java/Python/JavaScript/Ruby
  6. Language compiler and dependencies manager

  7. Test Framework

    The Test Framework will allow test execution and result generation.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.