You are on page 1of 26

API INTERVIEW QUESTIONS

AND ANSWERS
API Interview Questions And Answers:
 Q1).What is Api?
Ans: An API (Application Programming Interface) is a collection of software functions and
procedures, called API calls, that can be executed by other software applications. Application
developers code that links to existing APIs to make use of their functionality. This link is seamless
and end-users of the application are generally unaware of using a separately developed API.
During testing, a test harness-an application that links the API and methodically exercises its
functionality-is constructed to simulate the use of the API by end-user applications. The interesting
problems for testers are:
1. Ensuring that the test harness varies parameters of the API calls in ways that verify functionality
and expose failures. This includes assigning common parameter values as well as exploring boundary
conditions.
2. Generating interesting parameter value combinations for calls with two or more parameters.
3. Determining the content under which an API call is made. This might include setting external
environment conditions (files, peripheral devices, and so forth) and also internal stored data that
affect the API.
4. Sequencing API calls to vary the order in which the functionality is exercised and to make the API
produce useful results from successive calls.
Q2). Explain what is REST and RESTFUL?
Ans: REST represents REpresentational  State Transfer; it is relatively new aspect of writing web
api.
RESTFUL is referred for web services written by applying REST architectural concept are called
RESTful services, it focuses on system resources and how state of resource should be transported
over HTTP protocol to a different clients written in different language.  In RESTFUL web service
http methods like GET, POST, PUT and DELETE can be used to perform CRUD operations.
Q3). Explain the architectural style for creating web api?
Ans: The architectural style for creating web api are
 HTTP for client server communication
 XML/JSON as formatting language
 Simple URI as the address for the services
 Stateless communication
Q4). Mention what tools are required to test your web api?
Ans: SOAPUI tool for SOAP WS and Firefox “poster” plugin for RESTFUL services.
Q5).Mention what are the HTTP methods supported by REST?
Ans: HTTP methods supported by REST are:
 GET: It requests a resource at the request URL. It should not contain a request body as it
will be discarded. May be it can be cached locally or on the server.
 POST: It submits information to the service for processing; it should typically return the
modified or new resource
 PUT: At the request URL it update the resource
 DELETE: At the request URL it removes the resource
 OPTIONS: It indicates which techniques are supported
 HEAD: About the request URL it returns meta information
Q6).Mention whether you can use GET request instead of PUT to create a resource?
Ans: No, you are not supposed to use POST or GET.  GET operations should only have view rights.
Q7).Mention what are resources in a REST architecture?
Ans: Resources are identified by logical URLs; it is the key element of a RESTful design.  Unlike,
SOAP web services in REST, you view the product data as a resource and this resource should
contain all the required information.
Q8).Mention what is the difference between AJAX and REST?
Ans:

 AJAX                                 REST

·          In Ajax, the request are sent to the server by using


XMLHttpRequest objects. The response is used by the
JavaScript code to dynamically alter the current page
·          Ajax is a set of technology; it is a technique of dynamically
updating parts of UI without having to reload the page
·           REST have a URL structure and
·          Ajax eliminates the interaction between the customer and resources
server asynchronously ·          REST is a type of software architec
from servers
·          REST requires the interaction between the customer and
server ·          REST requires the interaction betw

 Q9).Mention some key characteristics of REST?


Ans: Some key characteristics of REST includes
 REST is stateless, therefore the SERVER has no state (or session data)
 With a well applied REST API, the server could be restarted between two calls as every
data is passed to the server
 Web service mostly uses POST method to make operations, whereas REST uses GET to
access resources
Q10).Mention what are the different application integration styles?
Ans: The different integration styles includes
 Shared database
 Batch file transfer
 Invoking remote procedure (RPC)
 Swapping asynchronous messages over a message oriented middle-ware (MOM)
Q11).Explain how JAXB related to RESTful web api?
Ans: JAXB stands for java arch for xml binding.
Q12).Mention what is the difference between PUT and POST?
Ans: “PUT”puts a file or resource at a particular URI and exactly at that URI.  If there is already a
file or resource at that URI, PUT changes that file or resource.  If there is no resource or file there,
PUT makes one
POST sends data to a particular URI and expects the resource at that URI to deal with the request. 
The web server at this point can decide what to do with the data in the context of specified resource
Q13).Mention which markup language can be used in restful web api?
Ans: JSON and XML are the two markup language that can be used in restful web api
Q14) Mention what is the difference between RPC or document style web services? How you
determine to which one to choose?
Ans: In document style web services, we can transport an XML message as part of SOAP request
which is not possible in RPC style web service.  Document style web service is most appropriate in
some application where XML message behaves as document and content of that document can alter
and intention of web service does not rely on the content of XML message.
Q15).Mention what is JAX-WS and JAX-RS?
Ans: Both JAX-WS and JAX-RS are libraries (APIs) for doing communication in various ways in
Java.  JAX-WS is a library that can be used to do SOAP communication in JAVA, and JAX-RS lets
you do the REST communication in JAVA.
Q16).List out the tools or API for developing or testing web api?
Ans: Testing tools for web services for REST APIs includes
 Spring REST web service using MVC
 Jersey API
 CFX
 Axis
 Restlet,
Q17).Mention what is the difference between SOAP and REST?
Ans:

SOAP REST

·           Rest is a service


architectures
·          SOAP is a protocol through which two computer communicates by ·          REST supports ma
sharing XML document ·          REST reads can be
·          SOAP permits only XML ·          A REST client is m
·          SOAP based reads cannot be cached methods and an applicatio
·          SOAP is like custom desktop application, closely connected to the server
·          SOAP is slower than REST ·          REST is faster than
·          It runs on HTTP but envelopes the message ·          It uses the HTTP h
API Testing and API Rest Interview Questions and answers
 ““Q1).What is API testing?
