Selenium Interview questions

Selenium Interview questions

Selenium is a software – testing tool that is mainly used for web applications. Many organization prefers Selenium over others because of its flawless user experience. Some of the other benefits of Selenium include its flexibility and the wide range of programming languages and operating systems that can be incorporated with its use. Therefore, the use of the Selenium tool has increased a high level of job opportunities.

Organization are in search of candidates who have a well-versed knowledge and experience with this tool and can help in the progress of the organization. In order to succeed in this field, it is very important to have excellent interpersonal abilities along with good technical skills. Having a good knowledge of different programming languages such as Java, C# also gives one an added advantage. In order to find the right candidate companies ask a diverse range of Selenium interview questions to not only freshers but also to experienced individuals wishing to make a great career in this field. Here are some important Selenium interview questions that will not only give you a basic idea of the field but also help to clear the interview.

Download Selenium Interview questions PDF

Below are the list of Best Selenium Interview questions and Answers

The maximum command can be used in the Java Selenium to maximize the browser window in the initial phases.

For minimizing the browser, we can use the setPosition command and set a new point to minimize the window in the browser.
driver.manage().window().setPosition(new Point(0, -1000));

Selenium Could be Utilized for the purposeful, Regression, load testing of the Internet-based program. The Automation Tool may be executed for post release validation with continuous integration tools like Jenkins, Hudson, Speedy Build or Cruise Control.
Selenium is open-source software, released under the Apache 2.0 license and can be downloaded and used without charge.
Selenium Can be Downloaded and Installed for free-form
Selenium IDE is A Firefox add-on that records clicks, typing, and other activities to make a test instance, which QA Tester can play-back in the Firefox Browser or Export to Selenium RC. Selenium IDE has the Following attributes record/play feature, debugging with step-by-stage and breakpoints, web pages abstraction performance, an extensibility capacity enabling the utilization of addons or person extensions that expand the functionality of Selenium IDE.
Selenium IDE has several great features and is a profitable and well-organized test automation application for building check circumstances, in the same time Selenium IDE is missing certain vital characteristics of a testing program: conditional statements, loops, logging performance, exception handling, reporting performance, database screening, re-execution of failed tests and screenshots shooting capability. Selenium IDE doesn’t for IE, Safari and Opera browsers.
Selenium Remote Control (RC) is the strong solution for check cases that need more than simple browser actions and linear execution. Selenium-Remote Control lets the developing of complex test scenarios.
The internet programs could be created in Java, Ruby, PHP, Python or some other web framework. There are definite advantages for using exactly the same language for creating test instances as program under evaluation. As an example, in the event the team already possess the experience with Java, QA Tester could consistently get the bit of guidance while mastering Selenium test instances in Java. Occasionally it is best to select more straightforward programming language that can ultimately provide better success. In this situation QA examiners can embrace simpler programming languages, for instance Ruby, considerably quicker comparing with Java, and will become become specialists when you possibly can.

Selenium IDE is the simplest and easiest of all of the software inside the Selenium Program. Its record and playback feature make it extremely simple to understand with minimal acquaintances to any programing language. Selenium IDE is an ideal tool to get a nave person.

Selenese is the language that will be used to write test scripts in Selenium IDE.

