Monday, 6 June 2016

Selenium Interview Questions



Selenium Interview Questions

A list of frequently asked Selenium interview questions and answers are given below.


1) 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.


2) 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.


3) 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.


4) 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.


5) 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.
6) What is selenium 2.0?
Selenium 2.0 is a tool which is a combination of web testing tools Selenium RC and WebDriver.


7) Why is selenium selected as a test tool?
Selenium 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.


8) What are selenium supporting testing types?
Selenium supports two types of testing:
  • Functional Testing
  • Regression Testing


9) 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.


10) What is selenese?
Selenese is a lanuage which is used for writing test script in selenium IDE.


11) Describe the different types of locators in Selenium?
Locator 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


12) What is an Xpath?
Xpath is used to locate a web element based on its XML path. It can be used to locate HTML elements.


13) Which is the latest Selenium tool?
The latest Selenium tool is WebDriver.


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


15) 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.


16) Where the result is seen of Test Execution in Selenium IDE?
The result of test execution is displayed in a Log Window in Selenium IDE.


17) Can you edit tests in Selenium IDE?
Yes, tests in Selenium IDE can be edited. There are two ways to edit tests in Selenium IDE.
  • By Table views
  • Looking into the source code


18) Can you use html id and name while using Selenium IDE?
Yes, You can use html id and name as it is available in Selenium IDE.


19) What are the WebDriver supported Mobile Testing Drivers?
WebDriver supported "mobile testing drivers" are:
  • AndroidDriver
  • IphoneDriver
  • OperaMobileDriver


20) What are the popular programming languages supported by Selenium WebDriver to write Test Cases?
  • JAVA
  • PHP
  • Python
  • C#
  • Ruby
  • Perl


21) What is the difference between assert and verify commands?
Assert: Assert command checks if the given condition is true or false. If the condition is true, the program control will execute the next phase of testing, and if the condition is false, execution will stop and nothing will be executed.
Verify: Verify command also checks if the given condition is true or false. It doesn't halts program execution i.e. any failure during verification would not stop the execution and all the test phases would be executed.


22) What is the difference between "/" and "//" in Xpath?
Single Slash "/": Single slash is used to create Xpath with absolute path.
Double Slash "//": Double slash is used to create Xpath with relative path.


23) How to type in a text box using Selenium?
To type in a text box, we use sendKeys("String to be entered") to insert string in the text box.
Syntax:
  1. WebElement username = drv.findElement(By.id("Email"));  
  2. // entering username  
  3. username.sendKeys("sth");  


24) What is JUnit?
JUnit is an open source testing framework for java applications. It is introduced by Apache.


25) What are the four parameters that you need to pass in Selenium?
The four parameters that you have to pass in Selenium are:
  1. Host
  2. Port Number
  3. Browser
  4. URL


26) How can you "submit" a form using Selenium ?
  1. WebElement el  =  driver.findElement(By.id("ElementID"));  
  2. el.submit();  


27) What is the difference between close() and quit()?
The close() method closes the current browser only whereas quit() method closes all browsers opened by WebDriver.

Software Testing Interview Questions



Software Testing Interview Questions
A list of mostly asked software testing interview questions or QTP interview questions and answers are given below.

1) What is PDCA cycle and where testing fits in?
There are four steps in a normal software development process. In short, these steps are referred as PDCA.
PDCA stands for Plan, Do, Check, Act.
  • Plan: It defines the goal and the plan for achieving that goal.
  • Do/ Execute: It depends on the plan strategy decided during the plan stage. It is done according to this phase.
  • Check: This is the testing part of the software development phase. It is used to ensure that we are moving according to plan and getting the desired result.
  • Act: This step is used to solve if there any issue is occurred during the check cycle. It takes appropriate action accordingly and revises the plan again.
The developers do the "planning and building" of the project while testers do the "check" part of the project.