Ans: API (Application Programming Interface) specifies how some software components should
interact with other, in other words it’s a set of functions and procedures that allows the creation of
applications which access the features or data of an application or operating system.   Testing of
these functions is known as API testing.
Q2). What are the tools used for API testing?
Ans: The tools used for various API testing are
 SoapUI Pro
 LoadUI Pro
 Alertsite API monitoring
Q3).What are the common tests performed on API’s?
Ans: The common tests performed on API’s
 Verification of the API whether it is updating any data structure
 Verify if the API does not return anything
 Based on input conditions, returned values from the API’s are checked
 Verification of the API whether it triggers some other event or calls another API
Q4).Mention the key difference between UI level testing and API testing?
Ans: UI ( User Interface) refers to testing graphical interface such as how user interacts with the
applications, testing application elements like fonts, images, layouts etc. UI testing basically focuses
on look and feel of an application.
While, API enables communication between two separate software systems. A software system
implementing an API contains functions or sub-routines that can be executed by another software
system
Q5).Explain what is SOAP?
Ans: SOAP-stands for Simple Object Access Control, and it is an XML based protocol for
exchanging information between computers.
Q6).Explain what is REST API?
Ans: It is a set of functions to which the developers performs requests and receive responses. In
REST API interaction is made via HTTP protocol
REST – stands for Representational State Transfer, it is quickly becoming defacto standard for API
creation.
 REST stands for Representational State Transfer. REST is an architectural style of
developing web services which take advantage of the ubiquity of HTTP protocol and leverages
HTTP method to define actions. It revolves around resource where every component is a
resource which can be accessed by a common interface using HTTP standard methods.
 In REST architecture, a REST Server provides access to resources and REST client
accesses and presents those resources. Here each resource is identified by URIs or global IDs.
REST uses different ways to represent a resource like text, JSON, and XML.XML and JSON are
the most popular representations of resources these days.
Q7) Difference API and Unit Testing?
Ans:

  API testing                          UNIT testing

·          API is owned by QA team ·          Unit testing is owned by d

·          API is mostly black box testing ·          Unit testing is white box te

·          Full functionality of the system is considered in API testing as it


will be used by the end-user (external developers who will use your ·          Unit testing is done to veri
API ) or not

·          For each of their module t


·          API test are often run after the build is ready and authors do not of their code modules and have to
have access to the source code is included in a build

Q8). How to test API’s ?


Ans: To test the API’s you should follow the following steps
 Select the suite in which you want to add the API test case
 Choose test development mode
 Develop test cases for the desired API methods
 Configure application control parameters
 Configure test conditions
 Configure method validation
 Execute API test
 View test reports
 Filter API test cases
 Sequence API test cases
Q9).Mention what the main areas to be taken in consideration while writing API document ?
Ans: The key area to be considered when writing API documents are
 Source of the content
 Document plan or sketch
 Delivery layout
 Information required for each function in the document
 Automatic document creation programs
Q10). In API document explain how to document each function ?What are the tools used for
documentation?
Ans:
 Description:Small description about what a function does
 Syntax:Syntax about the parameter of the code, the sequence in which they occur,
required and optional elements etc.
 Parameters:Functions parameters
 Error Messages:Syntax of error messages
 Example Code:Small snippet of code
 Related Links:Related functions
Popular tools used for API documentations are JavaDoc (for Java code ) Doxygen (for .Net code)

Q11).Explain API framework?


Ans: API framework is self-explanatory. Values for test run and for holding the configurable parts,
config file is used.  Automated test cases must represent in “ parse-table” format within config file. 
When testing API, it is not necessary to test each API so the config file have some section whose all
API are activated for that specific run.
Q12).How does the API Builder work?
Ans: API Builder is a PLSQL program consists of four SQL files
 For setting API parameters and starting the process one file is responsible
 Two files are created for temporary tables and Master package to create the outputted
code
 Fourth file creates “spooled” output of the code into a file called “output_script_.sql”
Q13).Explain what is TestApi ?
Ans: TestApi is a library of utility and test APIs that enables testers and developers to create testing
tools and automated tests for .NET and Win32 application.  It provides a set of common test building
blocks, types, data-structure and algorithms.
Q14).What is Input injection and what are different ways of doing it ?
Ans: Input Injection:  It is the act of simulating user input, in several ways you can simulate user
input.
 Direct Method Invocation
 Invocation using an accessibility interface
 Simulation using low-level input
 Simulation using a device driver
 Simulation using a robot
Q15).What are the main challenges of API testing?
Ans: The main challenges in API testing is
 Parameter Selection
 Parameter Combination
 Call sequencing
Q16).What is API testing with runscope ?
Ans: Runscope is a web application that provides backend services and easy to use interface for
testing APIs.
Q17).Explain what are the principles of API test design?
Ans: The principle for API test design are
 Setup :Create objects, start services, initialize data etc
 Execution:Steps to exercise API or scenario, also logging
 Verification:Oracles to evaluate execution outcome
 Reporting:Pass, failed or blocked
 Clean up:Pre-test state
Q18).What are the types of Bugs will API testing finds?
Ans: The types of Bugs, API will find
 Missing or duplicate functionality
 Fails to handle error conditions gracefully
 Stress
 Reliability
 Security
 Unused flags
 Not implemented errors
 Inconsistent error handling
 Performance
 Multi-threading issues
 Improper errors
Q19).What are the tools used for API test automation?
Ans: While testing Unit and API testing,  both target source code, if an API method is using code 
based on .NET then the tool which is supporting should have .NET
Automation tools for API testing can be used are
 NUnit for .NET
 JUnit for Java
 HP UFT
 Soap UI
