Testing Interview Questions And Answers

0% Interest education Loan, Hurry up!!! Loan facility valid till 16 next seats.

Selenium is an elegant and type-safe object-oriented language that enables testers to build a variety of secure and robust applications that run on the Java Framework. You can use selenium to test Windows client applications, XML Web services, distributed components, client-server applications, database applications, and much, much more. Visual selenium provides an advanced code editor, convenient user interface designers, integrated debugger, and many other tools to make it easier to test applications based on the Java language and the testing Framework.:: Ref:softwaretestinghelp.com,javatpoint.com,edureka.co

testing Interview Questions and Answers

What is selenium 2.0?

Selenium 2.0 is a tool which is a combination of web testing tools Selenium RC and WebDriver.

What is Selenium 3.0?

Selenium 3.0 is the latest version of Selenium. There are 2 beta version of Selenium released with few changes in the previous versions.

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

Selenium supports the following types of testing: Functional Testing Regression Testing

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

Selenium supports the following types of testing: Functional Testing Regression Testing

What is Selenese?

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

What is Selenium IDE?

Selenium IDE is a firefox plug-in. It is used to record and replay tests in firefox browser. It is used only with firefox browser

What is Automation Testing?

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.

Which files can be used as data source for different frameworks?

Some of the file types of the dataset can be: excel, xml, text, csv, etc.

What are the benefits of Automation Testing?

enefits 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

Why should Selenium be selected as a test tool?

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 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

WhWhat are the limitations of Selenium?

Following are the limitations of Selenium: Selenium supports testing of only web-based applications Mobile applications cannot be tested using Selenium Captcha and Barcode 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. The user is expected to possess prior programming language knowledge.

What is the difference between Selenium IDE, Selenium RC and WebDriver?

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.

What are the different types of locators in Selenium?

The 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

What is Selenium? What are the different Selenium components?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 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 a user to create test scripts in the 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.

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

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.

What are the different types of Drivers available in WebDriver?

The different drivers available in WebDriver are: FirefoxDriver InternetExplorerDriver ChromeDriver SafariDriver OperaDriver AndroidDriver IPhoneDriver HtmlUnitDriver WebDriver driver = new InternetExplorerDriver();

What are the significant changes in upgrades in various Selenium versions?

Selenium v1 included only three suite of tools: Selenium IDE, Selenium RC and Selenium Grid. Note that there was no WebDriver in Selenium v1. Selenium WebDriver was introduced in Selenium v2. With the onset of WebDriver, Selenium RC got deprecated and is not in use since. Older versions of RC is available in the market though, but support for RC is not available. Currently, Selenium v3 is in use, and it comprises of IDE, WebDriver and Grid. IDE is used for recording and playback of tests, WebDriver is used for testing dynamic web applications via a programming interface and Grid is used for deploying tests in remote host machines.

What is the difference between Selenium IDE, Selenium RC and WebDriver?

Feature Selenium IDE Selenium RC WebDriver Feature Selenium IDE Selenium RC WebDriver Browser Compatibility Selenium IDE comes as a Firefox plugin, thus it supports only Firefox Selenium RC supports a varied range of versions of Mozilla Firefox, Google Chrome, Internet Explorer and Opera WebDriver supports a varied range of versions of Mozilla Firefox, Google Chrome, Internet Explorer and Opera. Also supports HtmlUnitDriver which is a GUI less or headless browser. Record and Playback Selenium IDE supports record and playback feature Selenium RC doesn't supports record and playback feature WebDriver doesn't support record and playback feature Server Requirement Selenium IDE doesn't require any server to be started before executing the test scripts Selenium RC requires server to be started before executing the test scripts WebDriver doesn't require any server to be started before executing the test scripts Architecture Selenium IDE is a Javascript based framework Selenium RC is a JavaScript based Framework WebDriver uses the browser's native compatibility to automation Object Oriented Selenium IDE is not an object oriented tool Selenium RC is semi object oriented tool WebDriver is a purely object oriented tool Dynamic Finders (for locating web elements on a webpage) Selenium IDE doesn't support dynamic finders Selenium RC doesn't support dynamic finders WebDriver supports dynamic finders Handling Alerts, Navigations, Dropdowns Selenium IDE doesn't explicitly provides aids to handle alerts, navigations, dropdowns Selenium RC doesn't explicitly provides aids to handle alerts, navigations, dropdowns WebDriver offers a wide range of utilities and classes that helps in handling alerts, navigations, and dropdowns efficiently and effectively. WAP (iPhone/Android) Testing Selenium IDE doesn't support testing of iPhone/Andriod applications Selenium RC doesn't support testing of iPhone/Andriod applications WebDriver is designed in a way to efficiently support testing of iPhone/Android applications. The tool comes with a large range of drivers for WAP based testing. For example, AndroidDriver, iPhoneDriver Listener Support Selenium IDE doesn't support listeners Selenium RC doesn't support listeners WebDriver supports the implementation of Listeners Speed Selenium IDE is fast as it is plugged in with the web-browser that launches the test. Thus, the IDE and browser communicates directly Selenium RC is slower than WebDriver as it doesn't communicates directly with the browser; rather it sends selenese commands over to Selenium Core which in turn communicates with the browser. WebDriver communicates directly with the web browsers. Thus making it much faster.

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

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.