2) What is the difference among white box, black box and gray box testing?
Black box Testing: The strategy of black box testing is based on requirements and specification. It requires no need of knowledge of internal path, structure or implementation of the software being tested.
White box Testing: White box testing is based on internal paths, code structure, and implementation of the software being tested. It requires a full and detail programming skill.
Gray box Testing: This is another type of testing in which we look into the box which is being tested, It is done only to understand how it has been implemented. After that we close the box and use the black box testing.

3) What are the types of defects?
There are three types of defects: Wrong, missing and extra.
Wrong: These defects are occurred due to requirements have been implemented incorrectly.
Missing: It is used to specify the missing things i.e. a specification was not implemented, or the requirement of the customer was not noted properly.
Extra: This is an extra facility incorporated into the product that was not given by the end customer. It is always a variance from the specification but may be an attribute that was desired by the customer. However, it is considered as a defect because the variance from the user requirements.

4) What are the advantages of designing tests early in the life cycle?
It helps you to prevent defects into the code.

5) Tell me about the risk based testing.
Risk based testing is a testing strategy that is based on prioritizing tests by risks. It is based on a detailed risk analysis approach which categorizes the risks by their priority. Highest priority risks are resolved first.
6) What is the difference between preventative and reactive approaches to testing?
Preventative tests are designed earlier and reactive tests are designed after the software has been produced.

7) What is the purpose of exit criteria?
The exit criteria is used to define the completion of the test level.

8) Why the decision table testing is used?
A decision table consists of inputs in a column with the outputs in the same column but below the inputs.
The decision table testing is used for testing systems for which the specification takes the form of rules or cause-effect combination. The reminders you get in the table explore combinations of inputs to define the output produced.

9) What is alpha and beta testing?
These are the key differences between alpha and beta testing:
No.
Alpha Testing
Beta Testing
1)
It is always done by developers at the software development site.
It is always performed by customers at their own site.
2)
It is also performed by Independent testing team.
It is not be performed by Independent testing team.
3)
It is not open to the market and public.
It is open to the market and public.
4)
It is always performed in virtual environment.
It is always performed in real time environment.
5)
It is used for software applications and projects.
It is used for software products.
6)
It follows the category of both white box testing and Black Box Testing.
It is only the kind of Black Box Testing.
7)
It is not known by any other name.
It is also known as field testing.
10) What is Random/Monkey Testing?
Random testing is also known as monkey testing. In this testing, data is generated randomly often using a tool. The data is generated either using a tool or some automated mechanism.
Random testing has some limitations:
  • Most of the random tests are redundant and unrealistic.
  • It needs more time to analyze results.
  • It is not possible to recreate the test if you do not record what data was used for testing.

11) What is the negative and positive testing?
Negative Testing: When you put an invalid input and receive errors is known as negative testing.
Positive Testing: When you put in the valid input and expect some actions that are completed according the specification is known as positive testing.

Hadoop Interview Questions



Hadoop Interview Questions
There is given hadoop interview questions and answers that has been asked in many companies. Let's see the list of top hadoop interview questions.

1) What is Hadoop?
Hadoop is a distributed computing platform. It is written in Java. It consist of the features like Google File System and MapReduce.

2) What platform and Java version is required to run Hadoop?
Java 1.6.x or higher version are good for Hadoop, preferably from Sun. Linux and Windows are the supported operating system for Hadoop, but BSD, Mac OS/X and Solaris are more famous to work.

3) What kind of Hardware is best for Hadoop?
Hadoop can run on a dual processor/ dual core machines with 4-8 GB RAM using ECC memory. It depends on the workflow needs.

4) What are the most common input formats defined in Hadoop?
These are the most common input formats defined in Hadoop:
  1. TextInputFormat
  2. KeyValueInputFormat
  3. SequenceFileInputFormat
TextInputFormat is a by default input format.

5) What is InputSplit in Hadoop? Explain.
When a hadoop job runs, it splits input files into chunks and assign each split to a mapper for processing. It is called InputSplit.