Q20).Mention the steps for testing API ?
Ans: API testing steps
 Select the test case that has to be fulfilled
 For API call develop a test case
 To meet the test case configure the API parameters
 Determine how will you validate a successful test
 Using programming language like PHP or .NET execute the API call
 Allow the API call to return the data to validate
Q21).What are the common protocols that are testing in API tesing ?
Ans:
 HTTP
 JMS
 REST
 SOAP
 UDDI
 Q22).Explain The RESTFul Web Service?
Ans:
 Mostly, there are two kinds of Web Services which are quite popular.
 SOAP (Simple Object Access Protocol) which is an XML-based way to expose web
services.
 Web services developed using REST style are known as RESTful web services. These
web services use HTTP methods to implement the concept of REST architecture. A RESTful
web service usually defines a URI, Uniform Resource Identifier a service, provides resource
representation such as JSON and set of HTTP Methods.
Q23).Explain What Is A “Resource” In REST?
Ans:
 REST architecture treats every content as a resource. These resources can be either text
files, HTML pages, images, videos or dynamic business data.
 REST Server provides access to resources and REST client accesses and modifies these
resources. Here each resource is identified by URIs/ global IDs.
Q24).What Is The Most Popular Way To Represent A Resource In REST?
Ans. REST uses different representations to define a resource like text, JSON, and XML.
XML and JSON are the most popular representations of resources.
 Q25).Which Protocol Is Used By RESTful Web Services?
Ans:RESTful web services make use of HTTP protocol as a medium of communication between
client and server.
Q26).What Is Messaging In RESTful Web Services?
Ans: RESTful web services make use of HTTP protocol as a medium of communication between
client and server. The client sends a message in the form of an HTTP Request.
In response, the server transmits the HTTP Response. This technique is called Messaging. These
messages contain message data and metadata i.e. information about the message itself.
Q27).State The Core Components Of An HTTP Request?
Ans: Each HTTP request includes five key elements.
1. The Verb which indicates HTTP methods such as GET, PUT, POST, DELETE. 2.URI
stands for Uniform Resource Identifier (URI).It is the identifier for the resource on the
server. 3. HTTP Version which indicates HTTP version, for example-HTTP v1.1. 4. Request
Header carries metadata (as key-value pairs) for the HTTP Request message. Metadata could
be a client (or browser) type, the format that client supports, message body format, and cache
settings. 5. Request Body indicates the message content or resource representation.
Q28).State The Core Components Of An HTTP Response?
Ans: Every HTTP response includes four key elements.
1. Status/Response Code – Indicates Server status for the resource present in the HTTP
request.For example, 404 means resource not found and 200 means response is ok. 2.HTTP
Version – Indicates HTTP version, for example-HTTP v1.1. 3. Response Header – Contains
metadata for the HTTP response message stored in the form of key-value pairs. For example,
content length, content type, response date, and server type. 4. Response Body – Indicates
response message content or resource representation.
Q29). Name The Most Commonly Used HTTP Methods Supported By REST?
Ans: There are a few HTTP methods in REST which are more popular.
1. GET -It requests a resource at the request-URL. It should not contain a request body as it
will get discarded. Maybe it can be cached locally or on the server. 2.POST – It submits
information to the service for processing; it should typically return the modified or new
resource. 3. PUT – At the request URL it updates the resource. 4. DELETE – It removes the
resource at the request-URL. 5. OPTIONS -It indicates the supported techniques. 6. HEAD –
It returns meta information about the request URL.
Q30). Mention, Whether You Can Use GET Request Instead Of PUT, To Create A Resource?
Ans: No, you shouldn’t use a PUT or POST method. Instead, apply the GET operation which has
view-only rights.
Q31).Is There Any Difference Between PUT And POST Operations? Explain It.
Ans. PUT and POST operation are almost same. The only difference between the two is in the terms
of the result generated by them.
PUT operation is idempotent while POST operation can give a different result.
Let’s take an example.
1. PUT puts a file or resource at a particular URI and exactly at that URI. If the resource
already exists, then PUT updates it. If it’s a first-time request, then PUT creates one. 2.POST
sends data to a particular URI and expects the resource at that URI to deal with the request.
The web server at this point can decide what to do with the data in the context of specified
resource.
Q32). What Purpose Does The OPTIONS Method Serve For The RESTful Web Services?
Ans: This method lists down all the operations a web service supports. It makes read-only requests to
the server.
Q33).What Is URI? Explain Its Purpose In REST Based Web Services. What Is Its Format?
Ans: URI stands for Uniform Resource Identifier. URI is the identifier for the resource in REST
architecture.
The purpose of a URI is to locate a resource(s) on the server hosting the web service. A URI is of the
following format-
<protocol>://<service-name>/<ResourceType>/<ResourceID>
Q34).What Do You Understand By Payload In RESTFul Web Service?
Ans: Request body of every HTTP message includes request data called as Payload. This part of the
message is of interest to the recipient.
We can say that we send the payload in POST method but not in <GET> and <DELTE> methods.
Q35). What Is The Upper Limit For A Payload To Pass In The POST Method?
Ans. <GET> appends data to the service URL. But, its size shouldn’t exceed the maximum URL
length. However, <POST> doesn’t have any such limit.
So, theoretically, a user can pass unlimited data as the payload to POST method. But, if we consider
a real use case, then sending POST with large payload will consume more bandwidth. It’ll take more
time and present performance challenges to your server. Hence, a user should take action
accordingly.
Q36).Explain The Caching Mechanism?
Ans: Caching is a process of storing server response at the client end. It makes the server save
significant time from serving the same resource again and again.
The server response holds information which leads a client to perform the caching. It helps the client
to decide how long to archive the response or not to store it at all.
 Q37). What Are The Tools Available For Testing Web Services?