When should I use Selenium Grid?

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.

What do we mean by Selenium 1 and Selenium 2?

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

Which is the latest Selenium tool?

WebDriver

What is the difference between assert and verify commands?

ssert: 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 halt i.e. any failure during verification would not stop the execution and all the test steps would be executed.

What are the advantages and disadvantages of Selenium over other testing tools like QTP and RFT?

The advantages of Selenium over QTP and RFT are: License: Selenium is open source, whereas HP’s QTP and IBM’s RFT are licensed software. Environment Support: Selenium supports Windows OS, Linux OS, Solaris OS X (If browser & JVM or JavaScript support exists), whereas QTP and RFT work only on Windows OS. Programming Language Support: Selenium supports Java, C#, Ruby, Python, Perl, PHP and JavaScript, whereas RFT supports only Java and C# and QTP supports only VBScript. Hardware resource consumption during script execution: Selenium consumes very less hardware resource, but QTP and RFT a lot of hardware resource. Coding experience: For Selenium, coding skills should be very good along with technical capabilities of integrating the framework, whereas coding experience and skills are not that much needed for QTP and RFT.

What is an XPath?

sXPath 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.

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

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://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.

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

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://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.

How do I launch the browser using WebDriver?

The following syntax can be used to launch Browser: WebDriver driver = new FirefoxDriver(); WebDriver driver = new ChromeDriver(); WebDriver driver = new InternetExplorerDriver();

Describe the different types of locators in Selenium?

ocator is an address which identifies a web element uniquely within the web page. There are different types of locators in Selenium to identify web elements accurately and precisely. These are: ID ClassName Name TagName LinkText PartialLinkText Xpath CSS Selector DOM

What are the different types of waits available in WebDriver?

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.

What is test automation or automation testing?

Automation testing is used to automate the manual testing. It is a process of automating the manual process to test the application/system under test. It uses separate testing tools which facilitate you to create test scripts which can be executed repeatedly and doesn't need any manual intervention.

What is test automation or automation testing?

Automation testing is used to automate the manual testing. It is a process of automating the manual process to test the application/system under test. It uses separate testing tools which facilitate you to create test scripts which can be executed repeatedly and doesn't need any manual intervention.

What are the advantages of automation testing?

It supports execution of repeated test cases. It facilitates parallel execution. It aids in testing a large test matrix. It improves accuracy because there are no chances of human errors. It saves time and money.

What is selenium? What are the different components of selenium?

Selenium is one of the most popular automated testing suites. It is browser automation tool which lets you automated operations like click, type and selection from a drop down of a web page. It is designed to support and encourage automation testing of functionalities of web based applications and a wide range of browsers and platforms. It is one of the most accepted tools amongst the testing professional due to its existence in the open source community. Selenium is not just a single tool rather than it is a package of several testing tools and that?s why it is referred as a suite. Each of these tools is designed to cater different testing and test environment requirement.

What is Selenium 1.0?

Selenium 1.0 is popularily known as Selenium Remote Control (Selenium RC). It is a library available in wide variety of languages. The main reason to use Selenium RC was that Selenium IDE was incapable to execute tests in browsers other than Selenium IDE and the limitation of language Selenese used in Selenium IDE.

What is Selenium 1.0?

Selenium 1.0 is popularily known as Selenium Remote Control (Selenium RC). It is a library available in wide variety of languages. The main reason to use Selenium RC was that Selenium IDE was incapable to execute tests in browsers other than Selenium IDE and the limitation of language Selenese used in Selenium IDE.

What is Selenium 3.0?

Selenium 3.0 is the latest version of Selenium. There are 2 beta version of Selenium released with few changes in the previous versions.A list of few new features added in Selenium 3.0: Beta 1 Updates Beta 2 Updates(Only for java) Minimum requirement is java version 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 GeckoDriver Grid fixes NPE?s on registration when -browser not specified It now supports safari on MacOS via Apple?s own safari driver Update GeckoDriver ?port argument in all bindings

Why is selenium selected as a test tool?

