- Selenium Blogs -

Selenium Tutorial Guide for Beginners

Selenium is a popular web-based open source automation testing tool that works amazingly on different web platforms. It was started to automate the testing process for web apps, but continuous improvements and technological advancements have taken the platform to the new heights today. After mastering the tool, you will be wondering how it actually accelerates the testing process and enhances the overall process of software development.

Highlights of the Selenium Testing Tool:

  • It supports multiple web browsers, operating systems and programming languages
  • It has the capability to control various testing frameworks too.
  • Selenium automated tedious web-based administration tasks.
  • Selenium WebDriver is the most trending automation tool today that assures attractive salaries for the testing professionals.

If you are new to the Selenium WebDriver then your search ends here. In this tutorial, we have covered all the basics that are used in day-to-day activity while working on the Selenium WebDriver tool. This tool is based on top programming languages, Java and C#, so if you know the basics of these languages then understanding WebDriver tool would be easier for you. This Selenium WebDriver tutorial is designed for the beginner with little or no experience in the automation world. If you are new to the testing world, then I strongly recommend you to start with Software testing, training program first then switch to Selenium testing tutorial. Here are some Prerequisites or installations you should know-

  • Download and Install Java 8 (You'll need to have Java 8 to use Selenium 3)
  • Download IDE / Editor (To Create and run your tests)
  • Download Selenium WebDriver

Before you jump directly into writing your first test script in Java, you should know about the Selenium basics first. Let’s discuss Selenium testing tutorial first, then we will jump to Selenium WebDriver Tutorial later.

Read: How to Download and Install Selenium IDE in Firefox?

Selenium Tutorial Guide for Beginners

Selenium is available in two popular forms – First is Selenium IDE and the other is Selenium WebDriver. Selenium IDE is a platform that aids in producing test scripts to automate the testing process. The IDE helps in the quick fixing of bugs without putting much pressure on the developers. At the same time, WebDriver is a tool that helps in scaling and distributing scripts across multiple web browsers and it helps in creating web-based automation scripts too. Selenium Testing WebDriver Tutorial for the Beginners

Introduction of Selenium WebDriver

Selenium WebDriver was designed with an objective to give better support for dynamic web-pages where certain element keeps on changing frequently without reloading the complete web page. As of today, Selenium WebDriver has compatible with almost all browsers existed in the web industry and gives wonderful support in automating test scripts on browsers. Read More: Selenium Interview Questions and Answers Additionally, how to set up projects in Selenium WebDriver completely depends on both the programming language and the programming environment. You can work with different programming languages in Selenium WebDriver like Ruby, Python, C#, Java, JavaScript, PERL, and PHP, etc. Once you set up the project in any of the programming languages then WebDriver starts responding like a normal library. This is a self-contained library that doesn’t require any additional processes to run the installers.

Introduction of Selenium IDE

Selenium IDE is a framework that helps developers in writing or developing test cases to make the script learning easy. This is a Firefox Plug-in that helps in creating, loading, recording, and editing test cases.

Read: Selenium & QTP Compared- What should you Know?

Setting up test cases in Selenium IDE

Selenium Testing WebDriver Tutorial for the Beginners How to record a test case depends on your interaction with the website. Based on your action, the record button will add commands to the web page. The record button is open by default in Selenium IDE but you can turn it off in the MENU bar options. Few of the commands inserted by the record button include click the link, check radio buttons, enter values etc. The test case verification enables you to verify the properties of a web page with “Assert” and “verify” commands. There are multiple options under Assert” and “verify” commands in the context menu. This is quite simple to decide on the parameters you need to use to verify the web page. You can edit a test case by adding commands manually. You just have to select the point where you are interested in adding the commands and select the option Insert command. Yes, you can also add the comments to the script to increase its overall readability and usability.

Running a test Case in Selenium IDE

In the earlier section, we just discussed the concept of how to set up a test case. Now, we will check how to run a test case in Selenium IDE. Here is step by step instruction to help you with the concept and running a test case successfully.

  • Run Test Cases – For this purpose, simply click on the option “RUN” to start with currently displayed test cases. In Selenium IDE, you can run test cases with a base URL for different domains. We will advise you to use relative URL not base URL every time you open a new test case.
  • Run Test Suites–Here, you have to select the option “Run All” to start with the test suites loaded recently.
  • Pause Test cases - For this purpose, simply click on the option “Pause” to stop currently running test cases.
  • Set breakpoints in middle – Setting breakpoints in middle is easy where you can stop the running test cases at specific point whenever required. For this purpose, you have to choose the command “Toggle Breakpoint” in the Context Menu.
  • Running test cases from the middle – As we have discussed earlier, it is possible to pause test cases at a certain point. In the same way, it is possible to run the test case from the middle. For this purpose, you need to choose the command “set start point” in the Context Menu.
  • How to test any single command – For this purpose, you need to double-click on that particular command and you can modify the same as per your requirements.
  • Defining a test suite in Selenium IDE –As we know, the test suite is a simple collection of test cases that are running in batch continuously. To define all these test cases together to make a test suite, you can simply use an HTML file and write all the test cases there. Every row in the HTML file will include the path to the test case you wanted to use inside the suite. Here, the path should be defined clearly otherwise it will give an error at the end.

This is all about Selenium basics for beginners. There are plenty of styles to use this wonderful automation tool to improve your overall testing strategies. There are many advanced concepts too but this tutorial mainly focused on basic concepts that can help beginners to start in a particular direction. Further, we will have a quick tour on Selenium WebDriver and how it can be used by software testing professionals.

Read: Top 30 Frequently asked Selenium Interview Questions and Answers

Selenium WebDriver 3.0 Basics

Selenium WebDriver was designed with an objective to give better support for dynamic web-pages where certain element keeps on changing frequently without reloading the complete web page. As of today, Selenium WebDriver is compatible with almost all browsers exist in the web industry and gives wonderful support in automating test scripts on browsers. Read More: QA Testing Interview Questions and Answers As you know, there are plenty of web browsers available in the market today like Mozilla, Firefox, Internet Explorers, Chrome, Safari etc. We have named few popular web browsers here that used to execute test cases frequently. Being a testing professional, you have to decide on a web browser first, then start executing test cases on the same. Each web browser is designed differently, so rules for running test cases on each browser are also different. Few Selenium tools are not compatible with all the web browsers. So, you have to be extra careful when deciding on the web browser to work with Selenium WebDriver. For example, if you want to run test cases on Firefox with Selenium WebDriver 3.0 then you need to install a few drivers first to start with your working. You can choose other web browsers tool, as per your convenience. Here is a quick syntax to run WebDriver 3.0 on Firefox browser – Selenium Testing WebDriver Tutorial for the Beginners Now you are ready to start with Selenium WebDriver 3.0 on different web browsers. You can also use Eclipse as your IDE. Here is a brief explanation how to use Selenium WebDriver with Eclipse IDE.

How to use Selenium WebDriver with Eclipse IDE?

To start scripting with Eclipse IDE, you need to download JDK first and install the latest version of Java as recommended. The next step is to download Eclipse and install it on your computer system. Make sure that you have checked out all the permissions carefully. Now open Eclipse and check either Java is installed successfully or not. For this purpose, you have to select options Windows -> Preference options. If you want to check the current Java version installed on your system, you can check it through command prompt by using the command “java version”. Once you are completed with all the formalities, this is the right time to start your scripting on Eclipse editor. That’s all for the day! We hope you enjoyed learning Selenium WebDriver Tutorials for the beginners. However, the tutorial covers basic concepts only. We strongly recommend you to join the selenium testing, the training program at JanBask to learn about advanced concepts for quick progression in your career. All the Best for a trailblazing testing career in top Software industries with JanBask training and certification programs! Start with favorite course or training program with us today.

Read: What is Actions Class in Selenium and How to use it?

    Janbask Training

    JanBask Training is a leading Global Online Training Provider through Live Sessions. The Live classes provide a blended approach of hands on experience along with theoretical knowledge which is driven by certified professionals.


Trending Courses

AWS

  • AWS & Fundamentals of Linux
  • Amazon Simple Storage Service
  • Elastic Compute Cloud
  • Databases Overview & Amazon Route 53

Upcoming Class

3 days 22 Oct 2019

DevOps

  • Intro to DevOps
  • GIT and Maven
  • Jenkins & Ansible
  • Docker and Cloud Computing

Upcoming Class

7 days 26 Oct 2019

Data Science

  • Data Science Introduction
  • Hadoop and Spark Overview
  • Python & Intro to R Programming
  • Machine Learning

Upcoming Class

7 days 26 Oct 2019

Hadoop

  • Architecture, HDFS & MapReduce
  • Unix Shell & Apache Pig Installation
  • HIVE Installation & User-Defined Functions
  • SQOOP & Hbase Installation

Upcoming Class

8 days 27 Oct 2019

Salesforce

  • Salesforce Configuration Introduction
  • Security & Automation Process
  • Sales & Service Cloud
  • Apex Programming, SOQL & SOSL

Upcoming Class

6 days 25 Oct 2019

QA

  • Introduction and Software Testing
  • Software Test Life Cycle
  • Automation Testing and API Testing
  • Setup Selenium for UI Automation

Upcoming Class

15 days 03 Nov 2019

Business Analyst

  • BA & Stakeholders Overview
  • BPMN, Requirement Elicitation
  • BA Tools & Design Documents
  • Enterprise Analysis, Agile & Scrum

Upcoming Class

5 days 24 Oct 2019

SQL Server

  • Introduction & Database Query
  • Programming, Indexes & System Functions
  • SSIS Package Development Procedures
  • SSRS Report Design

Upcoming Class

10 days 29 Oct 2019

Comments

Search Posts

Reset

Receive Latest Materials and Offers on Selenium Course

Interviews