Ans: Following tools can help in testing the SOAP and RESTful web services.
1. SOAP UI tool. 2.Poster for Firefox browser. 3. The Postman extension for Chrome.
Q38).Explain The Factors That Help To Decide About The Style Of Web Service To Use?
SOAP Or REST?
Ans: In general, using REST based web service is preferred due to its simplicity, performance,
scalability, and support for multiple data formats.
However, SOAP is favorable to use where service requires an advanced level of security and
transactional reliability.
But you can read the following facts before opting for any of the styles.

1. Does the service expose data or business logic? To expose data REST will be a better
choice and SOAP for logic. 2.If the consumer or the service providers require a formal
contract, then SOAP can provide such a contract via WSDL. 3. Need to support multiple data
formats. REST supports this. 4. Support for AJAX calls. REST can use the
XMLHttpRequest. 5. Synchronous and asynchronous calls – SOAP enables both
synchronous/asynchronous operations whereas REST has built-in support for
synchronous. 6. Stateless or Stateful calls -REST is suited for stateless operations.
Here are some of the advanced-level facts that you can consider as well.

1. Security requirement – SOAP provides a high level of security. 2.Transaction support –


SOAP has good support for transaction management. 3. Limited bandwidth – SOAP has a lot
of overhead when sending/receiving packets since it’s XML based, requires a SOAP header.
However, REST requires less bandwidth to send requests to the server. Its messages are
mostly built using JSON. 4. Ease of use – It is easy to implement, test, and maintain REST
based application.
Q39). Can You Tell Us Which Java API Helps In Developing A RESTFul Web Service?
Ans. There are many frameworks and libraries available that a developer can use to create RESTful
web services in Java. For example, the JAX-RS library is a standard way to develop a REST web
service.
Also, Jersey is another most popular implementations of JAX-RS which offers more than what the
specs recommend. There are others like RESTEasy, RESTlet, and Apache CFX.
If you like Scala, then you should be using Play framework to develop RESTful web services.
Q40).Name The Most Commonly Used HTTP Methods Supported By REST?
Ans: There are a few HTTP methods in REST which are more popular.
1. GET -It requests a resource at the request-URL. It should not contain a request body as it
will get discarded. Maybe it can be cached locally or on the server. 2.POST – It submits
information to the service for processing; it should typically return the modified or new
resource. 3. PUT – At the request URL it updates the resource. 4. DELETE – It removes the
resource at the request-URL. 5. OPTIONS -It indicates the supported techniques. 6. HEAD –
It returns meta information about the request URL.

AUTOMATION TESTING
INTERVIEW QUESTIONS AND
ANSWERS
Q1). What is Automation Testing?
Ans: Automation testing is a technique uses an application to implement entire life cycle of the
software in less time and provides efficiency and effectiveness to the testing software.
Automation testing is an Automatic technique where the tester writes scripts by own and uses
suitable software to test the software. It is basically an automation process of a manual process.
Like regression testing, Automation testing also used to test the application from load,
performance and stress point of view.
In other word, Automation testing uses automation tools to write and execute test cases, no
manual involvement is required while executing an automated test suite. Usually, testers write
test scripts and test cases using the automation tool and then group into test suites.
The main goal of Automation testing is to increase the test efficiency and develop software
value.
Q2). When will you automate a test?
Ans: Automation in preferred in following cases
 Repetitive Tasks
 Smoke and Sanity Tests
 Test with multiple data set
 Regression test cases
Usually the decision is based on the ROI (Return on Investment)
Q3). When you will not automate testing?
Ans: One should not automate in following cases
 When the Application Under Test changes frequently
 One time test cases
 Adhoc – Random testing
Q4). What are the steps involved in the Automation Process ?
Ans: In the automation process, steps involved are
 Selecting the Test tool
 Define scope of automation
 Planning, desing and development
 Test execution
 Maintenance
Q5).What are the points that are covered while planning phase of automation ?
Ans: During planning phase of automation things which has to be taken in concern are
 Selection the “right” Automation tool
 Selection Automation Framework if any
 List of In scope and out of scope items for automation
 Test Environment setup
 Preparing Grant Chart of Project timelines for test script development & execution.
 Identify Test Deliverables
Q6). In what condition we cannot use automation testing for Agile method?
Ans: 
Automation testing is not useful for agile methods in following conditions
 When Agile testing always ask for changes in requirements
 When Exhaustive level of documentation is required in Agile
 Only suitable for those regression tests during agile testing like continuos integration
Q7). What are the primary features of good automation tool ?
Ans:
 Test Environment support and easy to use
 Good debugging facility
 Robust object identification
 Object and Image testing abilities
 Object identification
 Testing of database
 Support multiple frameworks
Q8). What are the types of framework used in software automation testing ?
Ans:
In software automation testing four types of framework used are
 Data driven automation framework
 Keyword driven automati4on framework
 Modular automation framework
 Hybrid automation framework
Q9).  What are the scripting standard while performing automation testing?
Ans: While writing the scripts for automation you have to consider following things,
 Uniform naming convention.
 3 Lines of comments for every 10 lines of code
 Adequate indentation.
 Robust error handling and recovery scenario
 Use of Frameworks wherever possible
Q10). What are the most popular tools for automation testing?
Ans: The most popular test tool for automation testing are
 QTP (HP UFT)
 Rational Robot
 Selenium
Q11). On what basis you can map the success of automation testing?
Ans: On basis of following criteria the success of automation testing can be mapped
 Defect Detection Ratio
 Automation execution time and time savings to release the product
 Reduction in Labour & other costs
Q12). Explain what is Sikuli?
Ans: Sikuli is a tool that uses “Visual Image Match” method to automate graphical user
interface.  All the web elements in Sikuli should be taken as an image and stored inside the
project.
Sikuli is comprised of
 Sikuli Script
 Visual Scripting API for Jython
 Sikuli IDE