Locator might be known as a tackle that identifies an internet component uniquely within the web page. Hence, to identify internet elements correctly and exactly we’ve got different types of locators in Selenium:

  • ID
  • ClassName
  • Name
  • TagName
  • link text
  • PartialLinkText
  • Xpath
  • CSS Selector
  • DOM
  • Selenium is free and open source
  • It has a big user base and assisting communities
  • Cross Browser compatibility (Firefox, chrome, Ie, Safari etc.)
  • Have amazing platform compatibility (Windows, Mac OS, Linux etc.)
  • Supports numerous programming languages (Java, C#, Ruby, Python, Pearl etc.)
  • Has clean and regular repository developments
  • Supports dispersed testing
Selenium is one of the most used automated testing packages. Selenium was made in a way to to guide and inspire automation testing of practical aspects of web based applications and also a wide array of browsers and platforms. Because of its being in the open source community, it has become among the very most accepted tools amongst the screening specialists.Selenium is not only one tool or a utility, rather a program of several testing resources and for the same reason it’s called a Suite. Every one of these programs is designed to cater different testing and evaluation environment conditions.

The suite package makes up of the following sets of resources:

  • Selenium Integrated Development Environment (IDE) Selenium IDE is a record and playback application. It is distributed as a Firefox Plugin.
  • Selenium Remote Control (RC) Selenium RC is a host that allows user to create test scripts in a desired programming language. In addition, it enables executing test scripts inside the big spectrum of browsers.
  • Selenium WebDriver WebDriver is not the same instrument totally that has numerous advantages over
  • Selenium RC. WebDriver immediately communicates with all the browser and uses its native compatibility to automate.
  • Selenium Grid Selenium Grid is utilized to distribute your test execution on several platforms and environments concurrently.
Selenium supports the following varieties of testing:
  • Functional Testing
  • Regression Testing
Following are the constraints of Selenium:
  • Selenium supports testing of only internet based applications
  • Cellular applications cannot be examined using Selenium
  • Captcha and bar-code readers are unable to be analyzed using Selenium
  • Reports can only be generated using third party resources like TestNG or Junit.
  • As Selenium is a totally free program, so there’s no ready seller support although the user can locate numerous helping communities.
  • User is anticipated to possess previous programming language information.
Selenium testing suite is highly adaptable. There are numerous ways to incorporate functionality to Selenium framework to customize test automation. As compared to other test automation tools, it is Seleniums most powerful feature. Selenium Remote Control assistance for several programming and script languages allows the test automation engineer to construct any logic they want in their automated testing and to work with a favored programming or scripting language of one’s choice. Also, the Selenium testing package is an open source project where code can be modified and enhancements can be submitted for contribution.
Selenium is essentially used for the functional testing of web based programs. It can be utilized for screening in the continuous integration environment. It really is also useful for agile testing.
Selenium test suite a set of open-source software tool, it’s free of price.
Only web applications can be testing using Selenium testing package. Nonetheless, QTP can be used for testing client-server programs. Selenium supports following browsers: Ie, Firefox, Safari, Opera or Konqueror on Windows, Macos X, and Linux. However, QTP is restricted to Internet Explorer on Windows. QTP utilizes scripting language implemented on top of VB Script. Nevertheless, the Selenium test suite has the flexibility to use many languages like Java, .Net, Perl, PHP, Python, and Ruby.
Selenium is completely free test automation tool, while Silk Test is not. Only web applications can be analyzed using Selenium testing suite. However, Silk Test can be utilized for testing client-server programs. Selenium supports following browsers: Internet Explorer, Firefox, Safari, Opera or Konqueror on Windows, Mac OS X, and Linux. Yet, Silk Test is limited to Ie and Firefox. Silk Check uses 4Test scripting language. Yet, Selenium test-suite has the flexibility to use many languages like Java,.Net, Perl, PHP, Python, and Ruby.
Selenium 3.0 is the latest version of Selenium. It has released 2 beta versions of selenium 3.0 with few of the below changes:

Selenium Interview questions

Beta 1 updatesBeta 2 updates (Only for Java)
Minimum Java version is now 8+System property webdriver.firefox.marionette now forces the server in marionette or legacy firefox driver mode, ignoring any related Desired Capability
It will support for Firefox Via Mozilla’s geckodriverGrid fixes NPE’s on registration when -browser not specified
Support for Edge is provided by MS
It now supports Safari on MacOS via Apple’s own Safari driver
Update GeckoDriver –port argument in all bindings

Test Automation/ Automation testing is a procedure that is used for the manual testing of different applications or systems. It consists of the creation of separate test tools that can be executed repeatedly without any manual intervention.

Some advantages of Test Automation include:

  • It saves money and time
  • It helps in the execution of unattended tasks
  • Helps in testing large matrixes composed of different tests
  • Supports the execution of test cases that occur repeatedly
  • It also helps in parallel execution of tasks
  • Helps in improving accuracy thus reducing human-generated mistakes

Selenium is a popular automated testing tool that is designed in such a manner that it encourages and supports multiple functions in relation to automation testing. It helps a browser to mimic real user actions that are taking place on the web.

There are a number of advantages of using Selenium as a test tool, some of which include:

  • It is an open-source that is free and user-friendly.
  • It has a large user base that helps different communities.
  • It has a large range of browser compatibility such as Chrome, Safari, Firefox, Internet Explorer, etc.
  • It supports a multitude of programming languages such as C#, Java, Python, etc.
  • A number of operating systems such as Windows, Linux Mac OS, etc. can also use it.
  • Distribution testing is also supported by Selenium.
  • It has regular repository developments.

The limitations of using Selenium as a test tool are:

  • It does not allow the testing of Windows applications.
  • It does not allow the testing of mobile applications.
  • There is difficulty in the loading of pages.
  • There arise problems in handling popup windows and captcha.
  • It has limited reporting options.
  • There can also be trouble in handling different dynamic elements.

Every object on a web page is termed as element while using Selenium as a tool. Different methodologies to find such elements include:

  • Xpath
  • PartialLink Text
  • Attribute
  • CSS
  • Tag
  • Link text
  • ID
  • Name

The different components of Selenium are:

  • Selenium Integrated Development Environment (IDE) – Selenium IDE is an essential record and playback component that is primarily distributed by Firefox Plugin.
  • Selenium Web driver – Selenium Web driver is a tool that helps in direct communication with the web browser.
  • Selenium Grid – Selenium Grid is utilized to distribute the test that is executed on multiple platforms and different environments synchronously.
  • Selenium Remote Control (RC) – Selenium RC is a service, which allows its users to create test scripts within the desired programming language and also the execution of the same with a large range of browsers.

Also, Read Selenium Web driver Interview Questions

A framework is a set of rules and best practices that are followed in a systematic way in order to achieve the desired outcomes. Some of the common automation frameworks available to users are:

  • Hybrid Testing Framework
  • Data Driven Testing Framework
  • Keyword Driven Testing Framework

Different testing types essentially supported by Selenium are:

  • Regression Testing
  • Functional Testing

XPath is a tool used to locate different web elements that are based on the XML path. XML is an acronym for Extensible Markup Language that helps its users to organize, store and transport various random data. It stores data in value pairs that are similar to HTML tags. XPath helps users to locate different elements by transferring across the entire page and finding the element with the reference of another element.

Different types of drivers available in Web Drivers are:

  • HTMLUnit Driver
  • Android Driver
  • iPhone Driver
  • Safari Driver
  • Chrome Driver
  • InternetExplorer Driver
  • Firefox Driver
  • Opera Driver
  • EventFiringWebDriver

Some of the advantages of Selenium Grid include:

  • It helps in running different test cases in parallel, therefore, saving execution time.
  • It helps in the testing of multiple browsers.
  • It also helps in the execution of different test cases on multiple platforms.

Some of the programming languages supported by Selenium WebDriver are:

  • Java.
  • C#
  • PHP
  • Ruby
  • Python

Some of the operating systems supported by Selenium WebDriver are:

  • MAC
  • Windows
  • Linux

‘/’ – Single Slash is utilized in order to create XPath with an absolute path. Single Slash is used to create a start selection only from the start node or document node.

‘//’ – Double Slash is utilized in order to create XPath with a relative path. Double Slash is used to create a start selection from anywhere inside the document.

Major differences between Protractor and Selenium are as follows:

Selenium WebDriverProtractor
You can automate the web applications using the selenium WebDriver with Java or any programming language of choice.Prefer Protractor when you are not comfortable with handling the ajax and angular waits using fluent wait in Selenium.
The languages supported by Selenium are Java, Python Kotlin, C, C#, PHP.All js related languages are supported by Protractor. Ex: TypeScript and JavaScript.
Supports many frameworks of unit testing, such as TestNg and Junit.Protractor works well with Jasmine and Mocha frameworks.
You need a lesser number of code lines for testing with Selenium.Code length is longer when you use Protractor because all of the fetch operation return promises, so you have to solve the promises first.
Selenium’s performance is faster for a non-Angular web application.When working with Angular applications, the protractor offers faster performance.
It is open-source software.It is also open-source software.
Enough options for locators.Lesser option for locators.
Debugging is easy owing to Java-based design.Debugging needs expertise and time-consuming.
Technical skills mandatory to work with this tool are Java and TestNG.One needs to know JavaScript and Node.js to work with Protractor.
Licensed under Eclipse.Licensed under Webstorm7.0.
The framework is proven and widely used.The framework is budding and harder comparatively.
Compatible with Windows and Linux.This is also compatible with Windows and Linux.
Works well with Angular pages too; however, page synchronization issues may crop up.Designed specifically for Angular pages and works with non-angular too without any issues.
Proven, widely used for automation, well-extended support, and stable API.New entrée in the market and needs the expertise to work with.
You can work in popular programming languages such as Python, Ruby, Java, Perl, C, and C##.Available only for JavaScript.
Offers comprehensive support for all sorts of testing needs for web applications.This is just a wrapper developed over WebDriver JS. No new verticals for browser automation are developed as such.
Cannot trace and work with angular directives in a code.Rich in angular specific locator strategy and can work comfortably with locators.

There is an essential role Web elements play when an application is tested. Identifying the location of these Web elements on the website is the first thing to do. To carry out a regression test or to load data automatically on a website, selenium is used. One of the ways of finding these elements is the find element command.

The find element command identifies one Web element while find elements identify multiple Web elements on the web page. The Link Text, Tag Name, Partial Link, Class Name, XPATH, ID are some of the ways to find elements or element on a web page.

A sendkeys()  in selenium permits QAs to enter content into a field that can be edited automatically. The automatic typing of the content into an editable field is done when any tests are executed for forms. These editable fields are easily identified on a web page by making use of locators such as name, link, id, class name, and others. Assume a case after a web developer has developed a website and the functionality of the website needs to be tested. This is where we see the works of QAs. The QAs make use of selenium WebDriver to write test scripts to repeat the actions of a user on a web browser such as google chrome.

Implicit wait in Selenium directs WebDriver to pause for a certain duration of time before throwing an exception. Once this time is estimated, WebDriver will wait for the item before the exception occurs.

Once the command is in position, Implicit Wait waits in place for the whole duration for which the browser is accessible and it is default setting is 0, and the particular wait time needs to be set by the protocol. To calculate implicit waits in test scripts, import the package, import java.util.concurrent.TimeUnit;

There are distinct ways to easily locate an element in Selenium. Some of the common ways of achieving this are through Tag name, id, class name, etc. A Class Name locator offers the web element which matches or suits the specified values in the attribute name "class". The first element that has the class attribute name that matches is returned. On the other hand, if there is no Web element that has the class attribute name that matches, a NoSuchElementException is raised.

Take a look at the code below to understand better

  <p class="content">website content moves here.

You can easily locate the "p" element by:

Web content = driver.find_element_by_class_name('content')