Skip to main content

Selenium Interview Questions Set 1

Complete Selenium Topics PDF Link 

 

Q: What is Automation Testing?

A: Automation testing or Test Automation is a process of automating the manual process to test the application/system under test. Automation testing involves use to a separate testing tool which lets you create test scripts which can be executed repeatedly and doesn’t require any manual intervention.

Q: What are the benefits of Automation Testing?

A: Benefits of Automation testing are:

· Supports execution of repeated test cases

· Aids in testing a large test matrix

· Enables parallel execution

· Encourages unattended execution

· Improves accuracy thereby reducing human generated errors

· Saves time and money

 

Q: Why should Selenium be selected as a test tool?

A: 

· Selenium is free and open source

· have a large user base and helping communities

· have cross Browser compatibility (Firefox, chrome, Internet Explorer, Safari etc.)

· have great platform compatibility (Windows, Mac OS, Linux etc.)

· supports multiple programming languages (Java, C#, Ruby, Python, Pearl etc.)

· has fresh and regular repository developments

· supports distributed testing

 

Q: What is Selenium? What are the different Selenium components?

A: Selenium is one of the most popular automated testing suites. Selenium is designed in a way to support and encourage automation testing of functional aspects of web based applications and a wide range of browsers and platforms. Due to its existence in the open source community, it has become one of the most accepted tools amongst the testing professionals.

Selenium is not just a single tool or a utility, rather a package of several testing tools and for the same reason it is referred to as a Suite. Each of these tools is designed to cater different testing and test environment requirements.

The suite package constitutes of the following sets of tools:

Selenium Integrated Development Environment (IDE) – Selenium IDE is a record and playback tool. It is distributed as a Firefox Plugin.

Selenium Remote Control (RC) – Selenium RC is a server that allows user to create test scripts in a desired programming language. It also allows executing test scripts within the large spectrum of browsers.

Selenium WebDriver – WebDriver is a different tool altogether that has various advantages over Selenium RC. WebDriver directly communicates with the web browser and uses its native compatibility to automate.

Selenium Grid – Selenium Grid is used to distribute your test execution on multiple platforms and environments concurrently.

 

Q: What are the testing types that can be supported by Selenium?

A: Selenium supports the following types of testing:

·         Functional Testing

·         Regression Testing

 

Q: What are the limitations of Selenium?

A: Following are the limitations of Selenium:

Selenium supports testing of only web based applications

Mobile applications cannot be tested using Selenium

Captcha and Bar code readers cannot be tested using Selenium

Reports can only be generated using third party tools like TestNG or Junit.

As Selenium is a free tool, thus there is no ready vendor support though the user can find numerous helping communities.

User is expected to possess prior programming language knowledge.

 

Q: When should I use Selenium IDE?

A: Selenium IDE is the simplest and easiest of all the tools within the Selenium Package. Its record and playback feature makes it exceptionally easy to learn with minimal acquaintances to any programming language. Selenium IDE is an ideal tool for a naïve user.

 

Q: What is Selenese?

A: Selenese is the language which is used to write test scripts in Selenium IDE.

 

Q: What are the different types of locators in Selenium?

A: Locator can be termed as an address that identifies a web element uniquely within the webpage. Thus, to identify web elements accurately and precisely we have different types of locators in Selenium:

ID

ClassName

Name

TagName

LinkText

PartialLinkText

Xpath

CSS Selector

DOM

 

Q: What is difference between assert and verify commands?

A: Assert: Assert command checks whether the given condition is true or false. Let’s say we assert whether the given element is present on the web page or not. If the condition is true then the program control will execute the next test step but if the condition is false, the execution would stop and no further test would be executed.

 

Verify: Verify command also checks whether the given condition is true or false. Irrespective of the condition being true or false, the program execution doesn’t halts i.e. any failure during verification would not stop the execution and all the test steps would be executed.

 

Q: What is an Xpath?

A: Xpath is used to locate a web element based on its XML path. XML stands for Extensible Markup Language and is used to store, organize and transport arbitrary data. It stores data in a key-value pair which is very much similar to HTML tags. Both being markup languages and since they fall under the same umbrella, Xpath can be used to locate HTML elements.

The fundamental behind locating elements using Xpath is the traversing between various elements across the entire page and thus enabling a user to find an element with the reference of another element.

 

Q: What is the difference between “/” and “//” in Xpath?

A: Single Slash “/” – Single slash is used to create Xpath with absolute path i.e. the xpath would be created to start selection from the document node/start node.

Double Slash “//” - Double slash is used to create Xpath with relative path i.e. the xpath would be created to start selection from anywhere within the document.

 

Q: What is Same origin policy and how it can be handled?

A: The problem of same origin policy disallows to access the DOM of a document from an origin that is different from the origin we are trying to access the document.

Origin is a sequential combination of scheme, host and port of the URL. For example, for a URL http:// http://www.softwaretestinghelp.com/resources/, the origin is a combination of http, softwaretestinghelp.com, 80 correspondingly.

Thus the Selenium Core (JavaScript Program) cannot access the elements from an origin that is different from where it was launched. For Example, if I have launched the JavaScript Program from “http://www.softwaretestinghelp.com”, then I would be able to access the pages within the same domain such as “http://www.softwaretestinghelp.com/resources” or “http://www.softwaretestinghelp.com/istqb-free-updates/”. The other domains like google.com, seleniumhq.org would no more be accessible.

So, In order to handle same origin policy, Selenium Remote Control was introduced.

 

Q: When should I use Selenium Grid?

A: Selenium Grid can be used to execute same or different test scripts on multiple platforms and browsers concurrently so as to achieve distributed test execution, testing under different environments and saving execution time remarkably.

 

Q: What do we mean by Selenium 1 and Selenium 2?

A: Selenium RC and WebDriver, in a combination are popularly known as Selenium 2. Selenium RC alone is also referred as Selenium 1.

 

Q: Which is the latest Selenium tool?

A: WebDriver

 

Q: How do I launch the browser using WebDriver?

A: The following syntax can be used to launch Browser:

WebDriver driver = new FirefoxDriver();

WebDriver driver = new ChromeDriver();

WebDriver driver = new InternetExplorerDriver();

 

Q: What are the different types of Drivers available in WebDriver?

A: The different drivers available in WebDriver are:

FirefoxDriver

InternetExplorerDriver

ChromeDriver

SafariDriver

OperaDriver

AndroidDriver

IPhoneDriver

HtmlUnitDriver

 

Q: What are the different types of waits available in WebDriver?

A: There are two types of waits available in WebDriver:

Implicit Wait

Explicit Wait

Implicit Wait: Implicit waits are used to provide a default waiting time (say 30 seconds) between each consecutive test step/command across the entire test script. Thus, subsequent test step would only execute when the 30 seconds have elapsed after executing the previous test step/command.

Explicit Wait: Explicit waits are used to halt the execution till the time a particular condition is met or the maximum time has elapsed. Unlike Implicit waits, explicit waits are applied for a particular instance only.

 

Q: How to type in a textbox using Selenium?

A: User can use sendKeys(“String to be entered”) to enter the string in the textbox.

Syntax:

WebElement username = drv.findElement(By.id(“Email”));

// entering username

username.sendKeys(“sth”);

 

Q: How can you find if an element in displayed on the screen?

A: WebDriver facilitates the user with the following methods to check the visibility of the web elements. These web elements can be buttons, drop boxes, checkboxes, radio buttons, labels etc.

isDisplayed()

isSelected()

isEnabled()

Syntax:

isDisplayed():

boolean buttonPresence = driver.findElement(By.id(“gbqfba”)).isDisplayed();

isSelected():

boolean buttonSelected = driver.findElement(By.id(“gbqfba”)).isDisplayed();

isEnabled():

boolean searchIconEnabled = driver.findElement(By.id(“gbqfb”)).isEnabled();


Comments

Popular posts from this blog

Choosing Software Testing as a Career -- Complete Guide

Complete Guide: What is Software Testing? Why Software Testing? Types of Software Testing Careers Software Tester Skills Manual Testing Manual Testing Skill Set Manual Testing Payscale in India Automation Testing Automation Testing Tools List Automation Tester Skill Set Automation Tester Career Path Automation Tester Job Opportunities Read Here:  Why Choose Software Testing as your Career?  You may also Like: Simple Tips to be the Best Automation Tester Top 3 Common Mistakes Testers Make - Solutions How to be the Big Boss of Selenium Automation

Important Update from the National Software Testing Conference 2018..!

Hello friends, Happy to see you all after a gap! This time I came with an important & interesting information regarding Software Testing…! Here is the Kicker; Here I have listed down the latest update in software testing which every software testers must know about. Automation Testing Market – Forecast 2025 National Software Testing Conference 2018 Automation Testing Market Overview 2025 Also Read: Complete Guide to Choose Software Testing as Your Career All the information below is collected from the report of the recent National Level Software Testing Conference 2018 held in London. Automation Testing Market Report provides thorough backdrop investigation of Automation Testing business, with an evaluation of the previous years. The Automation Testing Market Reports provides data on Automation Testing patterns and improvements, and target business sectors and materials, limits and advancements.  The report broadly provides the marke

Top 4 Software Tester Job vacancies for this week - Apply Now

Hello friends, Here I have shared Top 4 Software Tester Job vacancies from Top MNCs, Please make use of it and also share with your buddies. FIS Hiring Functional Tester: Technical requirements: Essential: UNIX (User level), SQL, Testing ability, Office software, Shell scripting.Desirable Perl, C, Informix, XML, J2EE, Websphere (deployment), Mastercard/Visa/card payments knowledge, Software development lifecycle Apply Now TCS Hiring Software Testers: Education : Any Graduate / Post Graduate Shifts : Flexible in any shifts    Job Function:  IT INFRASTRUCTURE SERVICES Role: Analyst Job Id: 118845 Desired Skills Manual Testing | Selenium Apply Now Amazon Hiring Software Test Engineer: BASIC QUALIFICATIONS Bachelor’s degree in Computer Science, Computer Engineering or related technical field 4+ years of experience in software development and testing in Java, C++ or C# Computer Science fundamentals in data structures