Practical uses of Sikuli is that

 It can be used to automate flash websites or objects


 It can automate window based application and anything you see on screen without using
internal API support
 It provides simple API
 It can be easily linked with tools like Selenium
 Desktop application can be automated
 Sikuli offers extensive support to automate flash objects
 To automate desktop it uses powerful “Visual Match” and Flash objects
 It can work on any technology-.NET, Java,
 
 
Q13). Mention what is the difference between Selenium and Sikuli?
Ans:

Sikuli Selenium

·          It provides extensive support to automate flash objects


·          It has simple API ·           It cannot automa
·          It has got compli
·          It uses visual match to find elements on the screen. So we can
automate anything we see on the screen ·          It does not have

·          It can automate web as well as windows application ·          It can automate

Q14). What criteria do you consider for automating a test?


Ans:
I would consider the following points to help me decide if a test should be automated:
 How often does the test need to be executed? i.e. is that going to be a regression test?
Sometimes the test will need to be executed once, but with a large set of data
 How much time does automating this test will save me so that I can use my time in
exploratory testing
 How important is the test to the business; i.e. is the test scenario a typical user journey
through the application
 How complex is it to automate the test and how likely is it that the complexity doesn’t
cause many false positives which increases results analysis time?
 How likely is it that this test catches a defect?
 How likely is it that a feature or functionality will break and what is the impact of it to
the business? If it is high impact, then it should be automated to ensure it passes from release to
release
Q15).  What kind of tests should NOT be automated?
Ans: This interview question is similar to previous question but focuses on which tests Not
to be automated and left for manual testing. Possible answers can be:
 Usability Testing – at times this can be an impossible task to perform by automation as
the computer cannot efficiently judge if the system is of any use to its users
 Tests that only need to be executed once – unless the same test needs to be executed for a
large dataset then it makes sense to automate
 Tests without predictable results – test automation should give us confidence in the
results of the tests. If there are intermittent failures then the tests cannot be reliable and cannot
be dependent on
 Tests that need to be verified visually
 Tests that need to be executed quickly. At first, writing an automated test takes longer. If
we want a quick check, we should test manually, however, if that test is a good one which
should be run regularly, then it should be automated in time
Q16). What are Pros and Cons of automating tests at UI layer?
Ans:  Pros
 UI automated tests execute in a way that simulates user interacting with the system. So it
is very good for validating user journeys and flows
 Can cover end-to-end flows that communicate with 3rd party systems
 Because tests are run against the system, they can be demoed to the customer who can
understand what tests are run
 Can catch high severity or show stopper bugs
 Can check UI functionality where it is not possible to test otherwise
Ans: Cons
 UI automated tests can be very brittle (i.e. fail due to UI changes even though
functionality hasn’t changed)
 Slow feedback to the team. Execution is slow as you have to wait for the system to
launch and connections with 3rd party system can take a long time
 Limitation on what can be checked from the UI. There are some information that are not
present from the UI
 Because tests are slow from UI, we can’t have a lot of tests running against the UI
 Can be time consuming to construct automated test scripts for the UI
 Usually have to depend on a 3rd party tool or vendor for UI testing
Q17). Why would you want to automate a test? Is it to:
Ans:
 Increase test coverage?
 Improve quality?
 Save time for exploratory testing?
 Find more bugs?
 Replace manual testers?
This is a common test automation interview question and answer to this is quite straight
forward. Although some of the above reasons seem plausible, the main reason why you
would want to automate a test, is because you want to repeat the same test many times

AUTOMATION TESTING PYTHON


INTERVIEW QUESTIONS
1.What is Python? What are the benefits of using Python?
Answer:Python is a programming language with objects, modules, threads, exceptions and
automatic memory management. The benefits of pythons are that it is simple and easy,
portable, extensible, build-in data structure and it is an open source.
2. How Python can be used in software testing? 
Answer:
1. To generate test data; parse test results; generate reports; testing API calls etc.
2. Python to extract requirements from a Word document.
3. For testing tasks automation, setting up environments for tests, extracting performance
data, etc…
4. Testers use Python extensively in many companies with Selenium for test automation.
5. For writing desktop applications used by testers.
6. Test data manipulation.
7. To build test environment
8. Testing with IronPython on .NET
3.What Python frameworks do you know? 
Answer: Framework called Web2py, PAMIE (Python automation Module for I. E.), The
py.test framework
4.Question:What tools that helps Python development do you know?
 Answer:There are good tools for helping Python development such as Notepad++ with the
PyNPP plugin and Eclipse with PyDev and PyUnit.
5. The following is displayed by a print function call: 
yesterday today tomorrow Please write an example of a print function.
Answer: print(‘yesterday\ntoday\ntomorrow’)
6.The following is displayed by a print function call:
Answer:hello-how-are-you
7. Please write an example of a print function. 
Answer: print(‘hello’ + ‘-‘ + ‘how’ + ‘-‘ + ‘are’ + ‘-‘ + ‘you’)
8. What does the expression len(”) evaluate to?
Answer: 0
9.Considering the following code: 
s = ‘catandapple’ 
Write an expression that evaluate to ‘apple’. 
Answer: s[-5:]
10.Write an expression that evaluate to True
Answer: len(‘aaddgg’) == 6
12.What are “tuples” 
Answer: Tuples are immutable sequences: they cannot be modified. Tuples use
parentheses instead of square brackets: tup = (‘test’, 5, -0.2)
13. What are the rules for legal Python names? 
Answer:
1. Names must start with a letter or _.
2. Names must contain only letters, digits, and _.