6) How many InputSplits is made by a Hadoop Framework?
Hadoop will make 5 splits as following:
  • One split for 64K files
  • Two splits for 65MB files, and
  • Two splits for 127MB files

7) What is the use of RecordReader in Hadoop?
InputSplit is assigned with a work but doesn't know how to access it. The record holder class is totally responsible for loading the data from its source and convert it into keys pair suitable for reading by the Mapper. The RecordReader's instance can be defined by the Input Format.

8) What is JobTracer in Hadoop?
is a service within Hadoop which runs MapReduce jobs on the cluster.

9) What are the functionalities of JobTracer?
These are the main tasks of JobTracer:
  • To accept jobs from client.
  • To communicate with the NameNode to determine the location of the data.
  • To locate TaskTracker Nodes with available slots.
  • To submit the work to the chosen TaskTracker node and monitors progress of each tasks.

10) Define TaskTracker.
TaskTracker is a node in the cluster that accepts tasks like MapReduce and Shuffle operations from a JobTracker.

11) What is Map/Reduce job in Hadoop?
Map/Reduce is programming paradigm which is used to allow massive scalability across the thousands of server.
Actually MapReduce refers two different and distinct tasks that Hadoop performs. In the first step maps jobs which takes the set of data and converts it into another set of data and in the second step, Reduce job. It takes the output from the map as input and compress those data tuples into smaller set of tuples.

12) What is Hadoop Streaming?
Hadoop streaming is a utility which allows you to create and run map/reduce job. It is a generic API that allows programs written in any languages to be used as Hadoop mapper.

13) What is a combiner in Hadoop?
A Combiner is a mini-reduce process which operates only on data generated by a Mapper. When Mapper emits the data, combiner receives it as input and sends the output to reducer.

14) Is it necessary to know java to learn Hadoop?
If you have a background in any programming language like C, C++, PHP, Python, Java etc. It may be really helpful, but if you are nil in java, it is necessary to learn Java and also get the basic knowledge of SQL.

15) How to debug Hadoop code?
There are many ways to debug Hadoop codes but the most popular methods are:
  • By using Counters.
  • By web interface provided by Hadoop framework.

16) Is it possible to provide multiple inputs to Hadoop? If yes, explain.
Yes, It is possible. The input format class provides methods to insert multiple directories as input to a Hadoop job.

17) What is the relation between job and task in Hadoop?
In Hadoop, A job is divided into multiple small parts known as task.

18) What is distributed cache in Hadoop?
Distributed cache is a facility provided by MapReduce Framework. It is provided to cache files (text, archives etc.) at the time of execution of the job. The Framework copies the necessary files to the slave node before the execution of any task at that node.

19) What commands are used to see all jobs running in the Hadoop cluster and kill a job in LINUX?
Hadoop job - list
Hadoop job - kill jobID

20) What is the functionality of JobTracker in Hadoop? How many instances of a JobTracker run on Hadoop cluster?
JobTracker is a giant service which is used to submit and track MapReduce jobs in Hadoop. Only one JobTracker process runs on any Hadoop cluster. JobTracker runs it within its own JVM process.
Functionalities of JobTracker in Hadoop:
  • When client application submits jobs to the JobTracker, the JobTracker talks to the NameNode to find the location of the data.
  • It locates TaskTracker nodes with available slots for data.
  • It assigns the work to the chosen TaskTracker nodes.
  • The TaskTracker nodes are responsible to notify the JobTracker when a task fails and then JobTracker decides what to do then. It may resubmit the task on another node or it may mark that task to avoid.

21) How JobTracker assign tasks to the TaskTracker?
The TaskTracker periodically sends heartbeat messages to the JobTracker to assure that it is alive. This messages also inform the JobTracker about the number of available slots. This return message updates JobTracker to know about where to schedule task.

22) Is it necessary to write jobs for Hadoop in Java language?
No, There are many ways to deal with non-java codes. HadoopStreaming allows any shell command to be used as a map or reduce function.