SSelenium is used as a testing tool because: It is free and open source. It has a large user base and helping communities. Compatible on different platforms i.e. Windows, Mac OS, Linux etc. Have cross browser compatibility (Chrome, Firefox, IE, Safari etc.) Support multiple programming languages ( Java, C#, Ruby, PERL, Python etc.) Support distributed testing.

What are selenium supporting testing types?

Selenium supports two types of testing: Functional Testing Regression Testing ac OS, Linux etc. Have cross browser compatibility (Chrome, Firefox, IE, Safari etc.) Support multiple programming languages ( Java, C#, Ruby, PERL, Python etc.) Support distributed testing.

What are the limitations of selenium?

Selenium has following limitations: It can be used only to test web based application. Mobile applications can not be tested using selenium. You can not test captcha and bar code by using selenium. The user must have the knowledge of programming language for using selenium. Reports can only be generated using third party tools like TestNG or Junit.

What is POM (Page Object Model)? What are its advantages?

Page Object Model is a design pattern for creating an Object Repository for web UI elements. Each web page in the application is required to have it’s own corresponding page class. The page class is thus responsible for finding the WebElements in that page and then perform operations on those WebElements. The advantages of using POM are: Allows us to separate operations and flows in the UI from Verification – improves code readability Since the Object Repository is independent of Test Cases, multiple tests can use the same Object Repository Reusability of code

What is Page Factory?

Page Factory gives an optimized way to implement Page Object Model. When we say it is optimized, it refers to the fact that the memory utilization is very good and also the implementation is done in an object oriented manner. Page Factory is used to initialize the elements of the Page Object or instantiate the Page Objects itself. Annotations for elements can also be created (and recommended) as the describing properties may not always be descriptive enough to differentiate one object from the other. The concept of separating the Page Object Repository and Test Methods is followed here also. Instead of having to use ‘FindElements’, we use annotations like: @FindBy to find WebElement, and initElements method to initialize web elements from the Page Factory class. @FindBy can accept tagName, partialLinkText, name, linkText, id, css, className & xpath as attributes. Since the Object Repository is independent of Test Cases, multiple tests can use the same Object Repository Reusability of code

How to handle keyboard and mouse actions using Selenium?

We can handle special keyboard and mouse events by using Advanced User Interactions API. The Advanced User Interactions API contains the Actions and the Action Classes that are needed for executing these events. Most commonly used keyboard and mouse events provided by the Actions class are in the table below: Method Description clickAndHold() Clicks (without releasing) the current mouse location. dragAndDrop() Performs click-and-hold at the location of the source element, moves. source, target() Moves to the location of the target element, then releases the mouse

What are the different types of Drivers that WebDriver contains?

These are the different drivers available in WebDriver: FirefoxDriver InternetExplorerDriver ChromeDriver SafariDriver OperaDriver AndroidDriver IPhoneDriver HtmlUnitDriver

What are the different types of Drivers that WebDriver contains?

These are the different drivers available in WebDriver: FirefoxDriver InternetExplorerDriver ChromeDriver SafariDriver OperaDriver AndroidDriver IPhoneDriver HtmlUnitDriver

What are the different types of annotations which are used in Selenium?

JUnit annotations which can be used are: Test Before After Ignore BeforeClass AfterClass RunWith

What is Selenium Grid?

Selenium Grid facilitates you to distribute your tests on multiple machines and all of them at the same time. So, you can execute tests on Internet Explorer on Windows and Safari on Mac machine using the same text script. It reduces the time of test execution and provides quick feedback. Before After Ignore BeforeClass AfterClass RunWith

Explain the different exceptions in Selenium WebDriverExceptions in Selenium are similar to exceptions in other programming languages. The most common exceptions in Selenium are: TimeoutException: This exception is thrown when a command performing an operation does not complete in the stipulated time. NoSuchElementException: This exception is thrown when an element with given attributes is not found on the web page. ElementNotVisibleException: This exception is thrown when the element is present in DOM (Document Object Model), but not visible on the web page. StaleElementException: This exception is thrown when the Explain the different exceptions in Selenium WebDriver.

Exceptions in Selenium are similar to exceptions in other programming languages. The most common exceptions in Selenium are: TimeoutException: This exception is thrown when a command performing an operation does not complete in the stipulated time. NoSuchElementException: This exception is thrown when an element with given attributes is not found on the web page. ElementNotVisibleException: This exception is thrown when the element is present in DOM (Document Object Model), but not visible on the web page. StaleElementException: This exception is thrown when the element is either deleted or no longer attached to the DOM.

What is exception test in Selenium?is not found on the web page. ElementNotVisibleException: This exception is thrown when the element is present in DOM (Document Object Model), but not visible on the web page. StaleElementException: This exception is thrown when the Explain the different exceptions in Selenium WebDriver.

An exception test is an exception that you expect will be thrown inside a test class. If you have written a test case in such way that it should throw an exception, then you can use the @Test annotation and specify which exception you will be expecting by mentioning it in the parameters. Take a look at the example below: @Test(expectedException = NoSuchElementException.class) Do note the syntax, where the exception is suffixed with .class

Why and how will you use an Excel Sheet in your project? hen the element is present in DOM (Document Object Model), but not visible on the web page. StaleElementException: This exception is thrown when the Explain the different exceptions in Selenium WebDriver.

The reason we use Excel sheets is because it can be used as data source for tests. An excel sheet can also be used to store the data set while performing DataDriven Testing. These are the two main reasons for using Excel sheets. When you use the excel sheet as data source, you can store the following: Application URL for all environments: You can specify the URL of the environment in which you want to do the testing like: development environment or testing environment or QA environment or staging environment or production/ pre-production environment. User name and password credentials of different environments: You can store the access credentials of the different applications/ environments in the excel sheet. You can store them in encoded format and whenever you want to use them, you can decode them instead of leaving it plain and unprotected. Test cases to be executed: You can list down the entire set of test cases in a column and in the next column, you can specify either Yes or No which indicates if you want that particular test case to be executed or ignored. When you use the excel sheet for DataDriven Test, you can store the data for different iterations to be performed in the tests. For example while testing a web page, the different sets of input data that needs to be passed to the test box can be stored in the excel sheet.

What are the different types of WAIT statements in Selenium WebDriver? Or the question can be framed like this: How do you achieve synchronization in WebDriver?

There are basically two types of wait statements: Implicit Wait and Explicit Wait. Implicit wait instructs the WebDriver to wait for some time by polling the DOM. Once you have declared implicit wait, it will be available for the entire life of the WebDriver instance. By default, the value will be 0. If you set a longer default, then the behavior will poll the DOM on a periodic basis depending on the browser/ driver implementation. Explicit wait instructs the execution to wait for some time until some condition is achieved. Some of those conditions to be attained are: elementToBeClickable elementToBeSelected presenceOfElementLocated

What are different types of frameworks?

The different types of frameworks are: Data Driven Framework:- When the entire test data is generated from some external files like Excel, CSV, XML or some database table, then it is called Data Driven framework. Keyword Driven Framework:- When only the instructions and operations are written in a different file like an Excel worksheet, it is called Keyword Driven framework. Hybrid Framework:- A combination of both the Data Driven framework and the Keyword Driven framework is called Hybrid framework.

What is soft assertion in Selenium? How can you mark a test case as failed by using soft assertion?

Soft Assertions are customized error handlers provided by TestNG. Soft Assertions do not throw exceptions when assertion fails, and they simply continue to the next test step. They are commonly used when we want to perform multiple assertions. To mark a test as failed with soft assertions, call assertAll() method at the end of the test.


100 % Job Guaranteed courses in Testing with 1st day offer Letter

Best Training Institute

Blend InfoTech offers methodology ensures that lessons are practical, and involve the participants, who engage in meaningful and Best Training and tasks that reflect communicative demands of IT Industry.Best Training Institute Deccan - 8087088772 | Akurdi - 8793008772 | Dange Chawk (Wakad) - 8983028772

Call NOW: 9595 772772

Register Now

Why Blend?

Blend's Benefits to Student:

  • Hands on Project Experience exposures in the Lab session
  • Real Time case studies to practice
  • Free Technical Support after Course Completion
  • Back up Classes Available
  • LAB Facility 
  • Free Wifi to learn subject
  • Latest Study Material
  • Fast Track and Normal Batches available

100% Guaranteed Placement Assistance

  • We send you for interviews till you get a job
  • We get your Resume Ready to attend interviews
  • Interview Preparation Support
  • Write Technical Exams before attending Interviews
  • Mock Interviews
  • Pre-Requisite: Job Seekers, any Graduates, Software Developer, Fresher , web developers, web designers, SEO specialists
  • Projects: You Work on Live Projects
  • Latest and Update Course Contents as per corporate standards.
  • Personal Attention to make Students Web Developer Experts

Deccan

1st Floor, Deccan Corner,
Opp. R-Deccan Mall/ KFC,
Near Deccan Bus stop
J.M Road, Deccan,
Shivaji Nagar, Pune- 04.
Office: 020-48618772,
Cell: 8087088772

Akurdi (Nigdi) (HO)

7/1 Shreeyash Building,
Opp. Akurdi Railway Station,
Dharmaraj Chowk.
Nigdi (Akurdi) Pune-44

Mob: 8793008772

Quick Connect