14.. Which command do you use to exit help window or help command prompt?
quitWhen you type quit at the help’s command prompt, python shell prompt will appear by
closing the help window automatically

15. Does the functions help() and dir() list the names of all the built_in functions and variables?
If no, how would you list them?
No. Built-in functions such as max(), min(), filter(), map(), etc is not apparent immediately as
they are
available as part of standard module.To view them, we can pass the module ” builtins ” as
an argument to “dir()”. It will display the
built-in functions, exceptions, and other objects as a list.>>>dir(__builtins )
[‘ArithmeticError’, ‘AssertionError’, ‘AttributeError’, ……… ]

16. Explain how Python does Compile-time and Run-time code checking?
Python performs some amount of compile-time checking, but most of the checks such as
type, name, etc are postponed until code execution. Consequently, if the Python code
references a user -defined function that does not exist, the code will compile successfully. In
fact, the code will fail with an exception only when the code execution path references the
function which does not exists.

17.What is a “unittest” in Python?


The unit testing framework of Python is known as “unittest”.  It supports the sharing of
setups, automation testing, shutdown code for tests, aggregation of tests into collections,
among others.

18.Define “slicing”.
“Slicing” is a mechanism to select a range of items from sequence types like list, tuple,
strings etc.

19.What are generators in Python?


Generators are the means to implement iterators. It is a normal function except that it yields
“expression” in the “function”.

20.Define “docstring”.
“Docstring” is a Python documentation string. It is the means to document Python
“functions”, “modules” and “classes”.

21.How do you copy an object in Python?


copy.copy () or copy.deepcopy()
22.What is a “negative index”?
Python sequences can be indexed as positive and negative numbers. For ac positive index,
0 is the first number, 1 is the second etc.  For a negative index, (-1) is the last index and (-2)
is the second etc.

23.How do you convert a number into a string?


By using the inbuilt function str().
24.What is the difference between “Xrange” and “range”?
“Xrange” returns the “Xrange” object while range returns the “list” irrespective of the size of
the “range”.

25.Define “module” and “package”.


Each Python program file is a “module”, which imports other modules like “objects” and
“attributes”.

A Python program folder is a “package” of “modules”.  A package can have “modules” or


“subfolders”.

26.What is Python? What are the benefits of using Python?


Python is a programming language with objects, modules, threads, exceptions and
automatic memory management. The benefits of pythons are that it is simple and easy,
portable, extensible, build-in data structure and it is an open source.

27.What is PEP 8?
PEP 8 is a coding convention, a set of recommendation, about how to write your Python
code more readable.

28.What is pickling and unpickling?


Pickle module accepts any Python object and converts it into a string representation and
dumps it into a file by using dump function, this process is called pickling.  While the
process of retrieving original Python objects from the stored string representation is called
unpickling.

29. How Python is interpreted?


Python language is an interpreted language. Python program runs directly from the source
code. It converts the source code that is written by the programmer into an intermediate
language, which is again translated into machine language that has to be executed.

30. How memory is managed in Python?


 Python memory is managed by Python private heap space. All Python objects and data
structures are located in a private heap. The programmer does not have an access to this private
heap and interpreter takes care of this Python private heap.
 The allocation of Python heap space for Python objects is done by Python memory
manager.  The core API gives access to some tools for the programmer to code.
 Python also have an inbuilt garbage collector, which recycle all the unused memory and
frees the memory and makes it available to the heap space.

PYTHON TESTING INTERVIEW


QUESTIONS AND ANSWERS
Q1).How Python can be used in software testing?
Ans:
1. To generate test data; parse test results; generate reports; testing API calls etc. 
2. Python to extract requirements from a Word document. 
3. For testing tasks automation, setting up environments for tests, extracting performance data, etc… 
4. Testers use Python extensively in many companies with Selenium for test automation. 
5. For writing desktop applications used by testers. 
6. Test data manipulation. 
7. To build test environment 
8. Testing with IronPython on .NET

Q2).What Python frameworks do you know?


Ans: Framework called Web2py, PAMIE (Python automation Module for I. E.), The py.test
framework
Q3).What tools that helps Python development do you know?
Ans: There are good tools for helping Python development such as Notepad++ with the
PyNPP plugin and Eclipse with PyDev and PyUnit.
Q4).The following is displayed by a print function call:
yesterday
today
tomorrow
Please write an example of a print function.
Ans: print(‘yesterday\ntoday\ntomorrow’)
Q5).The following is displayed by a print function call:
hello-how-are-you
Please write an example of a print function.
Ans:  print(‘hello’ + ‘-‘ + ‘how’ + ‘-‘ + ‘are’ + ‘-‘ + ‘you’)
Q6).Question: What does the expression len(”) evaluate to?
Ans:  0
Q7).Considering the following code:
s = ‘catandapple’
Write an expression that evaluate to ‘apple’.
Ans: s[-5:]
Q8).Write an expression that evaluate to True
Ans: len(‘aaddgg’) == 6
Q9).Write the code that calculate the sum of even numbers from x1 till x2
Q10).What are “tuples”
Ans: Tuples are immutable sequences: they cannot be modified. Tuples use parentheses
instead of square brackets: tup = (‘test’, 5, -0.2)
Q11).What are the rules for legal Python names?
Ans:
1. Names must start with a letter or _.
2. Names must contain only letters, digits, and _.
Q12).What is the dictionary tipe in Python?
How to Access Information From Dictionaries and Modify it?
Q13).To display a value in the console, what Python keyword do you use? (Print)
Q14).Python file names traditionally end in what characters after a period? (.py)
Q15).An if statement can have how many elif parts? (Unlimited, i.e., 0 or more)
Q16).How many control objects are allowed in a frame? (Unlimited, i.e., 0 or more)
Q17).When you enter text into an input field and press enter, the text is passed to the input
field’s event handler.
Q18).What is the data type of the text? (string)
Q19).What does the draw handler parameter represent? (The canvas)
Q20).What happens if you draw text outside the canvas coordinates?
Q21).You want a timer to create exactly 1000 events. Suggest any solutions.
(Have a global counter for the number of timer calls. In the timer handler, increment the
counter. In the timer handler, check the count and possibly stop the timer.)
Q22).How many timers can you have running at once? (Unlimited)
Q23).Give example of list – [1, 2, 3]
Q24).Give example of Tuple – (1, 2, 3)
Q25).Which types of data are immutable in Python? (Numbers, Tuples, Strings, Booleans)
Q26).Which types of data are mutable in Python? (List)
Q27).Question: What is the Lambda Functions in Python?
Ans: Lambda Functions in Python can be used to pass a function as an argument or can be
used inside another statement. A lambda function has the syntax: lambda variable(s) :
expression
Q28).What are Decorators in Python?
Ans: A decorator in Python is a function that wraps another function (it takes a function as
an argument and returns a replacement function) Or another way to explain: The main
function is called and its return value passed to the decorator and the decorator then returns
a function that replaces the wrapped function.
Summary
GIT INTERVIEW QUESTIONS
AND ANSWERS
1.What is Git?
Git is one of the most popular frameworks for source code control. It has been widely
adopted in the open source community and many corporations use Git as their source
control framework of choice. it is very fast and very flexible, while being straightforward to
use.

2.What is GIT stash?


In case if you are in the middle of something/task and need to jump over to the other job,
and at the same time you don’t want to lose/destroy your current edits then you can use GIT
stash.

3.What is the use of ‘git log’?


 ‘git log’ Show commit logs
 we can find specific commits in your project history / metadata repository – by author,
date, content or history ‘git log’ is used.
4.What is SourceTree (ST)?
There are two ways to work with Git: from the command line or from a graphical user
interface (GUI). SourceTree is the most popular cross-platform GUI for Git.

5.What is ‘git add’ is used for?


 ‘git add’ adds file changes in your existing directory to your index.
 ‘git add’ Add file contents to the index
6.What are the differences between ‘git pull’ and ‘git fetch’?
 Git pullautomatically merges the commits without letting you review them first.
 Git fetchstores them in your local repository but it not merge them with your current
branch.
 git fetch similar to git pull but it does not merge the changes.
7.What is another option for merging in git?
 git merge, Join two or more development histories together
git rebase,  Reapply commits on top of another base tip
 Rebasing” is an alternative to merging the branch in git.
8.What language is used in GIT?
GIT is fast, and ‘C’ language makes this possible by reducing the overhead of runtimes
associated with higher languages.

9.What is a ‘conflict’ in git?


A ‘conflict’ arises when the commit that has to be merged has some change in one place,
and the current commit also has a change at the same place. Git will not be able to predict
which change should take precedence.
10.What is ‘bare repository’ in GIT?
To co-ordinate with the distributed development and developers team, especially when you
are working on a project from multiple computers ‘Bare Repository’ is used. A bare
repository comprises of a version history of your code.

AGILE INTERVIEW QUESTIONS


AND ANSWERS

Q1. What
is Agile Testing?
Agile Testing is a practice that a QA follows in a dynamic environment where testing
requirements keep changing according to the customer needs. It is done parallel to the
development activity where testing team receives frequent small codes from the
development team for testing.
Q2. What is re-factoring?
Modification of the code without changing its functionality to improve the performance is
called re-factoring.
Q3. Explain Velocity in Agile?
Velocity is a metric that is calculated by addition of all efforts estimates associated with user
stories completed in a iteration. It predicts how much work Agile can complete in a sprint
and how much time will require to complete a project.
Q4. What is a test stub?
A small code which mimics a specific component in the system and can replace it. Its output
is same as the component it replaces.
Q5. What is Test Driven Development (TDD)?
It is Test-first development technique in which we add a test first before we write a complete
production code. Next we run the test and based on the result refactor the code to fulfill the
test requirement.
Q6. What is Agile manifesto?
Agile manifesto defines an iterative and people-centric approach to software
development. It has basically 4 key values and 12 principals.
Q7. What is the difference between burn-up and burn-down chart?
Burn-up and burn-down charts are used to keep track the progress of the project.
Burn-up charts represent how much work has been completed in any project whereas Burn-
down chart represents the remaining work in a project.
Q8. What qualities should a good Agile tester have?
1. Agile tester should be able to understand the requirements quickly.
2. Agile tester should know Agile concepts and principals.
3. As requirements keep changing, he should understand the risk involve in it.
4. Agile tester should be able to prioritize the work based on the requirements.
5. Communication is must for a Agile tester as it requires a lot of communication with
developers and business associates.
Q9. What is a Task board in Agile?
Task board is dash board which shows progress of the project. It contains:
1. User Story: which has the actual business requirement.
2. To Do: Tasks that can be worked on.
3. In Progress: Tasks in progress.
4. To Verify: Tasks pending for verification or testing
5. Done: Completed tasks.
Q10. Define the roles in Scrum?
There are mainly three roles that a Scrum team have:
1. Project Owner – who has the responsibility of managing product backlog. Works with
end users and customers and provide proper requirement to the team to build the proper
product.
2. Scrum Master – who works with scrum team to make sure each sprint gets complete on
time. Scrum master ensure proper work flow to the team.
3. Scrum Team – Each member in the team should be self-organized, dedicated and
responsible for high quality of the work.
Q11. What is Product backlog & Sprint Backlog?
Product backlog is maintained by the project owner which contains every feature and
requirement of the product.
Sprint backlog can be treated as subset of product backlog which contains features and
requirements related to that particular sprint only.
Q12. Explain the difference between traditional Waterfall model and Agile testing?
 Agile testing is done parallel to the development activity whereas in traditional waterfall
model testing is done at the end of the development.
As done in parallel, agile testing is done on small features whereas in waterfall model
testing is done on whole application.
Q13. What is Zero sprint in Agile?
It can be defined as pre step to the first sprint. Activities like setting development
environment, preparing backlog etc needs to be done before starting of the first sprint and
can be treated as Sprint zero.
Q14. What is Spike?
There may be some technical issues or design problem in the project which needs to be
resolved first. To provide the solution of these problem “Spikes” are created. Spikes are of
two types- Functional and Technical.
Q15. Explain Pair Programming and its benefits?
Pair programming is a technique in which two programmer works as team in which one
programmer writes code and other one reviews that code. They both can switch their roles.
Benefits:
1. Improved code quality: As second partner reviews the code simultaneously, it reduces the
chances of mistake.
2. Knowledge transfer is easy: One experience partner can teach other partner about the
techniques and codes.
Q16. Explain the Iterative and Incremental Development in Agile?
 Iterative Development: Software is developed and delivered to customer and based on the
feedback again developed in cycles or release and sprints. Say in Release 1 software is
developed in 5 sprints and delivered to customer. Now customer wants some changes, then
development team plan for 2nd release which can be completed in some sprints and so on.
Incremental Development:Software is development in parts or increments. In each
increment a portion of the complete requirement is delivered.
Q17. How do you deal when requirements change frequently?
This question is to test the analytical capability of the candidate. Answer can be-
Work with PO to understand the exact requirement to update test cases. Also understand
the risk in changing the requirement. Apart from this one should be able to write generic test
plan and test cases. Don’t go for the automation until requirements are finalized.

Q18. What is Scrum ban?


It is a software development model which is combination of scrum and kanban. Scrumban is
considered for maintenance projects in which there are frequent changes or unexpected
user stories. It can reduce the minimum completion time for user stories.
Q19. What is Application Binary Interface?
Application Binary Interface or ABI defines an interface for complied application programs or
we can say it describes the low level interface between an application and the operating
system.
Q20. What is difference between Epic, User stories & Tasks?
 User Stories:User Stories defines the actual business requirement. Generally created by
Business owner.
Task: To accomplish the business requirements development team create tasks.
Epic: A group of related user stories is called an Epic.
Q21. How QA can add a value to an agile team?
QA can provide a value addition by thinking differently about the various scenarios to test a
story. They can provide quick feedback to the developers whether new functionality is
working fine or not.
Q22. Name some Agile quality strategies.
Some Agile quality strategies are-
1. Re-factoring
2. Small feedback cycles
3. Dynamic code analysis
4. Iteration
Q23. What is importance of daily stand up meeting?
Daily stand up meeting is essential for any team in which-
1. Team discuss about how much work has been completed.
2. What are the plans to resolve technical issues.
3. What steps need to done to complete the projects etc.
Q24. What is tracer bullet?
It can be defined as spike with the current architecture or the current set of best practices.
The purpose of a tracer bullet is to examine how an end-to-end process will work and
examine feasibility.
Q25. How the velocity of sprint is measured?
If capacity is measured as a percentage of a 40 hours weeks then completed story points
* team capacity
If capacity is measured in man hours then Completed story points / team capacity
Q26. Explain how you can measure the velocity of the sprint with varying team capacity?
When planning a sprint usually, the velocity of the sprint is measured on the basis of
professional judgement based on historical data. However, the mathematical formula used
to measure the velocity of the sprint are,
 first – completed story points X team capacity: If you measure capacity as a percentage
of a 40 hours weeks
 Second – completed story points / team capacity: If you measure capacity in man-hours
For our scenario second method is applicable.

Q27. What is an epic, user stories and task?


Epic: A customer described software feature that is itemized in the product backlog is
known as epic. Epics are sub-divided into stories
User Stories: From the client perspective user stories are prepared which defines project or
business functions, and it is delivered in a particular sprint as expected.
Task: Further down user stories are broken down into different task
Q28. What are the differences between RUP (Rational Unified Process) and Scrum
methodologies?

RUP SCRUM

– Formal Cycle is defined across four phases, but some workflows can be
concurrent – Each sprint is a comple

– No end to end project p


– Formal project plan, associated with multiple iterations is used. of the current iteration

– Scope is predefined ahead of the project start and documented in the scope – It uses a project backlo
document. During the project, scope can be revised.

– Artifacts include Scope Document, formal functional requirements package,


system architecture document, development plan, test scripts, etc. – Operational software is

– Recommended for long term, large, enterprise level projects with medium to – Recommended for quic
high complexity dependent on a deadline

Q29. As a tester what should be your approach when requirements change continuously?
When requirement keeps changing, continuously agile tester should take following
approach
 Write generic test plans and test cases, which focuses on the intent of the requirement
rather than its exact details
 To understand the scope of change, work closely with the product owners or business
analyst
 Make sure team understand the risks involved in changing requirements especially at the
end of the sprint
 Until the feature is stable, and the requirements are finalized, it is best to wait if you are
going to automate the feature
 Changes can be kept to a minimum by negotiating or implement the changes in the next
sprint
Q30. Explain the difference between Extreme programming and Scrum?

Scrum Extreme Programing (XP

– Scrum teams usually have to work in iterations called sprints which usually
last up to two weeks to one month long – XP team works in itera

– Scrum teams do not allow change into their sprints – XP teams are more flex

– In scrum, the product owner prioritizes the product backlog but the team – XP team work in strict
decides the sequence in which they will develop the backlog items customer

– Scrum does not prescribe any engineering practices – XP does prescribe engi

You might also like