0% found this document useful (0 votes)
857 views

Software Testing Interview Preparation Questions Answers

Uploaded by

rahulkharche369
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
857 views

Software Testing Interview Preparation Questions Answers

Uploaded by

rahulkharche369
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 393

SOFTWARE TESTING

INTERVIEW PREPARATION
QUESTIONS ANSWERS

Page | 1
SOFTWARE TESTING INTERVIEW PREPARATION QUESTIONS ANSWERS

1.SOFTWARE TESTING

2.AGILE

3.SOFTWARE TESTING WEB APPLICATION CHECKLIST QUESTIONS

4.SITUATIONAL AND BEHVIORAL QUESTION ANSWER

5.DIFFERENCES BETWEEN SOFTWARE TESTING TERMS

6.SQL AND DATABASE

7.SQL QUERIES

8.POSTMAN

9.API TESTING

10.GIT

11.JENKINS

12.SOFWARE TESTING PROJECT RELATED QUESTIONS

13.HR INTERVIEW QUESTION ANSWERS

14.CUCUMBER

15.MAVEN

16.CORE JAVA

17.OOPS

18.TESTNG

19.SELENIUM

20.APPIUM

21.SIKULI

Page | 2
1) Why do you want to pursue your career in the field of software testing?
Answer: Based on my research, it is compulsory for any product to be of good quality to sustain
in a market. To gain satisfaction and confidence in the quality of services or products, from the
end-user, we must verify that product behaves as expected and outperforms the desired quality
standards. To gain excellence and value for money spent, we should offer the best quality
products and services to our clients. I strongly believe that software testing decides the measure
of product quality and performance.
As I always look for quality rather than features rich product, that do not perform as expected.
that is the main reason why I decided to pursue in the software testing domain.

2) Please explain your nature, habits, or likes that you think you are the right candidate for
the testing?
Answer: From my childhood, I was curious about how things work, I used to ask many
questions to my parents on why, how, and what about the things. During my school and college
days, I was debating on many topics, reading books, and searching libraries and the internet to
understand and find out reasons and answers to many of my questions. I used to visit my mentors
often to know and discuss my queries. Based on my knowledge seeking nature and desire for
perfection, I think I am right candidate for software testing

3) Why should we test?


Answer: It is essential to test to verify that
 the product or software built behaves as expected by the customer, meets or exceeds the
expectations.
 personal information shared by the end-user is secured while using the product, application,
or services.
 The features provided in the application perform as per expectation and requirement.
 The product has no serious anomalies.
By testing an application, any deviation from expected behavior can be identified and reported to
the stakeholders.

4) What do you mean by testing?


Answer: Testing is a process of running an application
 To identify any defects that breaks the functionality,

Page | 3
 Features provided in software offer results as expected,
 System securely display output as quickly as possible.
 Software features should display same output and behave as expected every repeated instance
of running it.
The software can be tested manually by testers or can run automatically using a script and follow
steps that tester execute to test the application.

5) What are the features you check before you purchase the mobile?
Answer: Priority will be the price of a mobile, but various features to check before we make our
choice for our dream mobile will be
Display – Screen size, resolution, browser support, movable keypad, reliable network
connectivity.
Storage – capacity to store large files, images, documents, downloaded programs
Battery – long-lasting and quick charging batteries that should be easily available in market.
Processing power – for remote work situations should able to process designing graphical
images, presentation, comfortable keypad, file sharing options.
Ease of use – for elderly or novice, helpful settings, and configuration.
Camera– with high-quality picture, zoom effects, large pixel resolution.
Accessories should include the charger, battery, handsfree and screen guard

The warranty should include any online help in case of difficulty to use mobile, repair of mobile
due to hardware fault or replacement of mobile set.

6) What do you mean by quality?


Answer: Quality of a product or service can be defined as a level of reliability, that meets or
exceeds expectations of end-user. For example, the taste of Amul ice cream or any of the dairy
products available in the market produced by Amul is reliable for the quality, new products
introduced in market also exceed the expectation.

7) What do you mean by performance?


Answer: Performance of a product or service is a measure of achieving continuously preferred
results in the most efficient and effective way. For example, Toyota Motor Corporation produces
cars that run more mileage with less fuel consumption and produce lesser pollution.

Page | 4
8) Can you write possible test cases for a pencil?
Answer: Following are possible test cases for pencil
1. Check the length of a pencil, strength of the outer wooden body,
2. Check thickness and resilience of graphite material (one type of crystaline carbon black in
colour )
3. Check readability after writing text using pencil
4. Check if written on different types of paper, cloth, or wood.
5. Check how many meters can be written with the available graphite material in single pencil.
6. Check the written text on paper is erasable with a normal rubber eraser.
7. Check if a normal sharpener can sharpen the pencil or not
8. Check if you can write after graphite is dipped in water, oil or dust.
9. Check if the name of the company written has correct spelling printed on pencil or not.
10. Check if graphite are not broken already or brittle.

9) What do you test in One Time Password (OTP) creation application?


Answer: Before processing online financial transactions, a bank will send One Time password
(OTP) on the registered mobile number of the customer trying to send money to the payee. OTP
sent on mobile or an email address acts as a measure to verify that person is genuine.
The following are possible scenarios for OTP received on mobile.
1. OTP should be received within the specific time period,
2. OTP must only be received over the registered mobile number or email address provided
3. Previously sent OTP if used should not allow any transaction
4. Expired OTP should not be used in any transaction
5. Already used OTP can not be reapplied for any other transactions.
6. There should be a facility to receive OTP again.
7. The resent OTP should not match with any of the previously sent or future OTP.
8. OTP should be case sensitive and should not be accepted if not used exactly as received on
mobile or email.

10) What are the essentials of software testing?


Answer: Following are important artifacts essential for testing any software application
Test strategy is high-level document that defines test approach for the software, what features
are essential to test (objective of testing), how to test (methodology), Types of testing to be
carried out, and execution of tests.
Test plan decides which tests are for manual testing and which one is for automated testing
(distribution of testing task), Who will test what(test schedule), and when to start testing and end
testing (duration within which testing should complete)
Test cases are scenarios with steps to be carried out, mapped to requirements with the expected
output, to be carried out during testing of an application with status for each scenario, based on
the actual result. Test cases can be executed manually or converted into scripts to be executed
with the help of tools like selenium or QTP.

Page | 5
Test Data is the valid values that are fed to an application as inputs while running an application
in order to test it. It is mandatory to design valid test data as per the scenario that results in
expected output. In case the actual output differs from the expected output, the deviation is
reported as a bug in the defect management system.
Test Environment is a system configured that mimick or match to system specifications at the
client, in order to run software on this system to verify how the system at client behave for the
tests and use cases.

11) What is required for the tester to know before testing software applications?
Answer: In order to test, a tester should first understand
 The requirements and output expected by using a software application and from software
requirement document approved by the customer and project owner
 How software works, domain knowledge (software used in specific discipline or field such as
e-commerce, Banking, Insurance, Enterprise Resources planning, Gaming, Education or
training, or Search-based application)
 whether the software is desktop based or web based
 what are the features and its functionality,
 How many input forms to be filled in, What are the input fields and their valid values,
 How user interface elements like text field, radio button, checkbox, drop-down list, buttons
and their types (submit, reset, cancel) functions.
 What to expect in an output form.
 Working of computer, types of networks.
 In case of desktop application, what technology is used in developing a software
 How to install the software?
 What technology is used in building user interface? (HTML, XHTML, JSP, ASP, Javascript,
VBScript, JQuery)
 Where reference data gets stored, where data for analysis will be uploaded and then
processed
 What database type is used to store data?

12) What are desktop applications?


Answer: Desktop applications are those software that can be installed on standalone machine
called as client machine (desktop or laptop). These software use native resources of standalone
machine such as network, CPU, memory and storage, in order to perform specific task for which

Page | 6
they are designed for. Desktop applications are designed to run on standalone machine, by single
user. Multiple users can access the printer, scanners if they are LAN connected with desktop
applications.
Some examples of desktop application are Windows file explorer – to access files stored on hard
drive of local machine, Microsoft’s office applications such as word, excel, PowerPoint to write
and access documents, generate tabular reports on finance and design presentations, Web
browsers to access websites and searching information on the internet.

13) How to test desktop applications?


Answer: Desktop applications are feature-based applications, where users should be proficient in
operating such applications, understand its features, accessing the menu, submenu. software’s
features can be tested with Graphical user interface tests, end to end testing, and functional
testing. Non-functional testing will depend on stand-alone machine’s limited resources such as
CPU, memory, storage, accessing files, or use features like printer/scanner if desktop
applications are connected in local network.

14) What are web-based applications?


Answer: Web-based application need web server in order to host them, visitors need internet
connection and need a browser to access the web site, internally web sites process user requests
and send responses via hyper Text Transfer Protocol(HTTP) . Multiple users can access same
feature of web application at same time simultaneously.
examples of web-based application are e-commerce portals for online purchase of products of
our choice (amazon.com, Flipkart, bookmyshow.com), websites of most of the companies,
universities, search engines (google.com, altavista.com)

15) How to test web-based applications?


Answer: web-based applications require browsers such as (Internet Explorer, Chrome, Firefox,
Safari, Opera), and a reliable internet connection to explore. Web-based applications can be
tested for functionality testing for
 any invalid page redirects,
 broken links, page not displaying.
 Working of web elements such as input field, drop-down list, checkbox, radio button, submit
button.
 verify for valid input data entered,
 methods used while data submits,

Page | 7
 compatibility tests for browsers used,
 performance to test latency (time taken to access pages), delay in opening next pages or
output, and
 security testing for verifying login for authentication.

16) What are anomalies in software?


Answer: Anomalies are something that deviates from normal, standard or expected. Based on
different situations anomalies are termed as listed below
Error – When the developer identifies mistakes in his code, he says Error for the anomaly.
Defect – When Tester discovers and reports the anomaly, he says Defect to the anomaly.
Bug – When the reported defect is accepted by the developer, it is called Bug.
Failure – When software build does not meet requirements, it is called a failure by the product
owner.
Wrong – when there is a deviation from specification or requirements not understood, the
anomaly is termed as wrong
Missing – when a feature is missing after the software is deployed at the client site, it is said
features are missing.
Extra – when the developer produces the feature more than the requirement, it is called an extra
feature. it will be termed as an anomaly as you are giving what is not asked for.

17) What are the types of defects in software applications?


Answer: Various defects found in the software are as listed below
Arithmetic defects – are numerical data related defects, like not displaying decimal points in
case of banking, scientific, or e-commerce sites, these defects occur due to mistakes from the
developer side.
Logical defects – are due to not understanding business logic for the required output, like if age
>=18 you will get driving license, in case developer reverses the condition, even with age equal
to or greater than 18, you won’t get a license, but will get for age less than 18 years, that
adversely affect real-time situation.
Syntax defects – occur if the condition required is not applied properly by developer, like in
software that corrects grammar in sentence, say to locate vowels in sentence i.e word beginning
with a, e, i, o, and u characters, will be a vowel, and should proceed with letter ‘an’. If developer
forgets to enforce this condition, vowel can’t be found or corrected if ‘an’ is not preceding it.
Multithreading defects – multithreading is an ability of CPU to execute multiple tasks
simultaneously. If developer cannot able to produce such ability programmatically, then
application cannot execute multi tasking, such as downloading an image in web page and
rendering it on screen.
Interface defects – If developer cannot maintain order in which data flow should follow or page
displayed after current displayed page, then it is called interface related defect.

Page | 8
Performance defects – If latency (delay in displaying page) is too high, If server crashes during
multiuser access, these are examples of performance defect. This can affect adversely and user
will not return back to website.

18) How many different ways you can test software?


Answer: There are two possible way software can be tested, Manual and automation.
Manual testing – a tester will run the software and follows the steps described in test case in
order to verify the requirement, in manual testing tester has to sit in front of software and test it
without any tool, as well record test status manually.
Automation testing – a tester writes a script that gets executed with help of automation tool
which follows the steps described in test case in order to verify the requirement, the test results
are also recorded automatically without any manual intervention.
Automation tools like selenium, UFT, JUnit are used with script written in Java, Ruby, python,
C++ etc. languages.

19) What is expected from the testing team on testing a software application?
Answer: It is expected while testing a software, tester should reveal all the defects and
deviations from requirements, while running an application such that it should break. Tester
should understand domain knowledge, able to design actual scenarios, conditions that are not
thought of and not handled by developer, able to configure specifications and preconditions to
verify how application performs. Have analytical knowledge and logical thinking; think out of
box while testing software.

20) What is Unit testing?


Answer: Unit testing is primary test level, one way is static testing, where code is verified for
syntax, rules followed by organization which is conducted by developer, second way is dynamic
testing where small snippet of code is debug (tested) with sample test data to validate the output.
various tools for unit testing are JUnit, Hansel, and TestNG are used to verify code coverage.

21) What is sanity testing?


Answer: When application build is released after bugs fixed from the developer, and or changes
due to additional requirement, the testing carried out is called sanity test, to verify that bugs are
fixed, still functionality is in place, and no new bugs or defects are observed. In case while
running sanity tests, bugs still exists, testers can reject the build.
example of sanity test can be like remember me checkbox was installed against the bug raised,
but forget password link stops working, then it is a new bug.

Page | 9
22) What is smoke testing?
Answer: When software build is released, tester conducts primary tests like all the menus and
submenus are clickable, and display the corresponding page, tester make sure that modules and
feature are present in application, and there is absence of ‘Page Not found’ message while
accessing any page, Forms and Pages have all usable web elements and display stable pages.
example, drop down list in all the input form does not display items for user to select, due to any
reason, this if found during the smoke test, then tester will stop testing and can reject the build by
informing the short coming to development team.

23) What is exploratory testing?


Answer: Tester use testing experience, while testing an application, explores the features and
learn about how the application works, during testing, he makes note of how the application
behaves, such tests are called exploratory testing. The requirement document is absent, and
testers are exposed to the application first time, without any test cases created.

24) What is integration testing?


Answer: Integration testing is the second level of testing after unit testing, where different
modules are combined together and then tested for verifying that data flow in sync between the
modules and there is no a broken page or failed functionality.
example – During integration testing, IRCTC site can be checked where after searching train,
booking seats in particular train, when payment gateway, which is integrated in to application
found not working.

25) What is system testing?


Answer: System testing is the third level of testing after integration testing, where the
application under test is tested for an end to end functionality, to confirm that it works as desired.
example – matrimonial portal can be tested from registration, searching candidate, receiving
contact details and meet or fix appointments with prospects.

26) What is Interface testing?


Answer: Interface testing is a verifying communication and data transfer between two different
systems, where interface can be API or web services.

Page | 10
example – Booking air tickets using ticketing portals like goibibo.com, where ticket is booked
using web service of the airlines showing flight time, destinations, availability of seats and fare
to travel to destination from starting point.

27) What is Regression testing?


Answer: Regression testing is conducted on the build after bugs are fixed build, to validate that
code change to fix bug has not adversely affected functionality and there should not be another
defect.

28) What is Alpha testing?


Answer: Alpha testing is a type of acceptance testing, where testers are employees of an
organization who has build the application, these tests are conducted to verify that all the issues
found have been resolved and have not reoccurred, before releasing to the client.

29) What is Beta testing?


Answer: Beta testing is tests conducted at the client’s site after application is deployed and
handed over to client. These tests include usability, functionality, and reliability of application.

30) What is performance testing?


Answer: Performance testing falls under non-functional testing type, where latency(speed or
delay in accessing or loading a page), responsiveness and stability of application, network, stress
or load tests are carried out to check efficiency/performance of application.

31) What is Load testing?


Answer: Load testing is one form of non-functional testing, in which behavior of application is
observed when it is exposed to load.
example, verifying behavior of netflix portal during movie streaming by viewers between
evening 7 pm to 9 pm in any time zone.

32) What is Stress testing?


Answer: This non-functional testing is conducted by subjecting an application to overload in
order to verify till how long system is sustaining to the stess, hence the name – Stress testing.

Page | 11
example – during amazon festive season sale, subjected to overload when users multifold times
than expected will access the portal and book a newly arrived mobile, there by website server
may fail to handle such an heavy load.

33) What is Security testing?


Answer: Security testing is a testing of an application against malpractice from hacker, how
effective protective software like firewall or antivirus installed are in data protection, and
vulnerabilities of login system by sql injection.

34) What is Static testing?


Answer: Software or an application is tested without executing code, such as Code Review,
coverage that business logic is properly taken care is called Static testing. variable declared but
not used in code, undefined variables, unreachable code, syntax violations and code structure
approved in organisation. Tools like code compare, coverity, parasoft are used for static code
analysis

35) What is dynamic testing?


Answer: For dynamic testing, application should have compiled code and executed in order to
run application, various parameters such as CPU, memory, latency or time taken for output, are
analyzed and recorded. Valid input values are prepared and expected output values are listed as
requirement. Main test types included in dynamic testing are functional and non-functional
testing. test level included in dynamic testing are Unit, integration, system and acceptance
testing.

36) What is Compatibility testing?


Answer: Compatibility testing are conducted to verify that software runs on various
environments, operating systems without any conflicts. Compatibility of an application is tested
across different Hardware configuration, operating systems like Ubuntu, Linux, windows,
MacOS, Network, Browsers like firefox, chrome, opera, safari, various devices like desktop pc,
laptop pc, mobile, etc.

37) What is Reliability testing?


Answer: Reliability testing is carried out in order to confirm that software display reliable output
that is same irrespective of test environment, operating system, browser etc.

Page | 12
38) What is Compliance testing?
Answer: Compliance testing is a non-functional test that validates that the software designed
meets all the prescribed standards as described in requirement document. for example Vehicles
in North America are made according to Canadian Environmental Protection Act 1999 (CEPA
1999), under this act Environment Canada has an authority to regulate emission from on-road
engines.

39) What is Localization testing?


Answer: Localization tests verify that application can be used in specific region. The test include
user interface, language, currency format, date and time format for that specific continent or
country having particular language dominance.
Example, In case software developed specific for middle east, language will be Arabic, currency
being riyal and dirham for united arab emirates. date format in Saudi Arabia is dd/mm/yyyy.

40) What is test case?


Answer: test case is set of instructions and steps to be followed to validate particular feature
should fulfill requirement specified in software requirement document. test cases can be derived
from requirement traceability matrix, which is derived from requirement document.

41) What columns are present in test case template?


Answer: test case template should have details common across test case such as test case created
by, tested by, tested on,module name tested with their details.test case template should contain
columns as listed and explained below
 Test case id – unique identification of test case
 Requirement Traceability Matrix id – test case scenarios or condition mapped with RTM id.
 Test scenario – short description of what should be tested eg. user should able to log in
 Pre Requisite – assumption for test to carry out, such as application log in page is already
displayed in browser or desktop.
 Test steps – steps to follow in order to test the scenario, manually or using script
automatically
 Test data used – valid test data created specific to the scenario eg. username – admin and
password test123 to be used

Page | 13
 Expected Result – what is expected from the feature being tested e.g. welcome page with
menus of other features should be displayed after user successfully logged in to the
application.
 Actual Result- what is actual output or result after testing application, this is to be filled in by
tester
 Status – If there is difference between actual and expected result test will fail, else test will
pass
 Remarks – In case test fails, bug report details can be mentioned here.

42) What columns are important in testcase?


Answer: Important columns in test case common across IT industry are as below
test case id, test scenario, description, prerequisite, test steps, test data, expected result, actual
result, status, remarks

43) What test case management tool have you used?


Answer: test case management tools I have used are testlink, JIRA.

44) What is use case?


Answer: Use case describes how person utilizes system or process to achieve his goal. it helps to
assess entire process, which part of the process is error prone. Main elements of use case are
Actor, System and Goal. Stakeholders, preconditions, and triggers are additional elements of the
use case.

45) Explain main elements of use case.


Answer: main elements of use case are Actor, System and Goal.
 Actor in Use case – is an end user, single or group of people, interacting with a process
 System is the process required to reach final outcome.
 Goal is successful user outcome.

46) What is test scenario?

Page | 14
Answer: Test scenario is functionality or feature that can be tested. It also provides high level
idea of what need to be tested, in order to create scenario we need set of test cases where we can
understand features of application and any short comings of application.

47) What is a positive test case?


Answer: positive test cases ensure that using valid data, application performs required output as
expected or not. With positive test case, tester decides that feature provided works if provided
with valid test data.

48) What is a negative test case?


Answer: negative test cases are performed to try break the system, by providing invalid data, or
following path not proposed, main intension here is to uncover hidden defects, that are otherwise
remain in the software.

49) What is Behavior Driven Testing?


Answer: behavior driven testing focuses more on user behavior in certain conditions (say how
printing a document in case he receives a message for “page area out of margin” =- how will he
reacts…, normally) rather than technical functionality of software.

50) What is Acceptance Testing?


Answer: Acceptance testing is final level in software testing, where purpose of test is to analyze
if software features are in compliance with business requirement, and can we deliver to the
client, does all features functions as expected, and with the features can we deploy software on
production environment.

51) What is Vulnerability testing?


Answer: vulnerability testing are assessment of software and underlined infrastructure, to reveal
security loopholes or risks that are critical present in software due to which some loss should be
incurred.
Example – some application requires end user’s email address as username as log in credential,
registering email can offer a risk of receiving unsolicited mails.

Page | 15
52) What is black box testing?
Answer: When we test application without worrying or having knowledge about details of
implementation, how internal code structure applied to software to achieve required output. it is
called black box testing. This type of testing is carried out mainly by testers. Some of the testing
techniques for black box testing are Equivalence Partitioning, Boundary Value Analysis, and
Cause Effect Testing.

53) What is white box testing?


Answer: when internal implementation and internal code structure are known to the tester, while
testing an application, it is called white box testing. White box testing involves code verification
for security holes, poorly structured code process path, data flow of inputs in code, conditional
loop, testing of statement, object, and functions in each code class. Some of the testing
techniques for white box testing are Statement Coverage, Branch Coverage, Decision, Condition,
Control flow and Data flow testing.

54) What is grey box testing?


Answer: When tester has partial knowledge of internal working and features of an application.
Grey box testing is conducted to find defects due to code structure, improper functionality and
missing condition in the feature. Various techniques used in grey box testing are Matrix testing,
regression testing, orthogonal array testing, pattern testing.

55) What are the different levels of testing?


Answer: In Software Development Life Cycle, there are mainly four testing levels –starting from
Unit testing, followed by Integration testing, System testing, and finally user Acceptance testing.

56) Explain integration testing of modules in real life example ?


Answer: When testers testing of various modules that are linked together in order to accomplish
features expected to accomplish. Testing modules in combination are called integration tests.
example – After log in to Amazon portal, user can view his orders history, pending orders,
Amazon wallet details, Prime videos streamed from where he can re order already procured item
using his wallet balance amount as well as check video or movies already streamed. Integration
tests require tester to check log in details of a user, that has placed orders and has purchased from
amazon in past, also should be a prime member to avail facility like music, movie and free of
charge deliveries.

Page | 16
57) What is Top Down Approach?
Answer: Top Down Approach of testing is breaking down complex module into smaller portions
till it becomes easy for assessment.
Example – Top management forms rules for organization, middle level management and lower
level employees has to follow the rules enforced.

58) What is Stub in Top Down Approach of integration testing?


Answer: Stubs are the called programs that temporarily replace the missing modules, help in
testing integration testing, where flow of data is takes place from Top to down approach.

59) What is Bottom Up Approach?


Answer: Bottom Up Approach of testing is combining smaller modules which are easy to test,
into larger single complex module.
Example – Small group of students assess the situation or problem, find solution to resolve it.
The solution is discussed with teachers and then applied to other groups, and on successful
outcome, becomes appeal to higher management, who can make it implementation.

60) What is Driver in Bottom Up Approach of integration testing?


Answer: Test Drivers are calling modules that are temporary replacement of upper level module
that are not yet integrated. Drivers fill the gap of absence of modules to verify flow of data to
higher level modules.

61) What is GUI or UI testing?


Answer: GUI ie. Graphical User interface, relates to frame or screen displayed to end user as an
interface that makes them easier to access an application or software. In case of desktop
application, microsoft office or paint opens up user interface when paint.exe file gets executed,
In case of web based application, all the portals that opens index.html page where user can check
all general information about the website, and has login and signup links, allowing new user to
register and existing user to log in.

62) What is functional testing?


Answer: Functional testing is test working of web elements; drop down, buttons, check box or
radio button, and features of an application. Functional testing is categorized into various types

Page | 17
such as unit test, integration tests, GUI tests, localization tests, usability tests, regression tests,
system tests.
Example: on clicking print button, a pop menu should display showing existing page and print
configuration window, with print button. On clicking on print button, contents such as text,
images or spreadsheets on selected page should be sent for printing.

63) What is non-functional testing?


Answer: Non functional testing deals with testing parameters other than features of an
application, these include performance, reliability, security, integrity, scalability, portability, etc.
Example: In case of desktop software say calculator, how quickly it displays an output, for
multiplication of four digit numerals. In web based application, how quickly an image is
rendered on the webpage, or if site is available 24×7 or is subjected to frequent maintenance,
making it non-available to end users.

64) What is requirement traceability matrix?


Answer: requirement traceability matrix (RTM) is a document that maps test cases with the
requirements discussed in software requirement document. RTM is a single document that make
sure that all the requirements are mapped and are covered and has test cases corresponding to the
requirement.

65) What is the defect traceability matrix?


Answer: Defect traceability matrix is a document that maps defects if any with corresponding
test cases, this document helps to trace defects, test cases and requirements thereby gives an idea
of whether defects have been resolved or not, if resolved and build is received, then test cases
selected for regression tests corresponding to this defect and some integration test cases to make
sure defect has been resolved.

66) What are the techniques used in test design?


Answer: Following are few techniques used in test case design
i) Equivalence Partitioning

ii) Boundary Value Analysis

iii) Decision Table

Page | 18
iv) State Transition

v) Error Guessing

67) Give example of Equivalence Class Partition.


Answer:
Test Scenario- In order to get a driving license the age of applicant should be between 18 to 49
years.

There will be 3 (three) partition where tester should check possibility

i) If applicant’s age is less than or equal to 17 years – Invalid

ii) If applicant’s age is between 18 to 49 years. – Valid

iii) If applicant’s age is greater than or equal to 50 – Invalid

So there will be 3 possible scenarios where only one valid group of applicant having age is
between 18 to 49 years, will get driving license.

68) Give example of Boundary value analysis


Test Scenario- In order to get a driver’s licence, the age range should be between 18 to 49 years.

Boundary values to be verified here is

First Boundary value

minimum age – 1 i.e. 18-1 = 17 years – invalid age

Second Boundary value

Page | 19
minimum i.e. 18 years, minimum +1 i.e. 19 years, maximum -1 i.e. 48 years, and maximum i.e.
49 years

(18,19, 48, 49) – valid values for age criteria

Third Boundary value

maximum +1 = 50 years – invalid age

69) Give example of Decision Table


Answer:
Scenario – You want to buy headphone and have budget Rs 1000

You have following buying options

i) Vijay Sales

ii) Reliance Digital

iii) Croma

iv) Amazon

Based on Answers to the following queries, we will be able to decide

where should we buy headphone from

 Can take trials before purchase


 Have EMI options
 Accepts Credit Cards
 Accepts Cash on Delivery
 Do they have return policy

Page | 20
 Have Item in your budget?

Find Decision table

Conditions Vijay Sales Reliance Digital Croma Amazon.in

Can take trials before purchase Yes Yes Yes No

Have EMI options Yes No No Yes

Accepts Credit Cards Yes Yes Yes Yes

Accepts Cash on Delivery No No No Yes

Do they have return policy Yes No Yes No

Have Item in your budget? Yes Yes No Yes

70) Can you explain Defect Life Cycle?


Answer: When tester finds a defect while testing application, he will confirm deviation with
expected result, registers defect (bug) in bug management tool like Bugzilla or JIRA. Bug status
will be ‘New’, If defect is not agreed by product team or developer, its status will become
‘Rejected’.
When developer agrees with the defect in application, when assigned to developer, bug status
will be ‘Open’, If Developer does not agree to the defect; its status will be ‘Deferred’.

‘Open’ bugs when resolved by developer its status becomes ‘Fixed’, once the bugs are fixed and
build is retested for regression testing, defect is verified, if defect is not resolved, bug will be
‘Reopen’, which will be reassigned to the developer for fixing. if defect is resolved and
confirmed by tester then Bug status will be ‘Closed’.

Page | 21
Page | 22
71) What is Defect severity?
Answer: Severity of bug is an extreme level of damage like financial loss, company’s reputation
and loss of life, due to presence of the bug. example such as if point of sales machine does not
function as expected, and does not dispense bill, thereby customer may not pay the amount for
the purchases, in such situation, the defect due to which bills are not displaying amount of
purchase, is termed as severe test case, as due to such defect, there will be huge financial loss.
further say, infrared machine that used for removing decay in the teeth malfunction and damages
the jaw of patient, it may result into loss of life.
Defect severity are categorized into following levels

Blocker – Due to this defect type, it becomes impossible to further run the application, there for
the name – Blocker
Critical – There are some workarounds to accomplish the task, e.g. pdf format of file type is not
downloaded, where as word type is possible.
Major – some error may lead to understanding the title or content by end user, e.g. software
displays title and content in English, but does not display some of the title in Arabic language,
but display it in English only.

Page | 23
Minor – there are some defects which has very minor impact on functionality of application, e.g.
missing space between words, commas are missed in sentences.
Low -These defects does not impact at all, however if fixed it will be aesthetically pleasing, eg.
size of button, form border go out of screen and need to scroll in order to view the content.

72) What is Defect priority?


Answer: Priority gives a need of urgency to fix or resolve the defect,
Example can be if a reputed pen manufactures company while printing the pen model or
company name will wrong spellings, then such bugs should be fixed on priority basis.

Defect priority are categorized into following levels

Urgent – this must be fixed immediately e.g. payment gateway pages not displaying, or
confirmance of order processed not sent via email or sms, or transaction records not printed in
account details in banking software.
High – this should be resolved in subsequent releases, e.g. presentation or video does not have
company logo or has written content, but does not have voice that narates above content.
Medium – should be fixed based on the level of severity- eg. error occuring while user updates
his mobile number, while communication has options such as his email and mobile.
Low – May or may not be fixed e.g. spelling or grammar mistake in introductory page of portal,
as long as meaning is conveyed to the audience.

73) Difference between quality assurance and quality control.


Answer: Quality assurance (QA) is targeted for avoiding defect, where as quality control (QC) is
aimed at identify defect and fix these defects. QA is process focused where as QC is end product
focused. Quality Assurance team usually in manufacturing industry gathers certification related
to quality of raw materials used, machineries used in processing the end product and final
product. Whereas Quality Control team is software testers inspects by running or analyzing steps
followed in products and services to make sure that it is working fine as per expected standards.

74) What is difference between inspection and audit?


Answer: Inspection is an observation where a site is expected to perform or follow standards as
compliance obligations, where as audit is a process of checking if obligations are met or not.
Inspections are simple, quantitative and help create actions, whereas audits are complex,
qualitative and forms recommendations.

Page | 24
75) What is Quality assessment measurement?
Answer: It is a analysis to observe deviation between actual performance and expected
performance. Basis of assessment is an improvement in actual performance, whether new
hardware, or additional storage capacity or memory improvement or line of code that does not
consume processing power, but quickly display output.

76) What is test management measurement?


Answer: It is important for test managers to keep an account of test procedures followed, test
plan, test methodology, justification of number of test cases required to be conducted manually
in order to verify complete feature coverage, and why these manual test case not able to be
carried out using script, automatically, and finally after executing said number of tests both
manual and automatically, how many defects have been captured. There are various test
management tools that help manager with reports on what is optimum effort put in testing and
what is final outcome. These tools have built-in test ware management; test scheduling, test
tracking, incident management, and test reporting.

77) What is test maturity model?


Answer: Based on the level of maturity model i.e. implementation of various processes of
software life cycle, adherence of procedures even during critical and crisis situation is called test
maturity model.

78) How is level of software development organizations decided?


Answer: Based on Capability Maturity Model (CMM), software development organization’s
level are decided. There are five levels
 Level 1 – there is an ad hoc testing, chaotic work culture and no adherence to process during
time of crisis, they always use new and undocumented repeat process during software life
cycle.
 Level 2 – The processes are defined and same steps are repeated during each new project.
 Level 3 – There is standard business process in each of the defined processes followed
without any alterations.
 Level 4 – The mapping of the processes are managed accordance with agreed upon metrics.
 Level 5 – there is regular and frequent process optimization and improvement during process
management.

79) What is Process Capability Measurement?

Page | 25
Answer: There is a measure of process capability calculated using specification limits and
standard deviation of the process, which is Cp index. Most companies require Process Cp = 1.33
or greater.

80) What is difference between Corrective actions and preventive actions?


Answer: The term used in short is CAPA, stands for Corrective Action Preventive Action.
Corrective Action Preventive Action (CAPA) is a process which

 investigates and solves problems,


 identifies causes,
 takes corrective action and
 Prevents recurrence of the root causes.
example – when we fall sick, we seek medical attention, and health care specialist offer us
remedy and relief, but what if we do not get relief or do not recover. We ask for corrective
actions and we think of preventive action as well.

81) What is Software Testing Life Cycle?


Answer: Software Testing Life Cycle (STLC) is a sequence of activities performed by testers
such as
 Requirement & Analysis – Understanding the client’s requirement and what actually requires,
How to test the requirements,
 Test Planning – what should be tested in an application, How and who will test the
application
 Test Case Design – test scenarios, mapping with requirement traceability matrix, test case
creation, and test data used
 Test Environment Setup – what hardware and software need to install or configure to build
test environment.
 Test Execution – running the application in order to verify features as per test case designed,
reporting bugs, track the bugs and regression test till it gets resolved.
 Test Closure – Creation of test reports, total bugs pending, critical bugs if any, justification
for releasing application to client.

Page | 26
82) What is Requirement Specification Document?
Answer: Document approved by customers and project owners that describe, what is expected
from the software to perform, how many features and functionality, what is requirement (what to
verify/validate). In short, Software requirement specification document has a purpose for
software to be built, description of software to accomplish and requirement in specific required
to fulfill using the software.

83) What documents will you refer to understand about features in the software?
Answer: In order to understand features and their functionality we refer requirement document
(SRS).
In order to understand overview of data flow, integration between systems, we should refer
design document, For understanding documentation on code, algorithms, interfaces and APIs
used in software technical documents or process documentation containing UML diagrams, How
end user will use the software we can find from user manual, and finally how to install the
software can be found from installation guide of the software.

84) What is a virus?


Answer: computer virus is a type of computer program that if found in network and get installed
in our computer, it will infect all other software present in our computer, and make them
malfunction (does not function as expected, or stop to work). It is compulsory to remove this
virus from the computer, in order to safely execute and perform our tasks as desired.

85) How antivirus program works?


Answer: Antivirus programs prevent, detect, and remove malware, including computer viruses,
worms, and Trojan horses. Various Antivirus programs available in market are Norton Antivirus
Plus 2020, McAfee Total protection, Quick Heal etc.

86) Give few examples of sensitive information can be shared across network?
Answer: There are many incidents where we unknowingly share our information across network;
they are our email address- we may receive spam messages i.e messages for which we have not
granted permission to receive. they may contain, files attached that if opened may contain virus,
or may have damaging software. Our mobile number is second confidential information, we may
receive calls from persons we don’t know, they may harass us by calling at any time, demanding
donations, or try to send sms messages, may use our email and mobile number against our
knowledge in criminal and unlawful activities. Our credit card details like 16 digits number, pin
number – this will drain our all the money from our account and we will be unaware until
collection agencies knock our doors, or we receive the withdrawal notice via mail or mobile

Page | 27
number. Our pictures or anything that may be used against our self esteem over Social media
platform like Facebook or Instagram are sensitive information.

87) What is IDE and their use ?


Answer: Integrated development environment (IDE) is a tool that facilitates code creation,
building the program and debug (test) the code. IDE brings together text editor, integration of
code libraries, compilers, debugging facility and running the code. IDE supports various
languages and their libraries so that developers can write code and test their code in IDE itself.
Web based IDEs help creation of web based application using HTML and Javascript.

88) List name of IDE made of Java.


Answer: Eclipse, IntelliJ IDEA and NetBeans are some examples of IDE made from using Java
programming language.

89) Give some examples of use of Java applets used in your application
Answer: Java applets were used to select local files from client machine in order to process them,
HTTP protocol sends these files over to server location.

90) What is required to run Java applet in a browser?


Answer: The Java Runtime environment, JRE is required as plug in in order to run Java applet in
a firefox browser.

91) Can you explain methods used in applet life cycle?


Answer: When applet begins following methods are called
 init() – init() is first method being called, we can initialize our variables here, init() is called
only once during run time of an applet.
 start() – start() method is called after init() has been called, start() is called everytime HTML
page is displayed on screen. start() method help to restart stopped applet.
 paint() – paint() method is called when applet begins its execution.paint() method has
Graphics param, with Graphics object, we can draw Shapes.
When an Applet is terminated following methods are called

Page | 28
 stop() – stop() method is called by browser or appletviewer to suspect execution of applet
 destroy() – destroy() method is called once before browser unloads the applet.

92) What is JRE?


Answer: Java Runtime Environment contains Java Virtual machine, libraries and other
components to run applets and applications written in Java.
JVM + libraries+other components= JRE

93) What is JVM?


Answer: Java virtual machine helps run java bytecodes. when .java file are compiled using javac
compiler into .class file. these .class file contain bytecode understood by Java virtual machine.

94) Why do we need JDK?


Answer: Java Development Kit (JDK) contains JRE and compilers and debuggers for developing
applets and applications.

95) How JRE, JVM and JDK related?


Answer:
 JVM help run java bytecodes created by compiling .java files into .class files.
 JRE contains JVM (Java Virtual Machine), libraries and other components to run Java applets
and applications
 JDK contains JRE, compilers and debugger (development environment for applications using
Java programming language)

96) List types of class loaders in Java


Answer: Java has 3 kind of class loaders Bootstrap, extension and application class loader.

97) What is a difference between JRE and JVM?


Answer: (Java Runtime Environment) JRE contains Java Virtual Machine (JVM) + Java
packages (util, math, lang, awt, etc) + runtime librariesYou need to install JRE on your machine
in order to run Java applications or applets.

Page | 29
Java compiler Javac converts .java file into .class files which contain bytecode, (Java Virtual
Machine) JVM converts bytecode into machine language. JVM is platform dependent, there are
different JVM for different OS, Bytecode converted into machine language for particular
machine, executes depending on its kernel. Without JVM you cannot run Java Applications.

98) What is difference between interpreter and compiler?


Answer: Both compilers and interpreters are used to convert program written in high level
language into machine code understood by computers.
Interpreter converts program one statement at a time, takes less time in analyzing source code,
slower than compiler, there is no intermediate object formed, hence memory efficient

Compilers scans entire program and then converts it as a whole into machine language, takes
more time analyzing source code, however it is faster than interpreter, generates intermediate
object code hence takes more memory.

Programming languages like Javascript, Python and Ruby use interpreters

Programming languages like C, C++ and Java use compilers.

99) What exe stands for?


Answer: exe is a filename extension for program that gets executed on microsoft Windows
operating system. Executable file can be run by a program in Microsoft DOS or Windows
through command line or by double clicking over .exe file using mouse.
COM and BAT are other executable file types in Windows.

100) Give some examples of executables in Windows


Answer: various programs like mspaint.exe runs paint application on windows machine,
forefox.exe runs firefox browser, MS word exe run document editing software for windows
Adobe Acrobat reader exe file runs to read pdf files in windows.

101) Give name of four Java framework


Answer: Spring, Hibernate, Struts, JSF are some well known Java framework

Page | 30
102) Can you explain Hibernate framework?
Answer: Hibernate is Object Relational Mapping tool (ORM) that simplifies java application
development and interacts with database. It implements Java Persistence API for data
persistence.

103) A type of testing in order to expose defects in the interfaces and in the interaction
between integrated components is?
Answer: Integration Level Testing

104) Identify type of testing wherein we subject the target of the test, to varying workloads
to measure and evaluate the performance behaviors and the ability of the target and the
test to continue to function properly under these different workloads?
Answer: Load Testing

105) What do you ask for in order to purchase computer?


Answer: There are few questions listed below we should ask ourselves and find their answers
before deciding on purchase of computer,
1. Desktop or Laptop? – If you get same performance from laptop as well as desktop, it would
be cheaper to purchase desktop, in case you can manage steady workstation and space where
you can concentrate on your study or work. Otherwise if you are required to carry your
machine under BYOD (Bring your own device) policy, able to manage power cables along
with you to and from the work on daily basis, laptop may be right choice.
2. What is a processor you are looking for? – What Processing power are you looking for,
number of cores, speed of processer, data handled, etc. What is a main purpose of purchasing
a computer, for study, some assignments, or remote work as a developer or tester? or for
searching over an internet, for watching movies or play games.
3. How much RAM and why? – Random Access Memory or RAM help to speed up the things,
multitasking like loading applications, browsing internet, image editing or experience
graphics effect in gaming.
4. Hard Drive and their capacity, how much you really want? – In order to store more files, you
need more storage, desktop will have more storage capacity than laptop. Based on Gigabytes
of Hard drive you install, you pay more.
5. Peripherals – Peripherals like USB ports – how many do you need? For keyboard,headphone,
printer etc.

Page | 31
6. HDMI for viewing Television with TV tuner if you want to view it over your computer,
7. SD slot – SD card in case you want to keep your pictures, process these photos etc. you may
need them, with extra price.
8. Wi Fi – In case you want to connect your pc with wifi for internet or wifi enabled speakers
9. Bluetooth – In case you are looking for connecting various appliances using Bluetooth.
10. What Operating System Mac OS, Windows or Linux – What operating system you are
comfortable using your computer in, type of software loaded, remote work like tech support
will only require Linux operating system, where as windows may be helpful for various User
friendly applications, but may get virus if not protected with antivirus software.
11. Play Game, or watch movies or Search internet? What is your purpose of purchasing will
matter on how much you should spend after it.

106) What is a Difference between Regression and Retesting?


Answer: The difference between Regression and Retesting is explained below
Regression testing is the testing of an application that verifies that there is no adverse effect of
the changes made due to defect fix or change request to other areas of application. regression
testing involves test cases other than those that are related to defect or change as per client
request, but it also tests features that directly or indirectly connected with the feature that was
rectified by developer against the defect raised, such as integration tests, test case related to web
components and their functions along with those involved directly with defect raised. Regression
testing is usually carried out using automated scripts by selecting test cases and re executing the
scripts to run those test cases.

Retesting is a testing to make sure that previously failed test cases due to defect are passed and
the defect has been resolved. The test cases involved in retesting focus only on the failed test
cases due to the defect or the scenarios or steps followed result in failed functionality. It is better
to carry out manual testing in case of retesting to make sure that defect has actually been
resolved.

107) What is a difference between Debugging and Unit testing?


Answer: Debugging and unit testing are both carried out by developers, but in case of debugging,
code in focus is verified by debugging tool line by line for any syntax or programming level
issues such as runtime or compile-time exceptions or capturing and transferring data through
lines of code.
Unit testing is a testing of a unit or program for validating functionality carried out by developer,
essential to carry out to minimize bugs found at later stage like integration or system testing.
These testing are known as White Box testing.

Page | 32
108) What are Unit testing techniques?
Answer: The various unit testing techniques are listed below
 Statement Coverage
 Decision Coverage
 Branch Coverage
 Condition Coverage
 Control Flow
 Data Flow

109) How do you decide which test cases to consider for Regression Testing?
Answer: selection of test cases for regression testing for the build received from release, should
based on following scenario priority for testing those test cases that were failed due to defect, on
testing if they are passed. All integration tests, boundary value scenarios, testing functionality of
components related to defect, end to end tests that involve change request or resolved test cases
after release, should be considered for regression.

110) What is a Difference between Integration Testing and System Testing?


Answer: The difference between system testing and integration testing is listed below
System testing is a test level after unit tests and integration tests in software testing life cycle,
where application as a whole is tested end to end for functional as well as non-functional
requirements. It is performed after integration testing. Usability, performance, scalability and
security testing are involved.

Integration testing is testing of interconnected units and their interfaces, the data flow between
these units and to make sure that feature is working as per expected. it is carried out after unit
testing. Various test approach like top down, bottom up or hybrid integration are carried out
during testing.

Page | 33
111) What are the various contents of a Test Plan?
Answer: Test plan document should include following details
 Features to be tested
 Features not to be tested
 Approach like should we test manually, automated scripts, test techniques (white,black or
grey box)
 Criteria for Failed tests / pass tests
 What condition for suspending test activities
 Test environment such as hardware, software, network etc.
 Man hours estimated while testing
 specific training required, Risks involved, any assumptions or dependencies

112) Do you know Exploratory Testing?


Answer: Tests that are carried out while exploring an application, and learning about the
business requirements are called exploratory testing. These tests are carried out by manual testers
without referring to any test cases or test scripts. Exploratory tests are carried out by experienced
Software testers based on their previous testing expertise thereby test cases are designed during
test execution. Test steps carried out should be noted In case of any defect found during
exploratory testing, as there is no test cases and test steps written to carry out exploratory testing.

113) What is Prototyping? What are the various types?


Answer: software prototype is an application with limited features. prototype gives an idea of
how software is going to look like, input pages, output reports, ready to get feedback from end
users for any flaws and usability issues.
Software prototype types are listed below

 Horizontal prototype
 Vertical prototype
 Throwaway prototype
 Evolutionary prototype
 Incremental prototype
 Extreme prototype

Page | 34
114) What are SDLC phases?
Answer: The Software Development Life Cycle consists of following phases
 Requirement Gathering and Analysis
 Design
 Coding
 Testing
 Deployment
 Support

115) List some of the SDLC models used in software development?


Answer: famous SDLC models usually followed by companies depend on the requirement.
Waterfall, Iterative, V-model, Spiral, Big Bang, Agile

116) What kinds of reviews are conducted during SDLC phase?


Answer: Types of software reviews are
 Software Peer Review is a detailed examination of low level and high level design documents
by one or more individuals working on the project to find and resolve errors or defects in
application during early stages of SDLC.
 Code Review – review of code by peer developer will ensure that functionality is met
with as expected; there are no memory leaks or dead code which is not utilized while
coding.
 Pair Programming – Is a process where same portion of code is developed by pair of
developers individually and then most efficient code is finalized.
 Software Management Review – The project head verifies project progress, status of
plans and their status, infrastructure allocation to test and develop the application during
management review.
 Software Audit Reviews is an independent examination of product, process, assessment
with compliance to specifications.

117) What is the role of Metrics in Testing?


Answer: Software Testing Metrics is a quantitative measure that helps in estimating progress,
quality and well being of software testing efforts. This helps in improving efficiency and
effectiveness of software testing processes.

Page | 35
118) What are key challenges while testing a software application?
Answer: Some of the challenges of testing a software applications are listed below
 Test entire application – It is virtually impossible to test and verify entire application with
each and every scenario. Even one of the seven principles of software testing says,
“Exhaustive Testing is Not Possible”.
 Relationship with developers: Tester’s responsibility to check for any defects in the software
and how to break an application, it becomes tough to keep amicable relationship with
developers
 Regression testing: In every build released from developer, tester has to check entire
application for end to end functionality every time along with resolved defect and
components or units that are integrated that may get affected due to change request or
resolved defect.
 Testing always under time constraint: All the stack holders keep an eye on how the built has
came out, testers has to quickly start testing the build with sanity test, smoke test and
regression tests as send their observations as soon as possible.
 Which tests to execute first? – Based on available timeline, and complexity of modules, test
lead has to distribute testing like user interface or feature testing using script automatically
and regression and integration tests manually. Non functional testing using tools like load
runner, API testing using Postman or REST assured. Regression tests using selenium and
mobile testing using Appium.
 Understanding the requirements: There should be a walkthrough and review of software,
domain knowledge, how to test features etc. is mandatory for each member of tester.
 Decision to stop the testing: Testing manager should explain testers when should testing be
stopped, based on what critical bugs should get resolved, any blockers affecting feature
pending by developers.

119) Explain your views about Quality.


Answer: Software Quality work begins before the testing phase and continues after the software
is delivered. It is utmost important to deliver quality product to the end user, this will impart
confidence, reliability, long term partnership regards to the quality of product.
Quality is doing the right thing, doing it the right way, doing it right the first time, and doing it
on time without exceeding cost.

Page | 36
120) What is the advantage of using any bug tracking tool?
Answer: Main objective for using bug tracking tool is to deliver high quality software product by
keeping track of defect discovered and track these defects till it gets resolved, Improve Return on
Investment (ROI) by reducing cost of development, when quality product is developed, so that it
will have more reliable quality product, satisfied customers with long loyalty. Product and
Project team can keep a track of detect Issues Earlier and understand defect trends in ongoing
software development.
Better Communication, Teamwork and connectivity amongst stack holders about software
quality.

121)Explain about website Usability testing.


Answer: website usability testing is to measure and understand how web visitor would
experience navigating website to verify its features, accomplish their tasks and any pain points in
doing so.

122) What are defect attributes?


Answer: various properties in order to measure defect quality or nature in software can be known
as defect attributes, Defect attribute are properties that determine extent of damage due to the
defect on the software application. for example severity, priority, type of defect are some of the
examples.

123) What is pesticide paradox?


Answer: pesticide paradox is a principle wherein same set of test case if executed again and
again over interval of time, then these test cases are not capable of identifying any new defects in
the system. in order to overcome this effect, the set of test cases are regularly reviewed and
revised to make them effective.

124) Explain V model.


Answer: V model is a SDLC methodology where software development instead of moving
downwards like waterfall model, moves downwards and then back upwards in V shape, starting
with requirement analysis, system design, module design, unit testing, integration testing, system
testing, user acceptance testing

Page | 37
125) What is the difference between Web application and Client Server Application?
Answer: Client Server application is distributed on at least two systems, Client and Server where
client has visual pages like input forms, validation for valid data before sending requests to
server and output pages as response from server. Server has all business logic, database storage
where request received from client machines are responded back after processing through logic
and database tables, procedures. Client Server applications require LAN connection and
Database Drivers so that they are connected whenever request is sent for response. Some
examples are ATM machine, Banking software, and Stock Trading etc.
Web application are built in one server with all front end files, back end and processing logic
placed on single web server, various technologies such as HTML or ASP with Javascript or JS
libraries are used for front end design, where as back end storage and processing is done on
server in class files and DB procedures and tables. web application are accessed using web
browser, hence it require internet in addition to web application files placed on web server.
examples of web applications are Amazon, Flipkart and Snapdeal online portal, Gmail, Saavn
online music streaming services

126) What is Localization testing?


Answer: Localization testing is validating software that is customized for users for specific
language or country. Where user interface will be displayed in english are translated into the
country specific local known language, in addition the currency and time denomination and any
instructions are displayed in locale language. in addition the software should support entering
language specific text using virtual keyboard. e.g. tamil for andhra pradesh state. or mandarine
for china country specific.

127) What is difference between Black box testing and White box testing?
Answer: In case of White box testing it is mandatory to know internals of software applications,
such as structure, program functions, implementation of how data flows between components.
The tests covers white box testing are unit testing and integration testing. These tests are
performed by developers, and it is mandatory to know programming and implementation
knowledge, the test is based on design document provided by design team. Various testing
techniques used in White box testing are Statement Coverage, Branch coverage, decision
coverage, path coverage.
Black box testing does not need any understanding about internal structure of application, the
tests coveres black box testing are system and acceptance testing, testing is based on requirement
document received from product team. Various testing techniques used in Black box testing are
Equivalence partitioning, Boundary value analysis, Decision table testing, and Error Guessing.

Page | 38
128) What is the difference between Authentication and Authorization give an example.
Answer: Authentication is verify logged in user’s genuineness, in real world you were required
to show photo identity documents such as Aadhar card, Driving licence, PAN card or Passport in
order to receive documents addressed to you from courier, know your account balance at your
bank.
whereas authorization is verifies what module access rights the logged in user has. real life
examples are You are allowed to explore feature of an application based on your trial period,
once you become registered user by paying the registration fees, you can access more features of
the software.

129) Other than functionality what else you should test in Web Application?
Answer: In addition to functionality and feature testing, we should test browser compatibility,
security tests for authentication and authorization rights, latency – how long it takes to load a
web page, or request to come back as a response, load testing based on number of users logged in
during peak hours, and scalability testing.

130) How you know that testing is enough?


Answer: The criteria and conditions are specified in exit document that guides us on when
testing should be stopped. When most of blockers and critical bugs have been resolved and
application has performance in acceptable limits, we can stop testing. This is however based on
some risk that have to be undertaken and time limit.

131) How will you test the reports?


Answer: It is important to prepare report on the testing activities and their end result on regular
basis to the management. It helps to analyze quality of tested product, and based on the end
result, the decision to release the product or hold back till its quality improves, can be taken.
Instead of oral confirmation or denial about the software quality discussions, the report will give
written evidence of test status, summary of defects logged into bug tracking system. number of
tests carried out, test method, what steps taken, deviation observed between actual and desired
expectation.

132) What is Database? Which database you are aware of?


Answer: Collection of data that can be accessed referred and manipulated in order to use in an
application. relational database, nosql database, cloud database, distributed database, object-
oriented database, graph database are database types.
You can inform the interviewer about name of database you have worked on or are aware of.

Page | 39
133) Can you name some of Relational database?
Answer: some examples of relational databases are sqlserver, oracle, mysql, IBM DB2,
postgreSQL.

134) Can you name some of nosql database?


Answer: some examples of Nosql databases are – ElasticSearch, Mongodb, Couchdb, Cassandra
db, HBase.

135) Can you name some of cloud database?


Answer: some examples of cloud databases are – amazon S3,RDS, dynamoDB,Redshift,SAP,
Azure

136) Can you name some of distributed database?


Answer: some examples of distributed databases are – teradata, exadata,SAP Hana

137) Can you name some of object-oriented database?


Answer: object-oriented database – smalltalk, LISP in Gbase, COP in Vbase

138) Can you name some of graph database?


Answer: graph database- Neo4j, amazon neptune,

139) What is Database Testing?


Answer: Database testing is a testing of database entities such as schema, tables, views, triggers,
stored procedures, partitions created on tables, indexing. we should be proficient in SQL queries.

140) What do you mean by Cookies?


Answer: cookies are small text files that contain web visitor information such as websites
explored, pages visited, visitor’s ip address to identify already visited user.

Page | 40
141) How do you test Cookies?
Answer: cookies are small text files that contain web visitor information such as websites
explored, pages visited, visitor’s ip address to identify already visited user. There are various
types of cookies,
 Session cookies – user navigating websites actively, once they leave particular site, session
cookie disappears.
 Tracking cookies – are used to keep record of multiple visits that was made to same particular
web site.
 Authentication cookies – whether a a valid registered user has logged in again and if so with
what name?

142) What are Stored Procedures?


Answer: In relational databases, use of parameters, variables and output parameters to design
procedure which has data processing in order to incorporate business logic for expected result.

143) How many types of Joins are in sql?


Answer: the Joins are of following types in SQL
 Inner Join
 Left Join
 Right Join
 Full Join
 Self Join

144) What are DML and DDL commands give example.


Answer: Data Definition Language (DDL) commands in SQL are create database, schema,
constraints, users, tables etc. DDL commands are CREATE, DROP, RENAME and ALTER
Data Manipulation Language (DML) commands in SQL are insert, update, and delete records
from database tables. DML commands are INSERT, UPDATE and DELETE

145) What is Normalization?


Answer: Normalization in SQL is a process of eliminating useless repeated data from tables,
ensuring data dependency makes sense in final tables.

Page | 41
146) What is Primary key and Foreign key?
Answer: Primary key is a type of constraint applied on particular column values in order to
uniquely identify a record (row) in the table. A column value should be unique (can not repeat),
and can not hold null values.There can only be single primary key per database table.
Foreign key is a type of constraint applied on the column value which already exist as a column
in another table with primary key constraint applied on. Foreign key value can accept multiple
null values. there can be multiple foreign key in single database table.

147) What is RDBMS?


Answer: RDBMS stands for relational database management system, where relational database
refers to storage of data in structured manner in row and column format.

148) What is difference between delete & truncate?


Answer: Delete is a DML command whereas Truncate is a DDL command, with delete
command applied on table record(s) records will get removed, records removed using Delete
command can be recovered with Rollback command.
Using truncate command, records along with table structure gets removed from database schema,
WITHOUT recovering the table again.

149) What design documents you receive from PM?


Answer: Low level Design and High level Design documents are received from Project manager.

150) What are documents are created in Design phase?


Answer: Design Documents such as Low Level Design, High Level Design documents created
by developers and design team explaining data flow in application or modules using UML
diagram.

151) What challenges you have faced in testing so far?


Answer: This one is a tricky question; interviewer wants to know first hand information from
you about your weakness in handling difficult or crisis situation. Answering this question like
what is your weakness – you need to keep yourself specific and not to lament problem or
difficulties or show any kind of annoyance or hatred for particular stack holder or reporting

Page | 42
manager, collegue or developer or some process. You can explain situation however, but should
end your statement explaining how you were successful in controlling the situation.

152) Realizing you won’t be able to test everything – how do you decide what to test first?
Answer: There are a situation where testing a new build is allotted a bare minimum time, or you
are given several tasks or projects to look into. In such case, where you can not able to
completely cover all the scenarios of testing, you can focus on main functionality and features
released and check if any critical or blocking defect should not be present in an application
during regression tests. Usability, functionality, security, performance are few testing that should
be carried out either using scripts automatically or test manually.

153) What is SQA?


Answer: Software Quality Assurance (SQA) is a set of activities that validates that the software
being designed or built, meets desired quality measures and specifications. Test Assurance team
has tasks like auditing and training the stack holders about standards for quality that software
should satisfy as per user expectations.

154) What are the contents of defect report?


Answer: A defect report should inform description about the defect.
 Which version or build of software release being tested during which defect occured
 Which is the module name, how to access this module (path), what were the steps carried out
 What was the functionality affected, how severe you think the defect is
 Name of the tester who discovered the defect, name of the developer to whom defect has
been assigned,
 Test case affected mapped to requirement specification document ids and number of test
cases that may not be tested due to the defect.

155) What is Big Bang type of testing?


Answer: Big Bang test type is an integration tests where multiple modules are being tested
simultaneously which may get affected due to change request or defect if any. This helps
exploring software with end to end functionality and gives tester an idea about features included
and functionality carried out using the software.

Page | 43
156) What is Traceability Matrix & Coverage Matrix?
Answer: Traceability Matrix & Coverage Matrix is a document that is mapped with software
requirement documents and test case or scenarios all in single document. The purpose of such
document will ensure that the entire requirements have been covered by test cases and there is no
feature or functionality that has been left unchecked.

157) What is UAT and Alpha and Beta Testing?


Answer: User Acceptance Test (UAT) is a final test by end user or client’s representative before
software is handed over to production environment. It is an end to end functionality testing and
verify that proposed features have been included in the software. User Acceptance test are
essential as end user will test and verify the application, to make sure that the developer has
incorporated the features and functionality expected by end user in the software. In addition
change requests asked for have been properly incorporated by developers.

158) List OOPS features?


Answer: The OOPs features are as listed below
 Inheritance
 Polymorphism
 Encapsulation
 Abstraction

159) What is Hot fix?


Answer: HotFix is a workaround which can be some sort of configuration change in order to
resolve an issue that could occure in running application or server, with minimum downtime.

160) Where Exit and Entry Criteria are written in Test Plan?
Answer: Entry criteria are written document without referring to which one cannot begin any of
the SDLC phases. In order to begin SDLC phase Requirement document and complete flow
diagram of the application as well as Test Plan should be ready and available. An exit criterion is
the detailed document that decides moving from current phase of SDLC to the next phase. In
order to exit SDLC phases test cases should be written and reviewed, test data has been
identified and ready to use, scripts for automate the execution of test cases must be ready.

161) What are different scenarios for verifying Email address?

Page | 44
Answer: In order to verify email address, the front end tester should consider following criteria
 Email address may contain alphanumeric characters as initial portion,
 special character allowed are dot (.), underscore (_), in initial portion,
 there should only be single @ symbol separating local part and domain
 Domain name may end separating dot (.) with net, org, com and edu as well as country
specific characters eg. in for india, ca for canada.

162) What is the query for update table?


Answer: in order to change column value in the table based on condition, the query is as given
below
UPDATE table_name

SET column1 = value1, column2 = value2, …

WHERE condition;

163) If there is mistake in company Logo, what is Priority and Severity Justify your
answer?
Answer: Mistake in company logo on a product, does not impact its functionality or working, as
well as buying or selling activities of product, the defect has low severity. But, this defect will
impact greatly brand identity and impact how user will interact or may take as duplicate product,
hence such defect is of high priority.

164) What is A/B testing?


Answer: A/B testing is comparing two version of same product, for difference in user
experience, performance and any changes that are evident during tests. e.g. comparison of
features of microsoft’s word 95 and word 97.

165) What is Test driven development?


Answer: When requirements are specific to test cases, such that code can be improved or defect
in code can be fixed in order to meet with the requirements, such kind of development is known
as test driven development. The test cases are designed around various scenarios to cover the
expected requirements.

Page | 45
166) Explain error guessing with an example.
Answer: Based on testing experience, testers design their test cases or scenarios, such method or
tests which are exploratory in nature, in order to locate defect in software, are called error
guessing.

167) In bug life cycle, who opens the bug?


Answer: In Bug Life Cycle, Developer opens the bug which was logged in bug management tool
by a tester, and assigned to respective developer by development head for fix.

168) What is Compatibility, Multiplatform and Configuration testing?


Answer: Compatibility testing involves testing software and their compatibility with standards,
platforms, transfer of data, all possible combinations can be verified using different operating
systems, web browsers for same hardware, how functional and non functional features behave.
Multiple platforms such as operating systems, network and hardware and their combination used
as test environment and how performance of software will behave can be tested.
Configuration testing involves verifying parameter set up for various computer components such
as PC, components, peripherals, interfaces, graphic cards, device drivers are composed of variety
of configurations. With help of installation guide and manual we can verify configuration of
various parameters in various hardware and infrastructures.

169) What are Session and Cookies and what is difference between them?
Answer: Cookies and Sessions are small text files that store information.
Cookies Sessions

Sessions get stored at both client machine as well as


Cookies are stored only at client machines server.

Cookies are independent of session Session is dependent on cookies.

Cookie expires based on lifetime set by user Session ends when user closes web browser.

As HTTP is stateless protocol, cookies track Sessions store important information such as user id
application state using small text files on user’s on the server and are used to pass data values from
computer i.e. client. one page to another.

Page | 46
170)What is Mutation testing?
Answer: Mutation testing is white box testing usually conducted in unit testing level, by
changing few statements in source code and validate using debugger. objective of mutation
testing is to assess test case quality based on fault based test strategy that fails mutant code while
debugging.

171) Difference between Ad-hoc & Exploratory testing


Answer: Exploratory as well as Ad-hoc testing should be carried out by experienced testers for
validating critical application that requires early iteration so to test if the application satisfies
essential functionality or not.
Following is the difference between Ad-hoc and exploratory testing

Adhoc Testing Exploratory Testing

Exploratory is formal tests are carried out by


experienced Software testers based on their previous
Ad-hoc is an informal test that can be carried out testing expertise thereby test cases are designed
without referring to requirement specification during test execution. There is no test case or scenario
documents for the application being tested. created during exploratory testing.

While exploratory tests, both positive as well as


negative tests should be tested thoroughly,

Ad-hoc tests primarily tests negative scenarios

You can learn more about exploratory testing please visit https://www.qafox.com/importance-of-
exploratory-testing/

172) Difference between HTTP and HTTPS, Explain how the data is secured in HTTPS?
Answer: HTTP is short for Hypertext Transfer Protocol, when you enter http:// in your browser,
you inform browser to allow connection via http protocol which is TCP (transmission control
protocol), in order to send and receive data packets over the web.
HTTPS is short for Hypertext Transfer Protocol Secure, when you enter http:// in your browser,
you inform browser to allow connection via http protocol over secured connection encrypted by
transport layer security.

Page | 47
173) Have you heard of Agile Methodology? Explain?
Answer: Agile is a process or a framework where a small team develops and tests customer
requirement assigned to them in their order of priorities to be accomplished in the small interval
in agreement with client representative from the team.
To learn more about Agile terminologies please visit https://www.qafox.com/agile-environment-
and-terminologies/

174) What is scrum?


Answer: Scrum is a term used in agile environment of software development where stack holders
that develop product meet daily to discuss about Work and its Progress like what task is done,
what is being worked upon, what are the difficulties delaying the progress. Scrum meet ensures
the team member especially product owner about the status of the work completed and backlog.

175) What is sprint?


Answer: Sprint is usually period of 3 to 4 weeks in which team members have to complete their
assigned tasks along with any change request. This is spread across entire software development
life cycle, with every new sprint starting after completing task of previous sprint.

176) What is epic?


Answer: Epic is product feature which are broken down into achievable smaller tasks known as
user stories in sprint interval. Epic are completed on incremental order of user stories achieved in
sprints.

177) What is product backlog?


Answer: The product backlog comprises a list of new product features, changes in any of the
features or functionalities, bug or defect fixes, changes in hardware infrastructure in order to
enable the team to achieve a specific outcome. A close eye on product backlog is kept by the
scrum master and product owner. This helps in defining burn down reports. Product backlog
results in a count of pending tasks that are recurring over a couple of sprints.

178) What is burn down report?


Answer: Burn down Report is A pending task from user stories during sprint interval due to any
reasonable reasons specified by developer, against the time interval. Product owner help to
remove impediments due to which tasks are being delayed or left pending.

Page | 48
179) Have you used any Configuration Management tool?
Answer: I have assisted DevOps team occasionally and have used Chef and Puppet tools for
Configuration Management of their infrastructure.

180) Do we always need to do regression after retesting?


Answer: Retesting is required to verify that the test cases failed in previous release, are passed
after the defects are fixed.
Regression is mandatory to verify all relative or dependent modules and integration tests that are
intact even after defect is fixed or after change request.

You need to retest the portion of application where defect was fixed. This may be a portion of
tests in regression testing. Experience says, it is safe to do regression after retesting as to make
sure that other portions of software are intact and not affected after defect fix.

181) What is Web server, which web servers you know?


Answer: Web server is an infrastructure that uses hypertext transfer protocol to respond client
requests over internet. Its main function is to store, process and deliver web pages requested to
web site visiters. In addition web server also supports Simple Mail Transfer Protocol (SMTP)
and File Transfer Protocol (FTP) protocols for email, file transfer and storage. Microsoft Internet
Information Services (IIS) and Apache Tomcat are some examples of a web server.

182) What is Inter-system testing? Have you done that?


Answer: When various systems are internally connected with each other and can access or
exchange information as well as process one system with another system as interface. Real Life
example is ATM machines, if you have account in State Bank of India of any branch and you
have SBI debit card. You need to withdraw cash immediately, you have ICICI bank ATM
machine near you. You insert SBI debit card in ICICI bank ATM machine, you enter your
credential, the system will internally access SBI server and verify your authentication details
along with account balance. When you request the amount to be withdrawn, ICICI bank ATM
machine will dispense the cash requested for. with amount remaining in your SBI account.
Another example is you can access and use all banking related functionality from different
branch of SBI bank across India.

183) What is a build? What is the release?

Page | 49
Answer: The software build is application compiled and integrated in order to get tested by
software testers. Release is deploying software with new version deployed to the customer, it has
additional features that were absent in previous release, and change request requested by
customers using previous release.

184) What is production server?


Answer: production server is a server used to host website contents such as front end pages, css
files, javascript files, backend tables, sql files, procedures etc. integrated and deployed so that
end users can access them through their website address using browser and internet, or download
on their mobile for using the features of application.

185)What is Recovery Testing?


Answer: Recovery testing is to test how quick the application is recovered after it has gone
through system crash or hardware failure. Tester can change interface, protocol, firmware,
hardware, and software configurations as close as the actual conditions. Recovery tests after
hardware restored will be tested for getting application again coming back and start running as
before. The expense and risk to carry out recovery testing may be substantial and prohibitive for
smaller startup companies.

186) What are the properties of a good Requirements Document?


Answer: The requirement should be feasible, completely explained in requirement specification
document. There should be single requirement, easily read and understood by non technical
people, should not contain definitions, reasons for need of requirement. The requirement should
not have any guess work or any confusion (e.g. for how long, 50% or more) should not conflict
with other requirements, must include same terminology across document, Can be achieved with
existing technologies, met within the schedule.

187) What is Accessibility Testing?


Answer: Accessibility testing is a subset of usability testing, is a process of testing an amount of
ease of using the application by disabled individuals. Based on the type of disability various tests
are carried out on software to check accessibility features designed specifically for disabled
either manually or automatically using tools.
The objective of accessibility testing is listed below

 To make sure that application or software can be used by a disabled individual with ease,
 To verify that the software is in compliance with the laws formed over requirements for
accessing software by disabled individuals.

Page | 50
 To make sure that there is no legal action against the software provider in the future

188) How can you make your software ready for accessibility?
Answer: Screen Readers like JAWS, NVDA, VoiceOver, Window-Eyes, and Digital voice
recorders of brands like EVISTR, OLYMPUS WS-852, Zoom, Tascam and SONY can be
integrated with software to add accessibility feature for disabled individuals
To learn more about accessibility testing visit https://www.qafox.com/importance-of-
accessibility-testing-for-disabled/

189)What is Jenkins?
Answer: Jenkins is an open source automation tool that help devops to automate build, test and
deploy, integration and delivery of software, whenever multiple developer tries to commit his/her
source code and code is built, build status will be notified to developers such as which commit
has defect in case, next when the build is deployed over to test server any integration issue if any
will be reported to developer for any drawback or failed build. Jenkins a tool that automates
Continuous Integration, Deployment, feedback to developers, defect in build can be resolved
immediately.

190) What is an Insurance?


Answer: Insurance is a protection or risk management against any unforeseen events such as
theft, accidents, illness, damages of properties, due to loss of life in the form of sum total of the
amount by paying the premium for the coverage and claim in case of incident or after maturity

191) What are some of the types of insurance?


Answer: Some of the insurance types are Life Insurance, Term Life Insurance, Retirement plans,
Health insurance, Home Insurance, Automobile Insurance, Travel Insurance, Commercial Assets
Insurance, and Mobile insurance.

192) How many types of banking have you heard of?


Answer: Banking is divided largely into Retail banking, Corporate banking, Investment Banking,
Internet or net banking, and Mobile banking.

193) What is retail banking?

Page | 51
Answer: Retail banks provide liquidity, an amount of money for spending and investment in
form of treasury bills(currency). In addition to save and invest individual and their families
finances, offer credit (loans) to purchase homes, cars, and other expenses. They also offer credit
cards based on their repayment history. debit card so that people can withdraw cash from ATM
machines, or shop groceries, clothing or things of need at point of sales using debit or credit
cards and cash management such as demand draft, ECS, RTGS/NEFT, cheques payment.

194) What is NetBanking?


Answer: Digital Banking – customers who have their accounts in banks can access various
financial services offered by retail banks any time using the internet. Viewing account statement,
fund transfer, online shopping by payments and confirming OTP (one-time-password) in order to
verify the transaction is authenticated by the account holder, apply for loan, credit cards,
investments like mutual funds, cumulative investments etc. various other services like cheque
book request, online password changes, credit card payments, viewing transactions statements.

195) Name some digital payment platform


Answer: Users can make cashless payments with global digital payment platforms such as
PayPal, Visa, MasterCard, Amazon, E-wallets, Bancontact, and Indian payment platforms such
as CCAvenue, PayTM, Google Pay, PhonePe, BHIM, etc.

196) What entities are present in health care domain?


Answer: Following are the entities in health care domain applications
 Insurer– health insurance policy providers who look after all the medical treatment expenses
for policyholder.
 Policy holder– one who is covered for the sum insured amount of medical expenses by
paying the premium to the insurer
 Provider– healthcare professional, a registered doctor or physician treating a patient, a
policyholder for his illness.
 TPA– is an interface between policyholder and insurer company, who processes the claim for
the medical treatment charges and reimburse them to the facility, hospital, and medical
doctor.
 Broker– is an agent that sells the health insurance policy to the customer against the
premium amount for the sum insured healthcare expenses covered under the policy.

197) What are the seven layers of OSI model in network?


Answer: OSI model contains 7 layers starting with Physical, Data Link, Network, Transport,
Session, Presentation, and Application Layer

Page | 52
198) What do you mean by protocol?
Answer: Protocols are set of rules or procedures that are already agreed by the software industry,
for transmission of data between resistors, capacitors, inductors, diodes, and transistors of
electronic devices like desktop, laptop computers, mobile phones, printers, electronic devices
like digital cameras, DVD players, smart televisions etc

199) What are various types of e-commerce sites?


Answer: The various types of ecommerce sites are Business to Business (B2B), Business to
Consumer (B2C), Consumer to Consumer (C2C).

200) What are system integration test types?


Answer: System Integration test types are Big Bang Integration, Top Down Integration, Bottom
Up Integration, and Sandwich /Hybrid Integration.

201) Name few of System integration testing tools.


Answer: The different Testing tools to verify system integration that are used across industry are
 Citrus,
 FitNesse,
 Jasmine,
 LDRA,
 Protractor,
 Rational Integration Tester from IBM,
 SITA(Smart Integration Test Accelerator),
 Tessy,
 Validata
 VectorCAST(C++/Ada),

202) What is Defect cascading?

Page | 53
Answer: Defect cascading is defects that are encountered by software testers, which further
uncover another defect in the system while integration testing takes place. In order to locate
defects that are primary this may further realize other defects in the application.

203) Give some Test Management Tools you are aware of.
Answer: TestRail, Zephyr,TestFlo, JIRA, TestComplete, and TestLink are some of the industry
recognized test management tools.

204) Where are Jenkins files stored?


Answer: Jenkins stores the configuration for each job within an eponymous directory in jobs/ .
The job configuration file is config. xml , the builds are stored in builds/ , and the working
directory is workspace/

205) Have you heard about GIT?


Answer: GIT is an open source version control system used as a depository to save code base of
multiple developers, which will be integrated after compiling and build using continuous
integration tool such as Jenkins.

206) Have you worked on SQL query? What you have done?
Answer: Yes, I have worked on SQL select commands where I queried on the database tables to
view and compare records present in tables and that displayed on application’s output.

207) Explain REST API.


Answer: REST API is a set of rules in order to receive data or information from internet when
you request about this information using URL. API is application programming interface, created
by developers and client or end user can use them in order to fetch information, such as weather
reports for next 5 days of particular location, Share market updates for particular company,Book
movie or flight tickets using third party applications like bookmyshow.com or goibibo.com, with
REST API payment gateways of banks can also be integrated with the ecommerce sites so that
buyer can purchase product online.

208) What are tools used in software industry for API testing?
Answer: Some of the industry famous API testing tools are

Page | 54
 SOAPUI
 Postman
 REST Assured

209) How to upload data in Jenkins?


Answer: Steps to upload file in Jenkins.
After login to Jenkins, select left hand side menu title ‘Jenkins’ and submenus – ‘Manage
Jenkins’. A list of options will display.

Select -‘Configure System’ by clicking on it. Configuration page will open. You can check
menus, ‘Maven Info Plugin Configuration’. In Maven Info Plugin Configuration click on the
checkbox that reads “This project is parameterized”. You will get ‘Add Parameter’ drop down.
Where in you will get a window with title ‘file parameter’, where file location should be copied
and click on Save button. There is another option known as ‘Build with Parameters’ , click it to
find location of file entered along with Choose file button, clicking this will allow you to select
local file to be selected for uploading. You should click Build button to build with uploaded file.

210) Have you heard about GIT?


Answer: Git is a version control software used for uploading and hence managing worked files
among programmers in software development projects. GitHub is cloud based hosting service
that lets devops team manage Git repositories.

211) Have you worked on SQL query? What you have done?
Answer: SQL query are english like statements used to access and manipulating database. You
can create new databases, create views in database, set permissions on tables, procedures, views,
create new tables, update table with constraints, insert, view, modify or delete records in tables,
execute queries against a database tables.

212) What is Primary Key please explain.


Answer: Primary Key is a constraint or a condition on table columns. There is only one primary
key per table, It is a criteria to uniquely identify a record in table. Primary key constraint on table
column makes sure that there is unique value in column, (i.e. it should not allow duplicate value
in the column), column should not allow null value, (i.e. it will not allow empty value)

Page | 55
213) If there are same multiple entry in the table, how to find Unique element in the table?
Answer: Using ‘Distinct’ keyword in sql statement make sure displaying unique value in the
table. eg. select distinct (state) from customers.

214) How to get 3rd Highest Salary from employee table?


Answer: SELECT MIN(EmpSalary) from (SELECT EmpSalary from Employee ORDER BY
EmpSalary DESC LIMIT 3); You can here just change the nth value after the LIMIT constraint.
Here in this the Sub query Select EmpSalary from Employee Order by EmpSalary DESC Limit
3; would return the top 3 salaries of the Employees.

215) How to find any particular date of joining of employee from Employees table, date is
in number format then how to change it to date format?
Answer: The Date of employee joining an organization is in number format, say 01/02/2001, It
can be converted into date format DD/MM/YYYY as follows
TO_CHAR (TO_DATE(‘01022001′,’DD/MM/YYYY’), ‘DD/MM/YYYY’)

216) What is end to end testing?


Answer: End to End (E2E) testing validates application flow from start to end. A main criterion
of E2E testing is to recreate user scenario and validate system under test, components for
integration and data integrity. eg. Accessing website using browser and its web address (URL),
Login to application with valid credentials, for ecommerce portal, the user should able to view
his account details, delivery address, past orders, current order (in case), default payment
instructions (like his credit card registered for easy payment method), in addition to this user
should able to view all other items on sale, wish list, adding items to shopping cart, and paying
for the item selected with his preferred way of payment options and finally logout of the
software.

217) Arrange the following testing types in sequence in which we test any application
Functional Smoke Integration System Sanity Retesting Regression
Answer: Following is the order in which respective tests are carried out during STLC.
Smoke à Sanity à Integration à System à Functional à Retesting à Regression

Page | 56
218) List Name of HTTP methods for RESTful services
Answer: The HTTP methods used for RESTful services are POST, GET, PUT, PATCH, and
DELETE.

219) What are status codes in HTTP?


Answer: HTTP status code is 3 digit integers displayed as a response from the server, the first
digit defines a class of response are as explained below
1xx – informational
2xx – Success
3xx – Redirection
4xx – Client Error
5xx – Server Error

220) Have you used SOAPUI?


Answer: SOAPUI is an open source tool for web services testing. This tool can be used for
RESTful API and SOAP web service testing, GraphQL and microservices and other backend
services. The API testing tool is used to validate communication between software made from
different technologies, supports REST, JSON, XML, SOAP, JDBC, JMS, and other protocols in
a single test case.

221) Have you used Postman?


Answer: Postman is a scalable open source API testing tool, API is an interface that
communicate between applications using HTTP protocols using data formats like JSON.

222) Have you used REST Assured?


Answer: REST Assured tests REST APIs using Java libraries, integrates with maven. REST
Assured has methods that fetch data from all requests and responses from any complex JSON
structure. Developers with Java development background can implement REST Assured
methods to test API and integration tests using automation scripts.

223) What is Installation Testing?


Answer: Installation testing is to verify that the application has been successfully installed on
environment as per the steps and order of installation listed in installation guide and is working
as user acceptance tests and expected as requirement document. During every build deployed by
software testers on test servers installation testing is carried out. The steps written in installation

Page | 57
guide for different operating system can be verified and application is run to check that
installation is successful.

224) Have you come across any severe bugs in your application and did you contribute so
that it gets resolved?
Answer: There were severe, critical and blockers defects that were found during every build. I
sat with developer and product owner and explained the expected behavior of system and feature
and functionality. I tried understanding code and functions used to achieve the functionality and
pointed out shortcomings, there by rectifying the defect.

225)What is Application Server? Give example.


Answer: Application server is connected with network and database, web applications are hosted
on application server and are connected via network and request from client and response to
client reach this server with the help of HTTP protocol. Database connected to this application
server validates logged in user’s authenticity and requests asked for from the respective tables to
fetch information and send them in form of response to the client.
Application server platforms are J2EE, WebLogic, Glassfish, JBoss Enterprise Application
Platform, Apache Tomcat.

226) If any bug is reproducible at client-side (in production environment) not in the test
environment what are the different possibilities that this scenario occurs?
Answer: There are various scenarios like additional load of uploaded files for processing, logged
in users, time taken to receive response back due to which bug are reproduced at client side
(production environment) and not in the test environment.

227) If any bug is reproducible only on Testing server and not on Development server, how
you make sure that the developer fixes that bug?
Answer: The steps or scenario carried out to reproduce defect at test environment but the same
steps carried out at development server if does not produce defect. It may happen that there can
be some files missing at test environment, code changes at development server due to update on
build. Tester has to reproduce the defect carefully conducting steps at development server and
advice developer to fix the defect.

228) What is Data Migration Testing? What are the different approaches followed in Data
Migration?

Page | 58
Answer: Migration testing validates migration of application from old system to new system
with data integrity, no loss of data, and minimal downtime, with functional and non functional
aspects are met post migration. Pre migration, migration and post migration tests are phases of
migration test. in addition backward compatibility and rollback tests are executed along with.

229) What are broken links?


Answer: broken links are the reason when website are no longer available giving 404 error (Page
not found), as webpage was moved without any redirect added, URL structure of website
modified or moved.

230)What is ETL testing / Data warehousing testing?


Answer: ETL testing is for Extract required data or information from data warehouse, Transform
data in order to make it suitable so that it can be loaded into the database.

231) What is Closer Report?


Answer: Summary of tests conducted during software development life cycle, build wise results,
status of defect resolution, final critical or major defect still pending in an application is called
test closure document. this report also display number of test cases executed, number of defects
and their types, defect density etc.

232) write test cases on online software product for free?


Answer: There are many software companies that introduce their software to end user on limited
trial base, in order to explore the features offered and validate functionality. In order to test such
software there are few test cases listed.
 Verification of features offered in free trial software.
 Once executable files for the software are downloaded on user’s machine, it is asked to enter
user credit card information, in order to start remitting amount after trial period.
 Once trial period is over, the software should ask for activation key.
 iv)In order to continue using the software, user should either get valid activation key or
purchase the software which provide activation key for lifetime use.
 The feature working in trial period should continue to work after purchasing software,
without any limitations that might were imposed during trial period.
 The feature offered during trial period should work reliably during trial period.

Page | 59
233) write test cases on company web portal (say ACC cement)
Answer: various companies have their online presence in the form of web portal and social
media. The web portal should provide following information
 The URL or web address provided should be browser compatible and should display the
similar content on all the browsers namely, Internet explorer, mozilla firefox, google chrome,
safari, opera etc.
 Web site should by default display his home page on page load, without any delay.
 The company information such as offerings, products, services are the links provided on
clicking which should display web pages with relevant information.
 Company location, current contact information, like phone/mobile, email address and current
head of operations name should be displayed.
 In Contact form, user can enter his details and on clicking submit button, a reply from the
company should be received and customer care department should speak with the visitor in
order to provide services asked for.
 The product or services page should display their area of expertise, product range, zone wise
dealer’s address where visitor can get product or services via these dealers.
 The web portal should also provide link for any current openings available or product
information so that visitor can avail these facilities.

234) write test cases on gaming software


Answer: Test cases or scenarios for gaming software should consider following points
 Background music, camera (zoom in and out) in case of remote players, compatibility with
different screen sizes.
 Advancement in Game, Rules, prerequisites to attain next level.
 Event triggers, scores, logic to calculate points, what makes games stop.
 Special effects, use of buttons, touch screen mobiles, mouse, keyboard, and joysticks
 Required minimum configuration of mobile in order to get the best gaming experience.

235) write test cases on image editing software


Answer: Test case or scenarios for image editing software are listed below.
 Verify acceptable image formats are allowed for uploading image editing software
 Validate uploaded image are converted into complete and usable image after processing.
 Verify the software has preview feature after editing an image online.

Page | 60
 Validate a software has drag and drop feature for image to be uploaded.
 Validate a software can able to include more than one image in single pane.
 Verify the image developed as a result of merging and modification should not include any
patches.
 Validate the font inserted while image editing software should not blur out the text.
 Verify the font along with image gets expanded or reduced while using zoom function
without any blur or breaks.
 Verify it should not accept any document other than that of image format.
 Validate that the image should be converted into final modified form as soon as possible.
 Verify that the modified image is sent in email supplied.
 Verify that to have image size limitation in order to quickly upload, process and send back
processed image.

236) write test cases on online file format conversion


Answer: Test case or scenarios for online file format conversion are listed below.
 Online file format conversion software should have a registration button.
 Online file format conversion software should have login button for registered users.
 Online conversion of Audio format of files should only accept audio file formats for
conversion.
 Online conversion of Document format of files should only accept document formats for
conversion.
 Online conversion of videos should only accept video file formats for conversion.
 Online conversion of images should only accept image file formats for conversion.
 Online conversion of PDF to word should only accept PDF format only.
 Online conversion of PDF to JPG should only accept PDF format only.

237) what is captcha? Where did you see captcha?


Answer: A CAPTCHA is a type of challenge–response test used in computing to determine
whether or not the user is human. e.g. of captcha are sum of two digits, selection of characters
containing symbols, numerals, and alphabets which are distorted for user to identify and write in
text field provided. Selection of pictures that contain some of the images asked for. The pages
where sensitive user information may get revealed CAPTCHA can be installed, They prevent
hackers from performing attacks where they try to break into an account by guessing every

Page | 61
possible password combination, and they can also prevent fraudulent sweepstakes entries or
illegitimate contest votes.

238) explain functionality of captcha.


Answer: CAPTCHA makes sure that the end user visiting website is human and not a script that
automatically enters predefined password or sensitive credentials and tries explore the software.
They prevent hackers from performing attacks where they try to break into an account by
guessing every possible password combination, and they can also prevent fraudulent sweepstakes
entries or illegitimate contest votes. Captcha can be sum of two digits, selection of characters
containing symbols, numerals, and alphabets which are distorted for user to identify and write in
text field provided, or selection of pictures that contain some of the images asked for.

239) Why all websites visited want to have your consent to use cookies?
Answer: Many websites have changed their privacy policies after the law and the recent
developments of user data breaches in the tech industry. This will help make the users
understand what data are collected using cookies and what happens to it after they are collected.

240) Give example of Statement coverage.


Answer: Statement coverage is white box testing method where quality of code as well as
different path flow is verified. Limitation of statement coverage is we cannot test false condition
in it.
Formulae to calculate statement coverage is as below

Statement coverage = No of statements Executed/Total no of statements in the source code


* 100
Example:

Read Akshay’s marks Ak_mks

Read Binoy’s marks Bn_mks

if Ak_mks > Bn_mks

Print “Akshay has secured better marks than Binoy”

Page | 62
else

Print “Binoy has secured better marks than Akshay”

endif

Set1 :If A =75, B =62

No of statements Executed: 5

Total no of statements in the source code: 7

Statement coverage =5/7*100 = 71.00 %

Set1 :If A =82, B =95

No of statements Executed: 6

Total no of statements in the source code: 7

Statement coverage =6/7*100 = 85.20 %

241) Give example of Decision coverage.


Answer: Decision coverage is white box testing method where scenarios or condition reports
boolean value true or false as output. It is very hard to achieve 100% coverage.
Decision coverage = Number of Decision outcomes exercised/Total number of Decision
Outcomes
Example:

function eligible(var htinft) {

if (htinft > 5)

Page | 63
htinft = htinft * 30.48

document.write(“You are eligible to appear military exams”);

document.write(“Your height is” + htinf +”cms”);

scenario 1

value of htinft is 4.8

Here boolean value – No when if (htinft > 5) is checked

highlighted code will be executed,

function eligible(var htinft) {


if (htinft > 5)
htinft = htinft * 30.48
document.write(“You are eligible to appear military exams”);

document.write(“Your height is” + htinf +”cms”);


}
Decision coverage = 50%

scenario 1

value of htinft is 5.4

Here boolean value – Yes when if (htinft > 5) is checked

highlighted code will be executed,

function eligible(var htinft) {


if (htinft > 5)

Page | 64
htinft = htinft * 30.48
document.write(“You are eligible to appear military exams”);
document.write(“Your height is” + htinf +”cms”);
}
Decision coverage = 50%

242) Give example of Branch coverage.


Answer: Branch coverage is same as Decision coverage, hence you can give example given in
Decision coverage for branch coverage.
Branch coverage = Number of executed Branches/ Total number of branches

243) What is TestNG?


Answer: TestNG is a testing framework that covers unit, functional, integration, end to end
testing categories. It tests java project testing, TestNG supports Annotations, uses Java and
Object-Oriented features, supports multi threaded testing and has flexible plugin API.

244) What is Test Driven Testing?


Answer: The development is governed by test cases designed for each of the features.
Development team starts developing their code base and functions so that the tests pass. Testing
considers various aspects such as valid/invalid inputs, errors, exceptions, boundary conditions,
events handled and everything that may break resulting defect. due to test driven development, it
takes much less debug time, code designed to meet requirement, shorter development cycles and
near zero defects.

245) What is Behavior Driven Testing?


Answer: Behavior Driven Development (BDD) is a branch of Test Driven Development (TDD).
BDD uses human-readable descriptions of software user requirements as the basis for software
tests. Like Domain Driven Design (DDD), an early step in BDD is the definition of a shared
vocabulary between stakeholders, domain experts, and engineers. This process involves the
definition of entities, events, and outputs that the users care about, and giving them names that
everybody can agree on.

246) What is Latent Defect?


Answer: Latent Defect is a hidden defect in software still unknown to end user until particular
task or operation is not performed by running the application. this type of defect are difficult to

Page | 65
identify, pass through all testing, remains hidden even after production, occures only in certain
scenario, can surface after release of the product.

247) What is fault-masking?


Answer: fault masking is a technique wherein one defect prevents the detection of another. there
are many features that may have defects but remain hidden until these feature are utilized. for eg.
In case of login page, developer has provided option to log in with email address and mobile
number, until user logs in with valid credentials, the defect as below, wherein forgot password
when registered mobile number is entered OTP is not received on mobile (unhandled task by
developer), remains un noticed. This is known as fault masking.

248) Explain what the difference between latent and masked defects is?
Answer: Latent defect is a failure that is still hidden as the set of condition were never met that
can uncover a defect.
Masked defect is a defect that has not yet caused because another defect has prevented the area
of code from being executed so that masked defect can be found.

When set of condition or scenario are executed, latent defect will be discovered. masked defect
can be found once the defect preventing to execute area of application is resolved.

249) Explain what LCSAJ is?


Answer: LCSAJ is a short for Linear Code Sequence and Jump is a white box testing technique
and determines code coverage.LCSAJ contains start and end of linear sequence of executable
statements as well as target line where control of flow is transferred at the end of linear sequence.
100% LCSAJ coverage denotes 100% decision coverage.

250) What is Fuzz testing and when it is used?


Answer: Fuzz testing is an automatic test technique where invalid, random and unexpected data
is sent as an input that may result into exceptions like crash, memory leaks or fails to build-in
code assertions. fuzz testing tools for web security testing are Burp Suite, Peach Fuzzer, Spike
Proxy.

251) what is test planning?

Page | 66
Answer: Test plan document is designed by test lead managers per every product under test is a
document that explains scope, approach, resources, and schedule of testing activities. This
document covers test strategies, objective for testing, exit or closure criteria, resource schedule
planning, as well as test deliverables to be included

252) What are commonly used testing types across industries?


Answer: Unit testing, API testing, Integration testing, web services testing, security testing,
automation testing are commonly used testing types across industries.

253) what are the steps to follow when you discover defect?
Answer: Once tester finds a defect in an application, he should complete following steps in order
to register the defect.

 Verify and validate the steps followed and try reproducing the defect.
 Repeat the test steps and ensure that the defect occurs repeatedly.
 Attach screenshots, backend server logs and/or database logs,
 Understand the requirement and analyze the deviation from expected output for the scenario.
 Include the scenario or test case in case, the scenario tested is not covered.
 Report the bug in bug tracking system like Bugzilla or JIRA,
 Analyze the defect and rank it based on its severity.

254) How would you resolve conflict amongst team members?


Answer: It is essential to work in team environment for software development industries. Team
members may face challenges amongst their colleagues while communicating, exchanging their
views, mentoring or allocating the work. Team member conflicts are common while delivering
tasks in high pressure environment.

To resolve conflict amongst team members as a test lead you should

 Talk individually to each person and note their concerns


 Find a solution to the common problems raised by team members

Page | 67
 Arrange a team meeting, reveal the solution and ask people to co-operate

255) What is Charles Proxy testing?


Answer: Charles Proxy testing is a testing for decrypting web traffic on computers and mobile
devices. It is a cross platform HTTP debugging proxy server application that enables user to
view HTTP, HTTPS, and enabled TCP port traffic from and to local computer or mobile device.
In addition, It also records requests and responses along with HTTP headers and metadata (e.g.
cookies, caching and encoding information) during web traffic.

256) What is meaning of Code Walk Through?


Answer: Code Walk Through is a review meeting lead by a developer who has designed the
program code, walks through his/her written code to other member of his team. The purpose of
such review is to impart knowledge transfer to the new team members as well as find defects in
the code, based on the requirement use case scenarios.

257)What things to consider while project monitoring?


Answer: During project monitoring, a manager responsible analyzes all the tasks carried out are
as per plan? Due these tasks any unforeseen consequences that may occur, what is performance
of your project team at given time period, Any change in project elements desired, what could be
an impact on processes due to these changes, After all the actions, will that lead to expected
result?

258) List common pit holes or mistakes that creates issues in project delivery?
Answer: There can be various mistakes that may create issues in project delivery.

 Assigning incompetent resource to manage the project


 Lack of resources and skills
 Doing everything myself approach instead of distribution of work as per resource and their
skills
 Lack of proper communication and failure to pass the message across the stack holders
 Project initiation or start up is poorly managed

Page | 68
 uncertain or unclear objective of project and processes
 Wrong Estimation of time and budget
 Failure to manage scope described in project
 Over micro managing of projects like police and enforcing the pressure in order to achieve
the tasks
 Daily or weekly meets amongst team to update and understand the progress.
 Not following the Processes
These are few of the mistakes that may result in delays in project delivery and there by losing the
project

259) What the basic components of defect report format are?


Answer: The defect report consists of unique identification number by which the defect is
registered in bug tracking software, project, product name, released version, product build, and
module of a software where this defect was observed. Defect report will have summary of defect,
description and steps followed that will reproduce the defect, Actual result and expected result,
defect severity, ie. degree of negative impact on quality of software due to the defect – critical,
major, minor or trivial, priority of defect is the urgency of fixing the defect, name of tester who
has identified the defect, name of developer to whom the defect has been assigned to resolve.
Current status of defect whether it is still new, assigned, open, resolved by developer, under test
by tester, fixed or closed, based on bug life cycle.

260) What is risk-based testing?


Answer: Risk based testing starts with accessing risks related to complexity of logic, business
criticality, defect prone areas in application, frequency of use of sensitive computation of
application features. This involves priority of testing those areas of an software that involve
critical features and functionalities that are likely to fail. Such type of testing involves
experienced testers that have understanding of possible risks involved in mission critical
applications.

 positive impact of risk based testing are opportunity to learn and improve business
sustainability when you test application based on the risks involved
 negative impact of risk based testing are threat of customer dissatisfaction, impact of overall
project cost due to detailed testing, bad or negative user experience, and possible loss of
customers.

Page | 69
261) When is used Decision table testing?
Answer: Decision table testing are used to validate system behavior with different input
combinations. Best example of such tests can be login to the application where there are two
input values, namely username and password and possible output can either be an error with not
allowing to enter in application or allowed to enter the welcome page.

 scenario 1 – username and password both can be wrong, resulting in error


 scenario 2 – username can be correct, but password could be wrong, resulting in error
 scenario 3 – username can be wront, but password could be right, resulting in error.
 scenarion 4 – username and password both can be right and valid, allowing user to the
welcome page.

262) What is a Proxy server?


Answer: Proxy servers acts as a gateway between your client machine’s browser and internet,
offering varying level of security, and good privacy from the threats from hackers and protect
any data loss. Proxy server masks your IP address, thereby gives you additional security.

One can use proxy to access those sites that are otherwise blocked eg. Your school library, or
accessing website back home while travelling abroad, posting comments on websites keeping
your identity hidden.

263) what is test environment?


Answer: Test environment is a setting software and hardware similar to that of production
environment in order to execute test cases and scenarios in order to test and verify the feature
and functionality developed in software results and there by check the quality of software, find
defects in application.

264) what is test execution?


Answer: test execution begin as entry criteria that starts during software testing life cycle, in
order to verify application under test for any defect or deviation between actual and expected
behavior of an application, by following test steps as per test cases and run application to find
bugs.

Page | 70
265) what is the difference between test scenarios, test cases, and test script?
Answer: Following are the definition that differentiate between them

 Test scenario can be a description of test objective, tester can accomplish by testing an
application in multiple ways to ensure that the scenario has been covered with satisfaction.
 Test case is summary of test scenario with steps or procedure to carry out with test data to the
application in order to validate that the application behaves as expected, or reproducing the
defect by following the steps written in test case, there by validate that the actual result
deviate from expected result.
 Test script is steps in order to mimic test case to validate application’s behavior as expected
or behaves differently to locate defect.

266) What all things you should consider before selecting automation tools for the AUT?
Answer: Following are few points to be considered before selecting automation tool for
application under test.

 Suitability of tool to accomplish types of tests to be carried out.


 Skills require configuring and designing scripts to execute in order to run application as per
test scripts.
 Ability to capture reports, status of tests by the tool.
 Availability of resources that can understand the technology used in designing the scripts and
tool.
 Price of the tool and its implications on project cost.

267) How will you conduct Risk Analysis?


Answer: Risk analysis can be conducted by analyzing the testing methods and selection of tests
and way in which it is carried out by testers, skills in identifying risks, prioritize their impact, and
create mitigation plans where appropriate in case those risks become real issues.

There are various aspects of project that impact risk such as estimation of resources and duration
of activities, schedule, cost estimates, budget, quality and decision of either rent cloud services or
procurement of infrastructure.

Page | 71
268) How would you allocate responsibilities to your team members?
Answer: Team manager or test lead should allocate responsibilities to your team members to
achieve the team’s goals. Roles or responsibility assigned to the team member based on his/her
skills, experience and abilities, in such a way that it increases his morale and motivation.

269) What Is Docker?


Docker describes themselves as “an open platform for developers and sysadmins to build, ship,
and run distributed applications”. Docker container image is standalone, lightweight, executable
package that includes code, runtime, system tools, libraries and settings required to run the
software. This can be quickly deployed and run on different computing environments.

270) What is ETL testing / Data warehousing testing?


Answer: ETL testing is for Extract required data or information from data warehouse, Transform
data in order to make it suitable so that it can be loaded into the database. ETL testing is process
of validating, verifying and qualifying data preventing data duplication and data loss.

271) What steps would you verify in case your desktop takes too long to start up?
Answer: In case slower Microsoft Windows startup (boot up) are due to various reasons

 Disable startup programs by observing by starting Windows task manager


 Running ScanDisk and Defrag utility tools in order to free up hard drive from any errors
 Check if hard drive space is insufficient, by removing any junk files or unused programs
 Verify if computer is running with corrupt, incorrect, or out of data drivers as well as older
version of windows operating system required to upgrade.
 Try clean system registry
 Try considering format and reinstall Windows on the computer.

272) What do you mean by Defect Triage?

Page | 72
Answer: Defect triage is process of analyzing defect priority based on factors such as severity,
risk, and time required to fix /resolve the defect. During defect triage meet, stack holders discuss
and decide the priority of fixing the defects.

273) What is a test harness? Why do we need a test harness?


Answer: Test harness is collection of test data, software and scripts that drive software to execute
test case or steps in order to verify its behavior and output. Test execution engine and test script
repository are two main parts of test harness. Usually exists while unit and integration testing, it
involves stubs and drivers that are required for testing software modules and integrated
components.

274) Why software has bugs?


Answer: Defects occur in software due to various reasons such as

 Software complexity – making developer difficult to understand requirement, or how to


design the desired output.
 Miscommunication between product team and customer in knowing the exact requirement.
 Programming errors during runtime or compile time of code base during integration process.
 Timeline pressure that limits unit testing of all possible scenarios on design codes or
programs
 Change in requirements by customer that can introduce defect in already running application
code.

275) What is Cause Effect Graph?


Answer: Cause Effect Graph is a black box test technique that represents graphically relation
between outcome and factors that affect the outcome, which assist in designing test cases.

276) What are the different strategies for roll out to end users?
Answer: Software Roll out to end users has following strategies

Page | 73
 Pilot: The actual production system is installed at a single or limited number of users. Pilot
basically means that the product is actually rolled out to limited users for real work.
 Gradual Implementation: In this implementation we ship the entire product to the limited
users or all users at the customer end. Here, the developers get instant feedback from the
recipients which allow them to make changes before the product is available. But the
downside is that developers and testers maintain more than one version at one time.
 Phased Implementation: In this implementation the product is rolled out to all users in
incrementally. That means each successive rollout has some added functionality. So as new
functionality comes in, new installations occur and the customer tests them progressively.
The benefit of this kind of rollout is that customers can start using the functionality and
provide valuable feedback progressively. The only issue here is that with each rollout and
added functionality the integration becomes more complicated.
 Parallel Implementation: In these types of rollouts the existing application is run side by side
with the new application. If there are any issues with the new application we again move
back to the old application. One of the biggest problems with parallel implementation is we
need extra hardware, software, and resources.

277) What are error guessing and error seeding?


Answer: Description between Error Guessing and Error Seeding as details below.

 Error Guessing – It is a test case design technique in which testers have to imagine the
defects that might occur and write test cases to represent them.
 Error Seeding – It is the process of adding known bugs in a program for tracking the rate of
detection & removal. It also helps to estimate the number of faults remaining in the program.

278) Do you feel comfortable standing up to developers who disagree with your results?
Answer: In some situations, reporting failures can be a delicate process. Perhaps a developer
spent a lot of time on some code which does not exactly meet specifications. QA engineers need
to be able to stand up for what they know is right.

279) Are you willing to cut corners to save time?


Answer: The correct answer is NO. All test cases need to be run, and making assumptions
frequently leads to issues down the road, because as a Software quality tester it is your duty to
cover all the scenarios for the application for test coverage. It may happen that in case some area
of test uncovered may contain error at client side, and you can fall on your face by not testing
that area.

Page | 74
280)What is validation in software testing?
Answer: The meaning of validation is to confirm if application or system designed is in
compliance with the client’s requirements and its feature functions as desired and thereby meets
goals and needs of end user. In short it is to verify the software build is right product.

281) What is verification in software testing?


Answer: The meaning of verification is to confirm that the designed product delivers and
satisfies all the functionalities expected to fulfill as expected by end user. In short it is to test
whether the product build is right (functions as expected)?

282)What is API testing?


Answer: API testing is a part of integration tests that verifies that the application programming
interface communicates between two different systems and meets functionality, reliability,
performance, and security as expected by client. Various API testing tools are SOAPUI, Postman
and REST Assured.

283)What is web service testing?


Answer: Web service testing validates web services build on API works as expected. The
functionality, reliability, performance, and security of application programming interface (API)
provided to communicate in order to receive response of requests sent via HTTP protocol over
an internet. Web services can be tested by asking requests over internet via HTTP protocol and
receives response. Various web service testing tools are SOAPUI, Postman and JMeter, vRest

284) What is Postman?


Answer: Postman is open source API client that sends REST, SOAP and GraphQL requests and
used to test RESTful API that have been created. It uses GET, PUT, POST and other HTTP
methods in order to verify API functionality.

285) What is REST Assure?

Page | 75
Answer: REST assured is a java based library used to test RESTful API and web services, HTTP
responses, status code, status messages and headers and body of responses.

286)What is Cucumber?
Answer: Cucumber is a tool that supports Behavior driven development, allowing expected
software behavior specified into logical language a customer can understand. This tool is
developed using Ruby, and Gherkin which is the format for cucumber specifications.

287)What is Capybara?
Answer: Capybara is a web-based automation framework used for creating functional tests that
simulate how users would interact with your application. It supports selenium web driver,
JavaScript, HTTP resources outside of application, used in running automated functional tests for
web based application.

288)What is Salesforce?
Answer: Salesforce is a cloud based customer relationship management service, designed to help
you sell, service, market, analyze, and connect with your customers. This is software that stores
customer contact information like names, addresses, and phone numbers, as well as keeps track
of customer activity like website visits, phone calls, email, and more.

289) What is TestNG?


Answer: TestNG is an automation testing framework used to cover a wider range of test
categories: unit, functional, end-to-end, integration, etc., with more powerful and easy-to-use
functionalities such as use of annotations, parallel testing etc. for application developed using
java programming language.

290)What is TeamCity?
Answer: TeamCity is continuous integration servers that help integrate the code, build an
application in premise and over the cloud.

Page | 76
291) What is Gradle?
Answer: Gradle is a build automation tool for multi language software development. It helps to
compile, package, test, and deploy an application.

292)What is Framework?
Answer: Software framework is a structured way in which certain type of files are saved at
particular folders, making it uniform to use and search for by end users and development team,
eg. Eclipse is an integrated development Environment where various project can be designed by
keeping together compiled code and reference classes in such a way that their integration is taken
care by eclipse internally making developers free from integration of these files. Eg. JavaScript
framework, Application framework, web framework and Ajax framework.

293) Have you heard about Teradata?


Answer: Teradata is one of the relational database management systems, suitable for building
large scale data warehousing applications for large volumes of data. Used in telecom, social
platforms like twitter, face book, and online marketplace such as amazon, flipkart, and other
ecommerce sites.

294) Have you heard about Hadoop?


Answer: Hadoop is an open source framework or collection of software utilities that stores data
and runs applications on clusters, providing massive storage for any kind of data, processing
power and limitless concurrent tasks.

295) Have you heard about Hansoft agile planning tool?


Answer: Hansoft is an agile planning tool providing single platform for decision making at
project, program and portfolio level, can be extended to diverse and dispersed teams across the
globe for various projects.

296)What is JIRA Issue and project tracking tool?

Page | 77
Answer: Jira help create user stories and issues, plan sprints, and distribute tasks across software
teams, prioritize and discuss team’s work with complete visibility; keep track of latest release
related information and real time visual data on team’s performance.

297) What do you think our company could do better?


Answer: This interview question helps you to uncover how much research the candidate did
before meeting with you, and it demonstrates their ability to think on the spot.

298) What experience do you have with developing corner cases?


Answer: This question will help you to figure out if your tester is willing to dig for different test
case scenarios that might not be as intuitive or clear up front.

299) Explain any of bug tracking tool,


Answer: I have used Bugzilla, to log bugs and track their status during software development life
cycle, Once the bug and its description and steps carried out to reproduce it is logged in, and
assigned to developer. The defect can be searched using advanced search, it is very easy to use,
and is lightweight open source software for bug management.

300) What is DevTrack cloud based development?


Answer: DevTrack is a cloud based software development tracking software that keep connected
with all the stackholders, interact, communicate and thus manage, prioritize and track tasks, and
bugs during development lifecycle. create projects, sprints and user stories on the fly, view and
share real time reports and data to analyze project status.

301) Did you use TestRail Test case management tool?


Answer: TestRail is powerful test management, test execution, and results tracking, as well as
project and quality planning. It helps capture test results, attach files and logs, screenshots as a
proof of testing, and link with bugs registered.

Page | 78
302) What is configuration management?
Answer: configuration management is to maintain optimum state of product such as hardware,
software and network as an infrastructure’s performance, functional and physical attributes in
line with its requirement, design and operations in order for their best performance throughout its
life.

303) What are popular configuration management tools you have heard of?
Answer: Popular configuration management tools are Ansible, Chef, Puppet Enterprise,
Terraform to name a few which are industry famous configuration management tools for
infrastructure maintenance.

304) What is scalability testing?


Answer: Scalability testing is test methodology where performance of application is tested by
measuring scale up and scale down the number of user requests and cope up with the load
accordingly. eg. Amazon cloud services offer best real time example where during peak hours
amazon an online shopping web portal handles extreme load of user’s accessing the site and in
normal case very few customers accessing the site.

305) What is concurrency testing?


Answer: Concurrency testing is verifying the performance and load bearing capacity of
application when multiple users accessing the website and performing same action such as
accessing the pages, searching the products, checking the review and shop the selected products
online. concurrency testing checks latency of page load, and quick response rate during peak
hours with multiple users logged in to the web portal.

306) What is endurance testing?


Answer: Endurance testing is non functional testing of an application where the behavior of
application is analyzed with a significant load extended over significant interval / period of time.
It differs from load testing where load bearing capacity of an application is measured. In
endurance testing the goal is to check any memory leaks and how system performs under
sustained usage.

Page | 79
307) Have you appeared for ISTQB foundation test?
Answer: Many companies have hiring criteria of to hire someone who has passed ISTQB
foundation exam as a tester, as it validates ability to understand testing related terms and
principles in software industry. ISTQB foundation test is an universally accepted online exam to
assessment of knowledge on fundamentals of software testing for testing professionals. If you
have already appeared for the exam and passed this exam you can mention it. But if you have
been thinking of appearing for this exam, you should convince the interviewer that you will
sooner appear for the same.

308) When should you stop software testing activities?


Answer: Software testing activities can be stopped based on following factors

How many Test case execution completed and bugs occured fixed during the regression testing

Based on the Testing deadline decided in test plan by project manager

Mean Time between Failures(MTBF)rate if reduced and is within the acceptable rate.

Code Coverage Ratio can be calculated based on various tests like statement coverage, branch
coverage etc.

309) Can you explain in short 7 principles of software testing?


Answer: Seven principles of software Testing are as below

1. Testing shows presence of defects – testing any software will uncover defects in it
2. Early Testing is essential and will help defect in the initial stage of development.
3. Exhaustive testing is not possible – It is not possible to check each and every condition and
criteria of application.
4. Testing is context Dependent – Different domains are tested differently, thus testing is purely
based on the context of the domain or application.
5. Defect clustering – 80% of the problems are found in 20% of the modules.
6. Pesticide paradox – the set of test cases needs to be regularly reviewed and revised.
7. Absence of Error is fallacy as it will be impossible to imagine software without a defect.

Page | 80
310) What is Defect Clustering ?
Answer: Defect clustering is accumulation of most of the defects are found in just few modules.
It is said that 80% of defects are found in 20% of modules.

Defect clustering occures in following scenarios

1) When defects surface even after testing with multiple test cases and scenarios.

2) These defects show up only around some application features.

311) What is Defect Density?


Answer: Defect Density is number of confirmed defects identified in software/module during a
development period divided by the size of the software. It is calculated as defect count/size of the
release, where size of release is total line of code in release.

e.g. if module1 has 25 bugs, module2 has 15 bugs, and module3 has 50 bugs, total number of
code per modules are module1 has 1250 LOC (lines of code), module2 has 2575 LOC , and
module3 has 7500 LOC, then Total bugs = 25+15+50 = 90, and size = 1250+2575+7500
= 11325, Defect density will be = 90/11325 = 0.00794 defects/loc = 7.94 defects/Kloc.

312) What is Age of Defect?


Answer: Age of Defect is the difference of time from date when defect was detected till the date
defect was fixed Or a current date if defect is still open (not resolved).

313) What is Build?


Answer: software build is a process that converts code files by compiling these files and with all
dependent files forms an application which accomplishes the features and functionality expected
by the end user. The build contains compiled source files compressed formats such as jar or zip
formats.

Page | 81
314) What is release?
Answer: Software release is a deployable software package after several iterations, where all
defects have been fixed to be installed at Production environment.

315) What is a difference between Build and release?


Answer: DevOps team gives Build to the testing team, release is tested and accepted version of
product to their customers. Build is tested by testing team and after all the major and critical bugs
have been resolved then this build becomes a release for the customers. Build can be rejected by
testing team if it does not meet client’s requirements.

316) Can you list some Continuous integration tools?


Answer: Jenkins, TeamCity, Bamboo CI, GitLab CI, and Cruise Control are some of famous
continuous integration tools used across software industries.

317) Can you list some Continuous Deployment tools?


Answer: Jenkins, TeamCity, Bamboo, GitLab, and Octopus Deploy are some of famous
continuous deployment tools used across software industries.

318) What tools for version control have you used?


Answer: CSV, SVN and GIT are some very famous version control tools/softwares used across
software DevOps community.

319) What API testing tools you are aware of?


Answer: SOAPUI, Postman, and REST Assure are some of the well known API testing tools.

320) What Test management tools did you use?


Answer: Zephyr, JIRA, TestLink and TestRail are few test management tools, to know more
about test management tools refer link https://www.qafox.com/test-management-tools/

Page | 82
321) What is CRUD stands for?
Answer: CRUD stands for CREATE, READ, UPDATE, DELETE. In relational database
applications these are major functions that are implemented.

322) What important web browsers do you know?


Answer: You can very well have known that Mozilla Firefox, Google Chrome, Opera and Safari
along with Internet Explorer are important browsers accepted and used by end users and clients
as approved browser for application under test.

323) What Operating systems you are aware of?


Answer: You may have worked on various operating systems such as Windows 7 or Windows
XP, Ubuntu, Linux or Unix.

For Windows operating system in desktop computer,

 select Computer icon,


 right click and select Properties,
 will open You will come to know what windows version / edition etc.

For Unix or Linux operating system,

 open terminal,
 type For remote server login using the ssh:ssh user@server-name
 Type any one of the following command to find os name and version in Linux:
 cat /etc/os-release. OR lsb_release -a. OR hostnamectl.
 Type the following command to find Linux kernel version:
uname -r

Page | 83
324) What is CRM software?
Answer: CRM stands for customer relationship management, improves enhanced
communication, managing sales team and customer opportunities, determining high quality sales
leads, sales analytics, reports and dashboards, integration over email and mobile phones.

325) List few of CRM software used for customer relationship management.
Answer: Salesforce, Pipedrive, Insightly, Zoho CRM, and Hubspot CRM are some of the CRM
softwares utilized in sales and customer relationship management activities.

326) What Is Cyclomatic Complexity in software testing?


Answer: Cyclomatic complexity for a section of code is measure of number of independent
linear path taken by it. This is a standard of measurement of complexity of a program or code.
for eg. there are multiple if statement in a program code, then total number of path will be equal
to number of if statements.

327) Mention the categories of debugging?


Answer: There are mainly four categories of debugging

 Brute force
 Backtracking
 Cause elimination
 Program slicing

328) How do you go about learning a new product?


Answer: It is essential for all IT professionals to update his/her skills with new technologies,
languages, software, tools and keep pace with new advancements in technologies. In order to
learn new product, one should start researching about it on product’s website under introduction
or documentation, understand installation and install the software on his/her machine. Configure
it and follow ‘Getting Started’.

Page | 84
This will give you confidence as you are doing and accomplishing on newer areas which you
have not explored. In case of new languages, read tutorials and watch you-tube videos.

329) How you coped with having to learn any new skills?
Answer: You should answer above question by showing how passionate you are about knowing,
learning and updating your skills.

You may say as, during my initial days with previous job as software developer trainee, It was a
challenge to prove myself in 6 month of probationary period.

I began learning UNIX commands, took a course where basics of computer peripherals was
taught. Lab training and surprise tests helped me a lot. My team lead and managers have
supported and encouraged me to pursue various courses and certifications. This helped me gain
solid background in basic knowledge.

330) What is performance testing?


Answer: performance testing is non-functional testing type to determine the speed,
responsiveness and stability of computer, network, desktop or web based applications under
load. Superset of load and stress tests are spike, volume, endurance, and scalability testing.
During performance testing attributes like speed, response time, throughput, resource usage, and
stability are tested.

331) What is Load testing?


Answer: A subset of performance testing, is non functional type where analysis of system
behavior during normal and peak conditions where highest number of logged in users as well as
first time visitors exploring the site. Some of the load testing tools are LoadRunner, Apache
JMeter, NeoLoad and LoadNinja used in industry.

332) What is Stress Testing?


Answer: Stress Testing is non functional testing to measure limit till software withstands the
load, or limit at which system or software or hardware breaks.

Page | 85
333) What is Spike Testing?
Answer: Spike Testing is non functional testing where application under test are tested against
sudden and extreme increase or decrease in load, the extreme variations are measured in such
type of performance tests.

334) What is Volume Testing?


Answer: when software is subjected to high value of data, the performance test is known as
volume testing.

335) How well do you work with others?


Answer: It is important and essential to work with others and usually in groups with people of
different likes, dislikes, beliefs and expertise. Team work is a basis to achieve shared goal or
outcome in an effective way. You as an individual have to listen to other team members, share
your view, discuss and come with best way to bring the best work output from team shared
efforts. This question is asked to understand you as a team player, ability to work in team, share
your opinion and convince your group for best results, and find out how good communicator you
are?

336) What motivates you?


Answer: This is a tricky question asked where if you have not prepared cannot answer such
questions. Interview here want to know you are honest about your motivations and how would it
benefit with the job offered to you. Various factors like

 meeting deadlines,
 targets or goals,
 mentoring and coaching others,
 learning new things and
 Finding a way to solve a problem, or overcome a challenge.

337) Have you worked as independent contributor?

Page | 86
Answer: In this interviewer want to know that Are you able to manage your task without any
supervision? How reliable you are if given position which needs your own decisions and
instincts to drive yourself. In such position, co-workers from other department may rely on your
work to complete their work. For eg. if you are accounts receivable clerk, your making invoices
will help product dispatch department, your collection of payments from customers will bring in
salary for entire staff.

338) Explain PDCA Cycle (Plan-Do-Check-Act).


Answer: PDCA OR Plan Do Check Act is an iterative four step management method to control
and continuously improve processes and products. PDCA cycle are used while starting a new
project, repetitive work by analyzing following

 What is a core problem need to solve,


 Resources we need, what resources we already have,
 Best optimum solution to fix the problem, How to bring success to your plan.

339) Give one example of High priority and high severity


Answer: The Design software gets stuck or hangs often when enter key have been pressed to
review the final draft. This is defect of high priority and high severity and should be resolved and
corrected as such product cannot be shipped to client.

340) Give one example of High priority and low severity


Answer: If a Company name is misspelled on the home page of web portal, is an example of
high priority to be fixed as it may impact company reputation or may represent as fake product
with misspelled company name. However other functionality in the web portal will function
perfectly.

341) Give one example of Low priority and high severity


Answer: A printer printing multiple copies instead of single copy has a high severity as the
customer will experience wastage, due to printing task still pending. This can be fixed in next
release of the product.

Page | 87
342) Give one example of Low priority and low severity
Answer: The example of Low priority and low severity can be Spelling, Grammatical,
punctuation marks not properly placed, such mistakes in product labels.

343) Describe a situation where you successfully collaborated with developers to deploy a
program or application.
Answer: Interviewer wants to understand how do you handle your tasks in day to day basis, Are
you motivated by accomplishing tasks that needs collaboration with other team members from
different department? Can you convey your message to someone who is not from your team.
Finally your convincing and ability to drive or influence others is measured by this question.

344) Describe a time when you acted proactively to increase system performance.
Answer: In this question, interviewer wants to ascertain your proactiveness towards standards
accepted and required by organization. You can narrate a story where you have proved your
mattel by convincing your team lead, managers and product head to improve upon system
performance by replacing hardware configuration and suggesting better alternatives hardware to
install supplied software for better performance.

345) How do you keep up-to-date with industry developments? Are there specific blogs or
forums you read?
Answer: This is a question where you can answer based on your reading and being upgrade with
latest technologies and industry developments, Where in you may be receiving emails from
various domain experts, blogs, read articles and tutorials on various technologies in demand.

346) What process are you using for testing currently? Can you describe how you might
improve it?
Answer: As a software tester, you may be working on black box testing like functional,
regression, smoke, database testing, API testing, web services testing etc. These are functional
tests, then integration tests and then non functional i.e. performance testing. Use of automation in
API and database testing using scripts can improve the testing efforts.

Page | 88
347) What is your favorite testing tool? Why? If some technical constraint meant you were
unable to use it, what would you do instead?
Answer: You may answer this question only when you are aware of testing tools and what test
types these tools are used for. You can explain why tool is favorite, as what special features
make this tool unique from other tools testing same type of testing. Interviewer wish to
understand, how is your view with finding alternative solution or workaround, To what extent
you are dependent to the environment, circumstances, teammates, tools, personal computer etc.
Or you can quickly adapt the change. You should be well versed with the testing tool that is
favorites, You should able to substitute in case it is not available.

348) How to handle a situation when you don’t have time for complete testing?
Answer: Interviewer wants to know, how do you react real time scenario when there is a delivery
and acceptance testing is on the way, what tests will you take on priority? The answer to this
question will depend on how did you work and perform under pressure environment. The most
critical feature that was not working and have been send with a defect, It is mandatory to check if
the critical and major bugs have been resolved or not, The regression tests should be carried out
and integration tests that validates feature, end to end testing should be carried out. Based on the
test results, we can decide to release the build or not.

349) Do you measure how effective (or not) your testing is? What metrics do you use?
Answer: You need to organize things first – You need to plan testing procedure, how will you
divide the testing process, various types, test cases based on the test types, how will you test test
cases – using automation scripts or manual? Will you keep updating spreadsheets during testing
application over version control software OR use test management tools like JIRA or Bugzilla so
that all the testing execution, the date of execution, test cases executed, test status, registered
bugs etc. can be accessed by everyone on central location.

Writing detailed bug reports with clarity, backend logs captured during reproducing the defect.

Test cases should be written clearly, with all steps and expected results, attend daily meets
between team members and share concerns regarding any issues if any. Ask question to our self
to understand better. Exploration of application to know the features, ultimately find out various
bugs in it.

Page | 89
350) How well do you work under pressure and with deadlines?
Answer: In Agile environment where requirements change frequently, development and testing
activities are carried out in 2 weeks of interval where user stories need to be converted as
working features in the software under development, testers need to verify that these features are
designed as required by the end user. Regression tests are required to be carried out to verify
resolved defects are fixed and no new bugs gets uncovered.

351) What different software testing methods are used by a software company?
Answer: There are mainly three software testing methods used during testing of their application
namely

 black box,
 white box and
 grey box

352) Name some of the test cases that you can automate.
Answer: Types of test cases that can be automated are

 Smoke test cases,


 Regression test cases.
 Data-driven test cases and
 Non-functional test cases.

353) Name some roll out strategies for end-users.


Answer: There are multiple strategies to choose from, you can select either of these according to
your requirements-

 Pilot
 Gradual Implementation
 Parallel Implementation

Page | 90
 Staged Execution

354) What is Application Binary Interface (ABI)?


Answer: Portability of applications in binary forms across different systems, platforms and
environments being the requirement defined in specifications of an interface known as
Application Binary Interface (ABI). For conformation to an ABI specification, testing of an
executable application is mandatory for portability across system platforms and environments.

355) What is a interruption testing?


Answer: In telecom industries mobiles and landlines call drop has been a common cause of
interruption, which may have adverse effect on application in use, testing an application for
interruption for behavior of application during interruption and then back to the point of start
without any error or not?.

356) What is CMM – Capability Maturity Model for a software?


Answer: Capability Maturity Model for software is a model for judging the maturity of the
software processes of an organization and for identifying the key practices that are required to
increase the maturity of these processes.

357) When is a case where automating a test case is not viable solution?
There are many advantages of test automation and test cases should be automated when possible
and when appropriate. However, there are certain scenarios when test automation is not
preferable and manual testing is a better option:

 When the validation depends on the person performing the test (UI/UX, usability, look-and-
feel)
 When the feature is being developed with constant changes and automating the test cases
would mean a waste of resources
 When the test cases have extreme complexity and automating them would be a waste of
resources
 When the requirement is for testers to perform manual sessions in order to gain deeper insight
into the system

Page | 91
358) How well do you deal with Ambiguity?
Answer: Ambiguity is scenario which is open to more than one criterion, making it unclear to
decide, There are various use cases or test cases are not generally straightforward and QA
Engineers should follow up on their own judgment. They have to feel great with ambiguity.

359) What is Emulator?


Answer: Emulator A device, computer program, or system that behaves like another system and
accepts the same inputs and produces the same outputs as a given system, it behaves as
translator.

360) What is Simulator?


Answer: A simulator is designed to create an environment that contains all of the software
variables and configurations that will exist in an application’s actual production environment.

361) What is CAST?


Answer: CAST is a short for Computer Aided Software Testing, refers to the computing-based
processes, techniques and tools for testing software applications or programs carried out using
combination of software and hardware based tools.

362) What is Race Condition?


Answer: RACE is a problem caused due to multiple accesses to a shared resource, one of which
is a write privilege, undesirable situation that occurs when a device or system attempts to
perform two or more operations at the same time.

363) What is Binary Portability Testing?


Answer: Binary Portability Testing is a test to verify portability across different platforms and
environments, these tests validates Application Binary Interface specifications; it is carried out
on various Windows flavors of operating systems, Linux, Mac OS, Java, Solaris and Android
operating systems

Page | 92
364) What are the challenges that you face as a software tester in the current/previous
company?
Answer: Interviewer wants to dig into your sentimental area of mind, where in case you out of
excitement reveal pain areas and tough situations you are facing at present, it will be an input for
the recruiter to assess your potential or limit of stress that you can handle during pressured
environment and deal with people with discipline.

365) What is a difference between functional and non functional testing?


Answer: Following are the difference between functional testing and non functional testing

Functional Testing Non Functional Testing

Verifies operations and actions on application under Verifies behavior of application when subjected to
test load or stress

These tests checks if features functions as expected by These type of tests checks applications are developed
end user’s requirements as per expectations of end user

Non functional tests improves performance of an


Functional tests helps enhance user experience application

Types of functional tests are unit testing, smoke tests, Types of non functional tests are performance, load,
integration tests, regression tests stress, and scalability tests

366) What is an error seeding?


Answer: Error seeding is a process of intentionally adding a defect in an application to identify
the pace of error detection as well as tester’s understanding of functionality of an application

367. What do you mean by Software Testing?


Ans. Software testing is the process of evaluating a system to check if it satisfies its business
requirements. It measures the overall quality of the system in terms of attributes. Like –
correctness, completeness, usability, performance, etc.

Basically, it is used for ensuring the quality of software to the stakeholders of the application.

Page | 93
368. Why is testing required?
Ans. We need software testing for the following reasons-
1. Testing provides an assurance to the stakeholders that the product works as intended.

2. Avoidable defects leaked to the end-user/customer without proper testing adds a bad
reputation to the development company.

3. Defects detected earlier phase of SDLC results in lesser cost and resource utilization of
correction.

4. Saves development time by detecting issues in an earlier phase of development.

5. The testing team adds another dimension to the software development by providing a different
viewpoint to the product development process.

369. When should we stop testing?


Ans. Testing (both manual and automated) can be stopped when one or more of the following
conditions are met-

1. After test case execution – The testing phase can be stopped when one complete cycle of test
cases is executed after the last known bug fix with the agreed-upon value of pass-percentage

2. Once the testing deadline is met – Testing can be stopped after deadlines get met with no
high-priority issues left in the system.

3. Based on Mean Time Between Failure (MTBF) – MTBF is the time interval between two
inherent failures. Based on stakeholders’ decisions, if the MTBF is quite large, one can stop the
testing phase.

4. Based on code coverage value – The testing phase can be stopped when the automated code
coverage

370. What is Quality Control and what are the different types of testing involved in QC?
Ans. Quality control is a product-driven approach that checks that the developed product
conforms to all the specified requirements. It is considered a corrective measure as it tests the
built product to find the defects. It involves different types of testing like functional testing,
performance testing, usability testing, etc.

371. What is the difference between Verification and Validation?


Ans. The following are the major differences between verification and validation-

372. What is SDLC?


Ans. SDLC stands for Software Development Life Cycle. It refers to all the activities performed
during software development – requirement gathering, requirement analysis, designing, coding
or implementation, testing, deployment, and maintenance.

Page | 94
373. Explain the STLC – Software Testing life cycle.
Ans. The software testing life cycle refers to all the activities performed during the testing of a
software product. The phases include-
 Requirement analysis and validation – In this phase, the requirements documents are
analyzed and validated and the scope of testing is defined.
 Test planning – In this phase, the test plan strategy is defined, the estimation of test
effort is defined along with the automation strategy, and tool selection is done.
 Test Design and Analysis – Here, test cases are designed, test data is prepared and
automation scripts are implemented.
 Test environment setup – A test environment closely simulating the real-world
environment is prepared.
 Test execution – The test cases are prepared, bugs are reported and retested once
resolved.
 Test closure and reporting – A test closure report is prepared to have the final test
results summary, learning, and test metrics.

374. What are the different types of testing?


Ans. Testing can broadly be defined into two types-
 Functional testing – Functional testing involves validating the functional specifications
of the system.
 Non Functional testing – Non-functional testing is a type of testing that involves testing
of non-functional requirements of the system such as performance, scalability, security,
endurance, portability, etc.
Going by the way the testing is done, it can be categorized as-

 Black-box testing – In black-box testing, the tester need not have any knowledge of the
internal architecture or implementation of the system. The tester interacts with the system
through the interface providing input and validating the received output.

 White box testing – In white box testing, the tester analyses the internal architecture of
the system as well as the quality of source code on different parameters like code
optimization, code coverage, reusability, etc.

 Gray box testing – In gray box testing, the tester has partial access to the internal
architecture of the system e.g. the tester may have access to the design documents or
database structure. This information helps the tester to test the application better.

375. What is manual testing?


Ans. Manual testing is a type of testing that involves validation of the requirements of the
application by executing a predefined set of test cases manually without the use of any
automation tool.

376. What is automation testing?


Ans. Automation testing is a type of software testing that involves automated test case execution

Page | 95
using an automation tool. It helps in reducing the test execution time as the test scripts written
once, can be run automatically any number of times without any human intervention.

377. What are some advantages of automation testing?


Ans. Some advantages of automation testing are-
1. Test execution using automation is fast and saves a considerable amount of time.
2. Carefully written test scripts remove the chance of human error during testing.
3. Test execution can be scheduled for a nightly run using CI tools like Jenkins which can
also be configured to provide daily test results to relevant stakeholders.
4. Automation testing is very less resource-intensive. Once the tests are automated, test
execution requires almost no time of QAs. Saving QA bandwidth for other exploratory
tasks.

388. What are some disadvantages of automation testing?


Ans. Some disadvantages of automation testing are-
1. It requires skilled automation testing experts to write test scripts.
2. Additional effort to write scripts is required upfront.
3. Automation scripts are limited to verification of the tests that are coded. These tests may
miss some error that is very glaring and easily identifiable to human(manual QA).
4. Even with some minor change in the application, script update and maintenance is
required.

389. What is performance testing?


Ans. Performance testing is a type of non-functional testing in which the performance of the
system is evaluated under expected or higher load. The various performance parameters
evaluated during performance testing are – response time, reliability, resource usage, scalability,
etc. The different types of performance testing are – Load, Stress, Endurance, Spike, and Volume
Testing.

390. What is a test bed?


Ans. A test bed is a test environment used for testing an application. A test-bed configuration can
consist of the hardware and software requirements of the application under test including –
operating system, hardware configurations, software configurations, tomcat, database, etc.

391. What is a test plan?


Ans. A test plan is a formal document describing the scope of testing, the approach to be used,
the resources required, and the time estimate for carrying out the testing process. It is derived
from the requirement documents (Software Requirement Specifications).

392. What is a test scenario?


Ans. A test scenario is derived from a use case. It is used for end-to-end testing of a feature of an
application. A single test scenario can cater to multiple test cases. Scenario testing is particularly
useful when there is a time constraint while testing.

393. What is a Test case?


Ans. A test case is used to test the conformance of an application with its requirement

Page | 96
specifications. It is a set of conditions with pre-requisites, input values, and expected results in a
documented form.

394. What are some attributes of a test case?


Ans. A test case can have the following attributes-
1. TestCaseId – A unique identifier of the test case.
2. Test Summary – One-liner summary of the test case.
3. Description – Detailed description of the test case.
4. Prerequisite or pre-condition – A set of prerequisites that must be followed before
executing the test steps.
5. Test Steps – Detailed steps for performing the test case.
6. Expected result – The expected result in order to pass the test.
7. Actual result – The actual result after executing the test steps.
8. Test Result – Pass/Fail status of the test execution.
9. Automation Status – Identifier of automation – whether the application is automated or
not.
10. Date – The test execution date.
11. Executed by – Name of the person executing the test case.

395. What is Test data?


Ans. Test data is data that is used to test the software with different inputs and helps to check
whether the corresponding output is as per the expected result or not. This data is created based
on the business requirements.

396. What is a Test script?


Ans. A test script is an automated test case written in any programming or scripting language.
These are basically a set of instructions to evaluate the functioning of an application.

397. What is an Error in Software Testing?


Ans Since we all are humans so it is obvious to make a mistake. Likewise, an error is a similar
case that happens in software testing due to some missing scenario in the requirements, some
issues in design, or some mistakes in the implementation.

398. What is a Bug?


Ans. A bug is a fault in a software product detected at the time of testing, causing it to function
in an unanticipated manner.

399. What is a defect?


Ans. A defect is non-conformance with the requirement of the product detected in
production (after the product goes live).

400. What are some defect reporting attributes?


Ans. Some of the attributes of a Defect report are-
 DefectId – A unique identifier of the defect.
 Defect Summary – A one-line summary of the defect, more like a defect title.
 Defect Description – A detailed description of the defect.

Page | 97
 Steps to reproduce – The steps to reproduce the defect.
 Expected Result – The expected behavior from which the application is deviating because
of the defect.
 Actual Result- The current erroneous state of the application w.r.t. the defect.
 Defect Severity – Based on the criticality of the defect, this field can be set to minor,
medium, major, or show stopper.
 Priority – Based on the urgency of the defect, this field can be set on a scale of P0 to P3.

401. What are some of the bug or defect management tools?


Ans. Some of the most widely used Defect Management tools are – Jira, Bugzilla, Redmine,
Mantis, Quality Center, etc.

402. What is defect density?


Ans. Defect density is the measure of the density of the defects in the system. It can be calculated
by dividing the number of defects identified by the total number of lines of code(or methods or
classes) in the application or program.

403. What is defect priority?


Ans. A defect priority is an urgency of fixing the defect. Normally the defect priority is set on a
scale of P0 to P3 with the P0 defect having the most urgency to fix.

404. What is defect severity?


Ans. Defect severity is the severity of the defect impacting the functionality. Based on the
organization, we can have different levels of defect severity ranging from minor to critical or
show stopper.

405. Give an example of Low priority-Low severity, Low priority-High severity, High
priority-Low severity, and High priority-High severity defects.
Ans. Below are examples for different combinations of priority and severity-
1. Low priority-Low severity – A spelling mistake in a page not frequently navigated by
users.
2. Low priority-High severity – Application crashing in some very corner cases.
3. High priority-Low severity – Slight change in logo color or spelling mistake in the
company name.
4. High priority-High severity – Issue with login functionality.

For details, check – Priority & Severity with Examples

406. What is a blocker?


Ans. A blocker is a bug of high priority and high severity. It prevents or blocks testing of some
other major portion of the application as well.

407. What is a critical bug?


Ans. A critical bug is a bug that impacts a major functionality of the application and the
application cannot be delivered without fixing the bug. It is different from the blocker bug as it
doesn’t affect or block the testing of other parts of the application.

Page | 98
408. Explain the bug life cycle or the different states of a bug.
Ans. A bug goes through the following phases in software development-
 New – A bug or defect when detected is in a New state.
 Assigned – The newly detected bug when assigned to the corresponding developer is in
the Assigned state.
 Open – When the developer works on the bug, the bug lies in the Open state.
 Rejected/Not a bug – A bug lies in rejected state in case the developer feels the bug is not
genuine.
 Deferred – A deferred bug is one whose fix gets deferred for some time(for the next
releases) based on the urgency and criticality of the bug.
 Fixed – When a bug is resolved by the developer it is marked as fixed.
 Test – When fixed the bug is assigned to the tester and during this time the bug is marked
as in Test.
 Reopened – If the tester is not satisfied with the issue resolution the bug is moved to the
Reopened state.
 Verified – After the Test phase, if the tester feels the bug is resolved, it is marked as
verified.
 Closed – After the bug is verified, it is moved to Closed status.

409. What are the different test design techniques?


Ans. Test design techniques are different standards of test designing that allow systematic and
widely accepted test cases. The different test design techniques can be categorized as static test
design techniques and dynamic test design techniques.
1. Static Test Design Techniques – The test design techniques which involve testing without
executing the code. The various static test design techniques can be further divided into
two parts manual and using tools-

 Manual static design techniques


 Walkthrough
 Informal reviews
 Technical reviews
 Audit
 Inspection
 Management review
 Static design techniques using tools
 Static analysis of code – It includes analysis of the different paths and flows in the
application and different states of the test data.
 Compliance with coding standards – This evaluates the compliance of the code
with the different coding standards.
 Analysis of code metrics – The tool used for static analysis is required to evaluate
the different metrics like lines of code, complexity, code coverage, etc.
2. Dynamic Test Design Techniques – Dynamic test design techniques involve testing by
running the system under test.

Page | 99
 Specification-based – Specification-based test design techniques are also referred to
as black-box testing. These involve testing based on the specification of the system
under test without knowing its internal architecture.
 Structure-based – Structure-based test design techniques are also referred to as white
box testing. In these techniques, the knowledge of the code or internal architecture of
the system is required to carry out the testing.
 Experienced-based – The experienced-based techniques are completely based on the
experience or intuition of the tester. The two most common forms of experienced-
based testing are – Adhoc testing and exploratory testing.

410. What is Static Testing?


Ans. Static testing is a kind of testing for reviewing the work products or documentation that are
being created throughout the entire project. It allows for reviewing the specifications, business
requirements, documentation, processes, and functional requirements in the initial phase of
testing.
So that the testers involved in it can understand the requirements in more detail before starting
the testing lifecycle which intends to help in delivering a quality product.

411. What is Dynamic Testing?


Ans. The type of testing performed by executing or running the application under test either
manually or using automation is called dynamic testing.

Ques.37. Explain the different types of specification-based test design techniques.


Ans. Specification-based test design techniques are also referred to as black-box testing. It
involves testing based on the specification of the system under test without knowing its internal
architecture. The different types of specification-based test design or black box testing
techniques are-
 Equivalence partitioning – Grouping test data into logical groups or equivalence classes
with the assumption that all the data items lying in the classes will have the same effect
on the application.

 Boundary value analysis – Testing using the boundary values of the equivalence classes
taken as the test input.

 Decision tables – Testing using decision tables showing the application’s behavior based
on a different combination of input values.

 Cause-effect graph – Testing using a graphical representation of the result or outcome


and all the factors that affect the outcome.

 State transition testing – Testing based on the state machine model.

 Use case testing – Testing carried out using use cases.

412. Explain equivalence class partitioning.


Ans. Equivalence class partitioning is a specification-based black-box testing technique.

Page | 100
In equivalence class partitioning, a set of input data that defines different test conditions are
partitioned into logically similar groups such that using even a single test data from the group for
testing can be considered similar to using all the other data in that group.

For example, for testing a Square program (a program that prints the square of a number), the
equivalence classes can be-
Set of Negative numbers, whole numbers, decimal numbers, sets of large numbers, etc.

413. What is boundary value analysis?


Ans. Boundary value analysis is a software testing technique for designing test cases wherein the
boundary values of the classes of the equivalence class partitioning are taken as input to the test
cases e.g. if the test data lies in the range of 0-100, the boundary value analysis will include test
data – 0,1, 99, 100.

414. What is decision table testing?


Ans. Decision table testing is a type of specification-based test design technique or black-box
testing technique in which testing is carried out using decision tables showing the application’s
behavior based on different combinations of input values.

Decision tables are particularly helpful in designing test cases for complex business scenarios
involving the verification of applications with multiple combinations of input.

415. What is a cause-effect graph?


Ans. A cause-effect graph testing is a black-box test design technique in which a graphical
representation of input i.e. cause and output i.e. effect is used for test designing. This technique
uses different notations representing AND, OR, NOT, etc relations between the input conditions
leading to output.

416. What is state transition testing?


Ans. State transition testing is a black box test design technique based on a state machine model.
State transition testing is based on the concept that a system can be defined as a collection of
multiple states and the transition from one state to another happens because of some event.

417. What is use case testing?


Ans. Use case testing is a black-box testing approach in which testing is carried out using use
cases. A use-case scenario is seen as an interaction between the application and actors(users).
These use cases are used for depicting requirements and hence can also serve as a basis for
acceptance testing.

418. What is Test Coverage?


Ans. It is a metric that measures the amount of testing performed on software while executing
the test cases. Test coverage for any software can be calculated as the percentage of the number
of test areas or coverage items covered with respect to the total number of test areas.

The higher the test coverage, the more the part of the software gets covered by test cases and
hence, the more effective will be the testing.

Page | 101
419. What is structure-based testing?
Ans. Structure-based test design techniques are also referred to as white box testing. In these
techniques, the knowledge of the code or internal architecture of the system is required to carry
out the testing. The various kinds of testing structure-based or white testing techniques are-
 Statement testing – A white box testing technique in which the test scripts are designed
to execute the application’s code statements. Its coverage is measured as the line of code
or statements executed by test scripts.

 Decision testing/branch testing – A testing technique in the test scripts is designed to


execute the different decision branches (e.g. if-else conditions) in the application. Its
coverage is measured as the percentage of decision points out of the total decision points
in the application.

 Condition testing – Condition testing is a testing approach in which we test the


application with both True and False outcomes for each condition. Hence for n
conditions, we will have 2n test scripts.

 Multiple condition testing – In multiple condition testing, the different combinations of


condition outcomes are tested at least once. Hence for 100% coverage, we will have 2^n
test scripts. This is very exhaustive and very difficult to achieve 100% coverage.

 Condition determination testing – It is an optimized way of multiple condition testing


in which the combinations which don’t affect the outcomes are discarded.

 Path testing – Testing the independent paths in the system(paths are executable
statements from entry to exit points).

420. What is code coverage?


Ans. Code coverage is the measure of the amount of code covered by the test scripts. It gives the
idea of the part of the application covered by the test suite.

421. What are Statement testing and statement coverage in white box testing?
Ans. Statement testing is a white box testing approach in which test scripts are designed to
execute code statements.

Statement coverage is the measure of the percentage of statements of code executed by the test
scripts out of the total code statements in the application. The statement coverage is the least
preferred metric for checking test coverage.

422. What is decision testing or branch testing?


Ans. Decision testing or branch testing is a white box testing approach in which test coverage is
measured by the percentage of decision points(e.g. if-else conditions) executed out of the total
decision points in the application.

423. What are the different levels of testing?


Ans. Testing can be performed at different levels during the development process. Performing

Page | 102
testing activities at multiple levels helps in the early identification of bugs. The different levels of
testing are –
1. Unit Testing
2. Integration Testing
3. System Testing
4. Acceptance Testing

424. What is unit testing?


Ans. Unit testing is the first level of testing and it involves testing individual modules of the
software. It is usually performed by developers.

425. What is integration testing?


Ans. Integration testing is performed after unit testing. In integration testing, we test the group of
related modules. It aims at finding interfacing issues between the modules.

426. What are the different types of integration testing?


Ans. The different type of integration testing is-
1. Big bang Integration Testing – In big bang integration testing, testing starts only after all
the modules are integrated.

2. Top-down Integration Testing – In top-down integration, testing/integration starts from


top modules to lower-level modules.

3. Bottom-up Integration Testing – In bottom-up integration, testing starts from lower-level


modules to higher-level modules up in the hierarchy.

4. Hybrid Integration Testing – Hybrid integration testing is the combination of both Top-
down and bottom-up integration testing. In this approach, the integration starts from the
middle layer, and testing is carried out in both the direction

427. What is a stub?


Ans. In the case of top-down integration testing, many times lower-level modules are not
developed while beginning testing/integration with top-level modules. In those cases, Stubs or
dummy modules are used that simulate the working of modules by providing a hard-coded or
expected output based on the input values.

428. What is a driver?


Ans. In the case of bottom-up integration testing, drivers are used to simulating the working of
top-level modules in order to test the related modules lower in the hierarchy.

429.What is system testing?


Ans. System testing is the level of testing where the complete software is tested as a whole. The
conformance of the application with its business requirements is checked in system testing.

Page | 103
430. What is acceptance testing?
Ans. Acceptance testing is testing performed by the potential end-user or customers to check if
the software conforms to the business requirements and can be accepted for use.

431. What is UAT Testing?


Ans UAT testing is the last phase of the testing lifecycle. Its main focus is to validate that
software is working in accordance with business requirements. It also ensures that the application
is user-friendly and can handle complex scenarios at its best before releasing the product to real-
world users.

432. What is End-To-End Testing?


Ans. End-to-End testing is a type of testing where the entire application undergoes testing, to test
that each functionality of the software is working as expected and there is no loophole remaining
in it. It ensures that the application is user-friendly and meets the business requirements.

433. What is alpha testing?


Ans. Alpha testing is a type of acceptance testing that is performed by testers or the internal
employees of the organization at the developer site.

434. What is beta testing?


Ans. Beta testing is the testing done by end-users at the end user’s site. It allows users to provide
direct input about the software to the development company.

435. What is Adhoc Testing?


Ans. Adhoc testing is an unstructured way of testing that is performed without any formal
documentation or proper planning.

436. What is monkey testing?


Ans. Monkey testing is a type of testing that is performed randomly without any predefined test
cases or test inputs.

437. How is monkey testing different from Adhoc testing?


Ans. In the case of Adhoc testing although there are no predefined or documented test cases still
testers have an understanding of the application. While in the case of monkey testing testers
don’t have any understanding of the application.

438. What is exploratory testing?


Ans. Exploratory testing is a type of testing in which new test cases are added and updated while
exploring the system or executing test cases. Unlike scripted testing, test design and execution go
parallel in exploratory testing.

439. What is load testing?


Ans. Load testing is a type of performance testing which aims at finding an application’s
performance under the expected workload. During load testing, we evaluate the response time,
throughput, error rate, etc parameters of the application.

Page | 104
440. What is stress testing?
Ans. Stress testing is a type of performance testing in which an application’s behavior is
monitored under a higher workload than expected. Stress testing is done to find memory leaks
and the robustness of the application.

441. What is volume testing?


Ans. Volume testing is a type of performance testing in which the performance of the application
is evaluated with a large amount of data. It checks the scalability of the application and helps in
the identification of a bottleneck with a high volume of data.

442. What is endurance testing or Soak testing?


Ans. Endurance testing is a type of performance testing which aims at finding issues like
memory leaks when an application is subjected to load tests for a long period of time.

443. What is spike testing?


Ans. Spike testing is a type of performance testing in which the application’s performance is
measured while suddenly increasing the number of active users during the load test.

444. What is UI testing?


Ans. UI or user interface testing is a type of testing that aims at finding Graphical User Interface
defects in the application and checks that the GUI conforms to the specifications.

445. What is usability testing?


Ans. Usability testing is the type of testing that aims at determining the ease of using the
application. It aims at uncovering the usability defects in the application.

456. What is Accessibility testing?


Ans. Accessibility testing is the type of testing which aims at determining the ease of use or
operation of the application specifically for people with disabilities.

457. What is compatibility testing?


Ans. Compatibility testing is validating software to see how compatible the software is with a
particular environment – operating system, platform, or hardware.

458. What is configuration testing?


Ans. Configuration testing is the type of testing used to evaluate the configurational requirements
of the software along with the effect of changing the required configuration.

459. What is localization testing?


Ans. Localization testing is a type of testing in which we evaluate the application’s
customization(a localized version of the application) in a particular culture, locale or country.

460. What is globalization testing?


Ans. Globalization testing is a type of testing in which an application is evaluated for its
functioning across the world in different cultures, languages, locales, and countries.

Page | 105
461. What is negative testing?
Ans. Negative testing is a type of testing in which the application’s robustness(graceful exiting
or error reporting) is evaluated when provided with invalid input or test data.

462. What is security testing?


Ans. Security testing is a type of testing which aims at evaluating the integrity, authentication,
authorization, availability, confidentiality, and non-repudiation of the application under test.

463. What is penetration testing?


Ans. Penetration testing or pen testing is a type of security testing in which an application is
evaluated(safely exploited) for different kinds of vulnerabilities that any hacker could exploit.

464. What is robustness testing?


Ans. Robustness testing is a type of testing that is performed to find the robustness of the
application i.e. the ability of the system to behave gracefully in case of erroneous test steps and
test input.

465. What is concurrency testing?


Ans. Concurrency testing is multi-user testing in which an application is evaluated by analyzing
the application’s behavior with concurrent users accessing the same functionality.

466. What is backend testing?


Ans. Backend testing is a type of testing that involves testing the backend of the system which
comprises testing the databases and the APIs in the application.

467. What is A/B testing?


Ans. A/B testing is a type of testing in which the two variants of the software product are
exposed to the end-users and on analyzing the user behavior on each variant, the better variant is
chosen and used thereafter.

468. What is risk analysis?


Ans. Risk analysis is the analysis of the risk identified and assigning an appropriate risk level to
the defect based on its impact on the application.

469. What is the difference between regression and retesting?


Ans. Regression testing involves testing the application to verify that a new code change doesn’t
affect the other parts of the application. Whereas, in retesting, we verify if the fixed issue is
resolved or not.

470. What is the difference between black-box and white-box testing?


Ans. Black-box testing is a type of testing in which the internal architecture of the code is not
required for testing. It is usually applicable for system and acceptance testing.

Whereas white-box testing requires internal design and implementation knowledge of the
application being tested. It is usually applicable for Unit and Integration testing.

Page | 106
471. What is the difference between smoke and sanity testing?
Ans. The difference between smoke and sanity testing is-

 Smoke testing is a type of testing in which all major functionalities of the application are
tested before carrying out exhaustive testing. Whereas, sanity testing is a subset of
regression testing which is carried out when there is some minor fix in the application in
a new build.
 In smoke testing, shallow-wide testing is carried out while in Sanity, narrow-deep testing
(for a particular functionality) is done.
 The smoke tests are usually documented or automated. Whereas, the sanity tests are
generally not documented or unscripted.

472. What is the difference between Release and Build?


Ans. A build is an executable file provided by the developers to the testing team for testing the
application. It undergoes various iterations of fixing and testing until the application works as
expected. Once the application becomes stable and ready for the end-users, it’s released in the
market.

Whereas, a release is installable software provided to the end-users after it gets certified by the
testing team. During the release of any software to the client, release notes are attached to it that
includes a number of defects still open, covered user stories, change requirements, and version of
the release.

Manual Testing Interview Questions for Experienced


473. What is the difference between bug leakage and bug release?
Ans. Bug leakage is when the tested software is released into the market and the end-user finds
bugs in it. These include the bugs that got missed by the testing team during the testing phase.

Whereas, bug release is when a specific version of the software is released in the market with
some known bugs which are intended to get fixed in later versions. These types of issues are of
low priority and are mentioned in the release notes while sharing with the end-users.

474. What do you mean by Defect Triage?


Ans. Defect triage is a process in which the defects are prioritized based on different factors like
severity, risk, the time required to fix the bug, etc. The defect triage meeting includes the
different stakeholders – the development team, testing team, project manager, BAs, etc, which
decide the priority of fixing the defects.

475. What is a test harness? Why do we need a test harness?


Ans. A test harness is a collection of test scripts and test data usually associated with the unit and
integration testing. It involves stubs and drivers that are required for testing software modules
and integrated components.

476. What is all pair testing?


Ans. All pair testing is a type of testing in which the application is tested with all possible
combinations of the values of input parameters.

Page | 107
477. What is failover testing?
Ans. Failover testing is a type of testing that is used to verify the application’s ability to allocate
more resources(more servers) in case of failure and transfer the processing part to the backup
system.

478. What is fuzz testing?


Ans. Fuzz testing is a type of testing in which a large amount of random data is provided as input
to the application in order to find security loopholes and other issues in the application.

479. What is pilot testing?


Ans. Pilot testing is testing carried out as a trial by a limited number of users to evaluate the
system and provide their feedback before the complete deployment is carried out.

480. What is dev-box Testing?


Ans. In dev-box testing, a tester performs testing on the developer’s system to verify if the major
functionalities of the application are stable and ready for testing.

481. What is mutation testing?


Ans. Mutation testing is a type of white box testing in which the source code of the application is
mutated to cause some defects in its working. After that, the test scripts are executed to check for
their correctness by verifying the failures caused by the mutant code.

482. What is the requirement traceability matrix(RTM)?


Ans. In software testing, a requirement traceability matrix is a table that relates the high-level
requirements with detailed requirements, test plans, or test cases. RTM helps in ensuring 100%
test coverage.

483. What is cyclomatic complexity?


Ans. Cyclomatic complexity is the measure of the number of independent paths in an application
or program. This metric provides an indication of the amount of effort required to test complete
functionality. It can be defined by the expression –
L – N + 2P, where:
L is the number of edges in the graph
N is the number of nodes
P is the number of disconnected parts

484. What are the entry criteria in software testing?


Ans. A set of prerequisites that are required to kick off the testing activity includes a Test
environment, Test tool, Test Data, database connectivity, and many more.

485. What is the exit criteria in software testing?


Ans. An exit criteria is a formal set of conditions that specify the agreed-upon features or state of
the application in order to mark the completion of the process or product.

486. What is the difference between testing and debugging?


Ans. Testing is primarily performed by the testing team in order to find the defects in the system.

Page | 108
Whereas, debugging is an activity performed by the development team. In debugging the cause
of the defect is located and fixed. Thus removing the defect and preventing any future occurrence
of the defect as well.

Another difference between the two is – testing can be done without any internal knowledge of
software architecture. Whereas debugging requires knowledge of software architecture and
coding.

487. Explain TDD (Test Driven Development).


Ans. Test-Driven Development is a software development methodology in which the
development of the software is driven by test cases created for the functionality to be
implemented. In TDD, first, the test cases are created, and then the code to pass the tests is
written. Later the code is refactored as per the standards.

488. What is the difference between Latent and Masked Defects?


Ans. A latent defect is an unidentified defect present in the current release but is not visible
because the conditions in which the defect could be found have never been met. These types of
defects occur only when a particular event gets triggered which was concealing their presence.

Whereas a masked defect is an existing defect that has not yet caused any failure because another
error has masked it or prevented it from getting discovered.

489. What is the PDCA cycle in software testing?


Ans. PDCA cycle is a key for continuous process improvement in software development. It
includes the following 4 steps-
 Plan – Plan the objectives, goals, and initiatives which help to reach customer
satisfaction.

 Do – It implements the plan into action. To serve the customer with better quality and
satisfaction it is necessary to have a good plan to execute.

 Check – To check the progress of your plan which has been implemented. The result will
show how accurate the planning had been done.

 Act – Acting upon the results to do further improvement which helps in achieving the
planned goals.

490. What is Defect Cascading?


And. Defect cascading is the triggering of a defect by another defect. It happens when a defect is
not caught by the testing team and it gives rise to another defect.

491. What is a test metric?


Ans. Test Metric is a quantitative analysis that helps in monitoring the progress of a software
project. Every project has its own timeline so ensuring the delivery of the project on time
requires setting deliverables at different intervals and this aspect of measuring the progress is
provided by test metrics.

Page | 109
492. What is Context-driven testing?
Ans. Context-driven testing is the type of testing that involves adopting the test practices, and
methodologies and at times customizing them based on the context of the project.

In this type of testing, instead of following best practices, we follow what works best for the
project based on the skills, experience, and judgment of the testing team. For details check –
Context-driven methodology by James Bach.

493. How can you test an application without a requirement document?


Ans. An application can be tested without a formal requirement document by using the following
measures-
 By researching applications that are similar in nature.
 Testing based on ideal user experience. Even without having any requirements, a tester
can still test the application’s user-friendliness.
 Using exploratory testing. Since there is no documentation involved, so testers can use
exploratory testing and test the application on the fly with a more hands-on approach.

Agile Interview Questions


494. What is Agile methodology?
Ans. Agile methodology is used in software development. It focuses on incremental development
methods where the objective of the methodology is to quickly deliver the product.

495. How is agile methodology different from traditional methodologies?


Ans. The main difference between agile methodology and other traditional methodologies is that
agile methodology follows an incremental development model whereas traditional
methodologies follow a sequential model.

In agile methodology, the development phase and testing phase run simultaneously. In traditional
methodology, the testing phase starts once the development phase is over.

The agile methodology provides flexibility as introducing changes is easier. In traditional


methodology, incorporating changes is difficult as before the development work starts,
requirements are frozen.

The agile methodology needs less documentation. Due to quick delivery, developers make the
changes in the code based on the need. While in traditional methodology, the development
process starts only after the completed documented requirements are available with the team.

Customers are involved in every stage of the agile software life cycle, reviewing the product and
suggesting changes if required. In traditional methodology, customers are mainly involved in the
requirements gathering phase. They usually see the finished product during the last stages of the
development life cycle.

Page | 110
496. Can you name some agile frameworks?
Ans. The following are some agile frameworks:
 Scrum
 Crystal
 Dynamic Systems Development Method (DSDM)
 Feature Driven Development (FDD)
 Kanban
 Adaptive Software Development (ASD)
 Lean Software Development (LSD)

497. What is an agile manifesto?


Ans. The agile manifesto is a document for agile software development prepared by 17
likeminded software development practitioners, and it was published in February 2001. It is built
on 4 foundation values and 12 supporting principles.

498. What are the four values of an agile manifesto?


Ans. The following are the four foundation values of an agile manifesto-
 Individuals and interactions over processes and tools.
 Working Software over comprehensive documentation.
 Customer collaboration over contract negotiations.
 Responding to Change over following a plan.

499. What are the 12 principles of an agile manifesto?


Ans. The following are the 12 principles of an agile manifesto:
 Our highest priority is to satisfy the customer through early and continuous delivery of
valuable software.
 Welcome changing requirements, even late in development. Agile processes harness
change for the customer’s competitive advantage.
 Deliver working software frequently, from a couple of weeks to a couple of months, with
a preference to the shorter timescale.
 Business people and developers must work together daily throughout the project.
 Build projects around motivated individuals. Give them the environment and support they
need and trust them to get the job done.
 The most efficient and effective method of conveying information to and within a
development team is face-to-face conversation.
 Working software is the primary measure of progress.
 Agile processes promote sustainable development. The sponsors, developers, and users
should be able to maintain a constant pace indefinitely.
 Continuous attention to technical excellence and good design enhances agility.
 Simplicity–the art of maximizing the amount of work not done–is essential.
 The best architectures, requirements, and designs emerge from self-organizing teams.
 At regular intervals, the team reflects on how to become more effective, then tunes and
adjusts its behavior accordingly.

Page | 111
500. What is extreme programming?
Ans. Extreme programming or XP is one of the popular approaches to agile software
development. It uses an object-oriented approach and it follows the same practices included in
the agile manifesto.

Extreme programming is responsible for introducing concepts that are now widely used as
standard practices such as user stories, continuous integration and test-driven development. One
of the advantages of extreme programming is that it gives the flexibility of incorporating
changing requirements at any point in the development life cycle.

501. What are the five core principles of extreme programming?


Ans. The following are the five values or core principles of extreme programming:
 Communication – This principle focuses on timely and close communication between
relevant parties (mainly developers and stakeholders).
 Simplicity – The basic idea behind this principle is to work on the immediate features
first and keep it simple. The code should be such that it can easily be implemented and if
any changes are required, refactoring can be done.
 Feedback – There are three sources that are used to gather feedback. By conducting unit
testing, feedback of the system is captured. By conducting acceptance testing, feedback
of the customer is captured and by conducting the planning game, feedback of the other
software team members is collected.
 Courage – This principle focuses on the courage required to design for immediate
features, focusing only on the present. An agile team should also have the courage to
recognize the fact that the requirements may change in the future and they will have to be
incorporated in the code.
 Respect – This principle focuses on self-respect, respect gained from others and respect
given to other team members.

502. What are the four framework activities of extreme programming?


Ans. The following are the four framework activities of extreme programming:
 Planning
 Design
 Coding
 Testing

503. What is refactoring?


Ans. Refactoring is the process of changing the existing source code without changing its
functionality.

504. What is pair programming?


Ans. Pair programming is a technique used in agile software development where two developers
work as a team. One of the two developers writes code and is known as a driver, while the other
reviews the code and is known as an observer. When required they can switch their roles.

506. What are the benefits of pair programming?


Ans. The following are various advantages of pair programming:

Page | 112
 Pair programming results in improved code quality and fewer mistakes in the code as
the other developer keeps reviewing the code as it is written.
 Pair programming makes it easier to find solutions to any problem faced during the
coding as the other partner can help.
 It allows easy knowledge transfer as if one partner is more experienced, s/he can teach
the other developer.

507. What are the various estimation techniques in agile?


Ans. Agile estimation techniques are used to estimate work efforts. The following are some of
the agile estimation techniques:
 Planning Poker
 T-shirt sizes
 Affinity Estimation
 Sorting Method
 The Bucket System
 Three-Point Method
 Dot Vote

508. What is the planning poker technique?


Ans. Planning poker is an estimation technique that involves collaboration among team
members. It is conducted before an iteration starts with the help of developers.
 Each member is given a deck of planning poker cards. The values of the cards are similar
to Fibonacci numbers. These numbers represent story points or days.
 The product owner reads and explains the user story to the team. Developers can discuss
further if they have any questions.
 After the discussion, each member estimates the efforts in developing the story and
selects any card privately that represents the effort.
 All the cards are revealed simultaneously and if all are same then the story is estimated
based on the card value.
 If there are different card values, further discussion happens, and it goes on until all the
team members agree upon the same number.

509. What is a t-shirt sizing technique?


Ans. T-shirt sizing is an estimation technique used to measure the size of the user story and it is mainly
used when there are relatively large backlog items to be estimated. In t-shirt sizing, the sizes of the t-
shirts (XS, S, M, L, XL) are used to estimate the story. The decision about the size requires an open
discussion.

510. What is Lean Software Development (LSD)?


Ans. Lean software development is an iterative agile methodology that has borrowed principles
of the lean manufacturing process and implemented them in the software development process.
Some of the lean principles that have been adapted are fast delivery, elimination of waste,
optimization of development time and resources, building quality in the product, etc.

Page | 113
512. What is Kanban?
Ans. Like Scrum, Kanban is also one of the popular frameworks used in agile software
development. Kanban is a Japanese word for signboard. In this framework, work items or user
stories are displayed on the Kanban board, the team can see the status of each user story on the
board. Kanban allows the product to be developed in one large development cycle rather than
having iterations (like scrum). Kanban is incremental, not iterative.

513. What is Scrumban?


Ans. Scrumban is an agile development methodology that is a combination of scrum and
Kanban.
Scrumban is mainly used for maintenance projects where scrum processes are improved with the
help of Kanban principles. It helps the project team in optimizing the processes.
The scrum part of the scrumban is to decide the amount of work that can be done in a sprint and
prioritization of tasks.
The Kanban part of the scrumban is used to improve the processes and visualize the workflow.
Scrumban uses a pull system of the Kanban; in which the items are continuously pulled from the
backlog.

514. What is Test-Driven Development (TDD)?


Ans. Test-Driven Development (TDD) is a software development process where the test cases
are written first and then the coding is done. Test cases are written to validate what the code
should do.

The following are the basic rules of TDD development process:


 First, a unit test is written to describe a feature of the system
 The next step is to run the test. It will fail because the feature does not exist in the system
 Write the code to accommodate the feature in the system. Basic idea is to write a simple
test so that the test case will pass
 Refactor the code as required
 Repeat the above steps for other features of the system

515. What is DevOps?


Ans. DevOps is a set of ideas and practices that combine software development (Dev) and
information technology operations (Ops). DevOps brings together the development and
operations team in order to provide high-quality and reliable software and reduce development
time.

516. What are the difference and similarities between scrum and agile?
 Agile methodology is used in software development. It focuses on incremental
development methods where the objective of the methodology is to quickly deliver the
product. Whereas scrum is one of the frameworks of agile that falls under the agile
project management umbrella. It is also used for software development.
 Agile follows an incremental and iterative approach to complete the projects. Scrum is
also incremental and iterative in nature.

Page | 114
517. Can you explain agile testing in brief?
Ans. Agile testing is a software testing process that follows principles of agile software
development. The agile development process is an iterative process where requirements keep on
changing as per the customer needs. Agile testing is a continuous process that is done
simultaneously with the development process. Agile testing includes testing the system
continuously until the desired software quality is achieved.

518. What approach should you follow as an agile tester when requirements change
continuously?
 First, while creating test cases, an agile testing team should focus on writing generic test
cases that can be helpful in changing the test cases in the future.
 An agile tester should collaborate with the product owner and business analyst to
understand the changed requirement and risks associated with the change to modify the
test cases.
 The testing team should go with automation testing only after the requirements are
frozen.

519. What are some qualities of a good agile tester?


Ans. The following are some important qualities that a good agile tester should possess:
 An agile tester should have in-depth knowledge of the agile principles and concepts.
 An agile tester should be able to understand project requirements quickly and clearly.
 S/he should be a good communicator as an agile process encourages continuous
interaction with business analysts, developers, and other testers.
 An agile tester should be able to handle changing requirements. S/he should be able to
understand the risk arising due to the change and should be able to modify the test cases
based on the changing requirements.

520. What are some agile testing methods?


Ans. The following are some agile testing methods:
 Behaviour Driven Development (BDD)
 Acceptance Test-Driven Development (ATDD)
 Exploratory Testing
 Session-Based Testing

521. What are the stages of an agile testing life cycle?


Ans. Agile testing lifecycle is split into the following stages:
 Agile Test Planning – In this phase, test plan schedules and the deliverables to be tested
are created by the stakeholders.
 Daily Scrums – These meetings include discussion of the status of the testing activity
done on the previous day and setting testing goals for the day.
 Test Agility Review – These meetings are conducted weekly with the stakeholders to
review the progress.
 Release Readiness – In this phase, the review of features is conducted to check the
readiness of the features to go live on the production.
 Impact Analysis – In this phase, feedback from the stakeholders is collected and goals
for the next life cycle are prepared.

Page | 115
522. What is the difference between Incremental and iterative development?
Ans. In an iterative development method, the software is developed and delivered to the
customer. Once the feedback is received from the customer, it is accommodated in the software
and it is developed again in sprints and then delivered to the customer.

In an incremental development method, the software is developed in increments. Each increment


contains completed features of some sub functionality of the system.

523. What is a release candidate?


Ans. A release candidate is a build of the system that is functional and is released internally for
testing purposes. They are not used for production deployment. Testing is done on the build to
make sure no critical issues are present in the system.

The release candidate is a code /version /build released to make sure that during the last
development period, no critical problem is left behind. It is used for testing and is equivalent to
the final build.

524. What is a build breaker?


Ans. Build breaker is a situation in which a bug in the software stops compilation and causes
warnings or failures in the automated test environment. It happens when developers accidentally
commit bugs in the software.

525. How QA can add value to an agile team?


 Testers participate in risk analysis sessions to identify risks and steps to prevent them.
 Testers study the user stories, help in creating acceptance criteria.
 They perform exploratory testing of the newly developed features.
 They can provide continuous and quick feedback of the system to the developers as s/he
has tested the software.
 Testers participate in automation testing.
 Tester helps in finding out any defects that are found in the system.
 Testers can try to think differently on various scenarios to be tested in order to widen the
test coverage and find more defects in the system.

526. What are the advantages of an agile model?

 An agile model encourages quick and continuous delivery of the software.


 Being a flexible model, an agile model helps in accommodating any changes suggested
by the customers.
 An agile process involves high interaction between various team members that helps in
identifying any issues in the development process quickly.
 An agile model helps in increasing customer software as the delivery is quick and after
every increment, a working product is delivered to the customer.
 Customers can review the product in and after each increment that gives them an
assurance that the development process is going on the right track.

Page | 116
527. What are the disadvantages of an agile model?
 As the requirements change frequently, the developers may not be able to quantify the
full extent of the efforts required in the development process.
 An agile method puts less emphasis on the documentation that might create problems in
the future especially for new joiners in the project.
 Continuous involvement from the client team is expected that requires the client team to
be available for the meetings.
 If the client team is not able to clearly explain the final outcome of the system, the project
might get taken off track.
 An agile development process requires experienced developers who have the skills to
develop the system with the ability to make some quick and crucial decisions during the
process.
 Continuous interaction of each team member is expected that increases the time and
energy required from the team.

Scrum Master Interview Questions


528. Can you explain Scrum in a brief?
Ans. Scrum is one of the most widely used frameworks of agile methodology. Activities of
scrum framework are requirements, analysis, design, evolution and delivery.
In scrum, a list of requirements is added to a backlog called a product backlog. To achieve the
requirements, work units called sprints are created. Each sprint contains certain requirements
from the product backlog, and it can be of 2 to 4 weeks long.

529. Why the scrum framework is called a lightweight process framework?


Ans. The agile scrum framework is a lightweight process framework as it has a few rules and
practices. This framework is flexible and adaptable, and it can incorporate changes in
requirements easily. In the scrum framework, product development is divided into sprints that
are of small duration.

530. When do we use agile scrum methodology?


Ans. The following are some instances when the scrum framework should be considered for
software development:
 When requirements are not clear.
 When there are high chances of changes in requirements during the development.
 We can also use scrum when there is a demand for fast product delivery .
 When the development team is self-organizing and cross-functional.

531. What are the three pillars of scrum?


Ans. The following are the three pillars of scrum:
 Transparency – All the aspects of the product development process should be visible to
the relevant parties such as the development team, the client, scrum master, etc.
 Inspection – On a regular basis, the scrum participants should review the scrum artifacts
and see if there is anything that is blocking the progress.

Page | 117
 Adaptation – If any issues or problems are found during inspection, adjustment or
changes to the process should be made in order to remove the problems.

532. What is a sprint?


Ans. In scrum, a sprint is a short and time-boxed period where a certain amount of work is done
by the development team in order to produce a releasable product. It is a basic unit of
development in the scrum.

533. How long the scrum cycle lasts?


Ans. The scrum cycle or sprint depends on the team and project size. A sprint cannot exceed a
month i.e. 4 weeks. Normally, on average a sprint lasts for weeks.

534. What are the primary artifacts of the scrum process framework?
Ans. Scrum artifacts are responsible for providing key information to the development team and
the client. It helps in having the same understanding of the product development details.

There are mainly three artifacts:


 Product Backlog – Product backlog is a list of to-do items maintained by the product
owner. It consists of requirements, enhancements, features, etc.
 Sprint backlog – Sprint backlog is a list of to-do items, selected from the product
backlog, to be completed in a particular sprint.
 Increment – Increment consists of a list of all the product backlog items that were
completed during the sprints. It is one of the deliverables of the scrum.

535. Can you tell about the various events conducted in each scrum sprint?
Ans. Scrum consists of the following four events that are used for inspection and adaptation-
 Sprint Planning – In sprint planning, a detailed discussion of the project work to be done
in the sprint is done.
 Daily Scrum – Daily scrum is time-boxed to 15 minutes to discuss the development
team’s activities for the next 24 hours. It also includes discussions regarding the work
performed in the last 24 hours.
 Sprint Review – Sprint review is conducted at the end of the sprint. It is done to discuss
the increment.
 Sprint Retrospective – Sprint retrospective is conducted so that the development team
can inspect itself and they discuss the improvements or changes that can be done in the
next sprint for more efficiency.

536. What is sprint planning?


Ans. In sprint planning, the plan for the work that needs to be done in a particular sprint is
generated. For a month-long sprint, sprint planning is time-boxed to a maximum of 8 hours. The
scrum master is responsible for making sure that the participants understand its purpose.

The following are two questions that are answered in sprint planning:
 What can be delivered in the sprint? – The product owner discusses the goal of the sprint
and items from product backlog will be selected to be included in the sprint backlog.
 How will the work get done? – Based on the sprint backlog, the development team needs
to decide how it will work towards developing a usable increment.

Page | 118
537. What is a daily scrum?
Ans. The daily scrum is an event to discuss the development team’s activities for the next 24
hours. It is time-boxed to a maximum of 15 minutes. In this event, the following questions are
answered-
 What did I do yesterday?
 What will I do today?
 Do I see any impediment which prevents the team from meeting the sprint goal?
The goal of the daily scrum is to inspect the progress of the sprint backlog items.

538. What is a sprint review?


Ans. The sprint review is conducted at the end of the sprint to inspect the increment.
Stakeholders and development teams participate in sprint review. In this event, participants go
through what was done in the sprint, discuss any challenges faced by the development team,
provide feedback, etc. If needed, product backlog will be updated and inputs for next sprint
planning will be provided.

539. What is a sprint retrospective?


Ans. The sprint retrospective is conducted after the sprint review and before the sprint planning.
It involves inspection of the last sprint and adaption of changes for improvement in the
upcoming sprint.

Retrospective is time-boxed to a maximum of 3 hours for a month-long sprint. It is a scrum


master’s responsibility for conducting the event and motivating other team members to increase
the efficiency of the sprint.

540. What is a product backlog?


Ans. The product backlog is a list of to-do items. It consists of requirements, features,
enhancements, changes, etc. It is maintained by the product owner who is responsible for its
content.
The product backlog keeps evolving with product development progress and changed
requirements.

541. What is a sprint backlog?


Ans. Certain product backlog items are selected for a particular sprint and they are worked upon
by the development team. This list of items is called Sprint backlog. The sprint backlog is a
subset of the product backlog.

542. What is a zero sprint?


Ans. Before the first sprint starts, there are certain activities such as set up of development
environment, preparation of product backlog, other upcoming sprint related planning, need to be
done. This phase is called a zero sprint. It is also known as Inception Sprint, Initial Sprint or
Sprint Zero.

Page | 119
543. What is a story point?
Ans. A story point is a unit of measurement to estimate the total effort required to implement a
product backlog item or any other work. There are some factors that can be considered while
calculating the required effort: the amount of work to do, the complexity of the work and any
risk that may arise during the work.

544. What is a burn up chart?


Ans. Burn up chart is used in project management to keep track of the progress of the project
work.
Burn up chart depicts how much project work has been completed and it also shows the total
amount of work in a project.
The vertical axis in the burn-up chart represents the total work and the completed work. The unit
of this axis can be story points, workhours or workdays. The horizontal axis represents the time
that can be sprits i.e. iterations, days or weeks.
In the burn up chart, the scope change effect can be seen clearly as it shows the total amount of
work.

545. What is a burn down chart?


Ans. Burn down chart is used in project management to keep track of the progress of the project
work.
Burn down chart depicts the amount of pending project work.
The vertical axis in the burn down chart represents the remaining amount of work. The unit of
this axis can be story points, workhours or workdays. The horizontal axis represents the time that
will be measured in sprits i.e. iterations.
In the burn down chart, the scope change effect is shown as a negative progress by the
development team as it does not show the total amount of work.

546. What are the different types of burn down charts?


Ans. There are four types of burn down charts:
 Defect burn down chart
 Release burn down chart
 Product burn down chart
 Sprint burn down chart

547. What do you mean by a defect burn down chart?


Ans. The defect burn down chart is a visual representation of the remaining work of a defect
backlog.
The vertical axis in the defect burn down chart represents the remaining amount of work in a
defect backlog. The unit of this axis is defects in the defect backlog. The horizontal axis
represents the time that will be measured in sprints i.e. iterations.

548. What do you mean by a release burn down chart?


Ans. The release burndown chart is used to monitor release progress. It represents the remaining
work of the release.
The vertical axis in the release burn down chart represents the remaining amount of work in a
release. The unit of this axis can be hours, days or story points. The horizontal axis represents the
time that will be measured in sprints i.e. iterations.

Page | 120
549. What does a product burn down chart represent?
Ans. The product burn down chart is a visual representation of remaining work of a product
backlog.

The vertical axis in the product burn down chart represents the remaining amount of work in a
product backlog. The unit of this axis is story points. The horizontal axis represents the time that
will be measured in sprints i.e. iterations.

550. What does a sprint burn down chart represent?


Ans. The sprint burn down chart is a visual representation of remaining work of a specific sprint.

The vertical axis in the sprint burn down chart represents the remaining amount of work in a
sprint. The unit of this axis can be story points, workhours or workdays. The horizontal axis
represents the time that will be measured in days.

551. What is a spike?


Ans. ‘Spike’ term was originated with extreme programming. Sometimes it is possible that for a
certain user story, developers and other team members encounter a problem. They are unaware
of the solutions of the same. They might need to conduct research or an experiment to find the
solution. It is called a spike.

Spike is an experiment or an investment that helps the development team to estimate the story.
Spike is entered into a backlog by the product owner. Spikes have two types – Functional Spikes
and Technical Spikes.

For example, a user story contains requirements for integration with a 3 rd party software.
Developers have never worked with this software and they need some time to understand it. The
product owner can keep a day or two for this research and create a spike in the backlog.

552. What is a tracer bullet?


Ans. Sometimes it is possible that certain user stories are complex and hard to estimate, and they
contain a new architectural element that is unknown to the developers. In such cases, a tracer
bullet can be used with the help of a spike to examine the feasibility of the solution.

In the tracer bullet, one of the components of the user story will be built into an end-to-end
solution with minimal code and feedback will be gathered. Based on the implementation of one
component, other components of the story can be coded.

553. What is a velocity in scrum?


Ans. Velocity is a key metric in the scrum, and it is used to measure the amount of work the
development team can cover in a single sprint. Velocity can also be used to estimate delivery
time for further releases.

Page | 121
554. How to measure velocity in scrum?
Ans. There are two types of velocity i.e. actual velocity and expected velocity.
The actual velocity is calculated using the below formula-
Actual velocity = Total no. of story points completed / No. of sprints

The expected velocity is calculated using the below formula-


Expected Velocity = Total no. of estimated story points / No. of sprints

555. What is a user story?


Ans. User stories are simple descriptions used to represent business requirements from an end
user’s perspective. User stories are easier to understand compared to conventional requirements
or use cases.

556. What do you mean by acronym ‘INVEST’ in scrum?


Ans. INVEST depicts the quality criteria of a good story. It stands for-
I – Independent; User story should be such that it does not depend on another story
N – Negotiable; There should be a scope of negotiation in every story
V – Valuable; It should deliver value to the end user
E – Estimable; User story should be such that it can be estimated so that proper sprint planning
can be done
S – Small; It should be a small work that can be completed in 3-4 days
T – Testable; it should be testable i.e. it should include acceptance criteria

A good user story meets all these criteria and if it fails to do so, the team should consider a
rewrite.

557. What are the three components of a user story?


Ans. The following are the three components (3Cs) of a user story-
 Card – Card depicts the user story in its raw form. The user story is written n a physical
form on a card (post-it note). User story’s standard format is: As a [type of user], I want
[goal] so that [some reason].
 Conversation – The conversation happens between customers, product owners, testers,
etc to discuss details of the card.
 Confirmation – The confirmation means deriving acceptance criteria so that the team
can confirm that the story has been implemented successfully.

558. What is an epic?


Ans. An epic is a large user story that can be divided into multiple small user stories. Once epic
can be spread across multiple sprints.

559. What is a task in scrum?


Ans. A task is a technical work that the development team does in order to finish a product
backlog item in a prescribed time frame.

560. What are the major roles in Scrum?


Ans. The following are major roles in scrum:

Page | 122
 Product Owner – The product owner is responsible for representing requirements to the
team. S/he should have a clear vision of what the product should be, and this vision
should be communicated with the team effectively by the product owner.

The product owner is also responsible for managing a product backlog. S/he is
responsible for listing the product backlog items, ordering the items, ensuring
transparency of product backlog, ensuring product backlog items are understood by the
development team, and optimizing the work done by the development team.
 Development Team – Development team mainly consists of developers who perform the
development of the product by coding, testers who test the developed product, and
business analysts. The development team is responsible for delivering quality software in
the form of a usable increment at the end of the sprint. The development team should be
self-organizing and cross-functional. It is important to note that scrum recognizes no
titles for the development team other than the developer no matter what tasks are
performed by the person.
 Scrum Master – Scrum master is the leader of the development team. S/he is responsible
for making sure the development team is executing sprint tasks properly. The scrum
master is the one who is responsible for managing the sprint.

561. What is a sprint goal?


Ans. The sprint goal is an objective decided for a particular sprint. The sprint goal is created
during sprint planning before the sprint begins. In the sprint goal, a list of product backlog items
is selected to deliver reasonable functionality.

562. What is a task board in scrum?


Ans. Task board is a tool used to keep track of the progress of the current sprint. It is a visual
representation of sprint backlog where the team can see tasks that are done, that are in progress
and that are yet to be started.

563. What is an impediment in scrum?


Ans. An impediment is something that affects the productivity of the team and slows down the
progress.

564. Can you give some examples of impediment?


Ans. In scrum, impediments can be:
 Technical issues
 Organizational issues
 Unskilled team members
 Stakeholder issues
 Infrastructure issues
 Natural calamities

565. What is the scrum of scrums?


Ans. Scrum of scrums is an agile technique to scale up the daily stand-up meetings when large
teams are working on the same project. In this technique, the groups are divided into agile teams
of 5-10 people. Each sub-group or team designates an ‘Ambassador’ from their team. The
ambassador participates in a daily meetings with the other team’s ambassadors

Page | 123
566. What is bug leakage and bug release?

Bug Leakage: A bug which is actually missed by the testing team while testing and the build
was released to the Production. If now that bug (which was missed by the testing team) was
found by the end user or customer then we call it as Bug Leakage.

Bug release: Releasing the software to the Production with some known bugs then we call it as
Bug Release. These known bugs should be included in the release note. In other case, releasing
the software to the testing team with some known bugs whose severity and priority is low. These
bugs can be removed before releasing to production.

567. What is Bug triage?

Bug triage is a formal process to find which bugs are important by prioritizing them based on
their severity, frequency, risk and other important parameters. Testers assign priority (high,
medium, low) to each and every bug in a bug triage meeting and based on the priority those bugs
will be fixed in an order. By doing this we could save a lot of organization’s time.

568. What is MR and ER?

MR: MR stands for Modification Request. It is used to change the existing functionality in a
software, it is usually requested by clients.

ER: ER stands for Enhancement report. It is used to add a new feature in a software. It is usually
requested by clients.

Types of Web App Testing


Functionality Testing
569.What is Functional Testing ?
01. Testing the features and operational behavior of a product to ensure they correspond
to its specifications.
02. Testing that ignores the internal mechanism of a system or component and focuses
solely on the outputs generated in response to selected inputs and execution
conditions.
Goal of Functional Testing :
The goal of Functional Testing is to verify whether your product meets the intended
functional specifications mentioned in your development documentation.
Testing Activities Included :
Test all the links in your webpages are working correctly and make sure there are
no broken links.
Links to be checked will include -
01. Outgoing links
02. Internal links

Page | 124
03. Anchor Links
04. MailTo Links

Types of Web App Testing


Test Forms are working as expected. This will include-
01. Scripting checks on the form are working as expected. For example- if a user
does not fill a mandatory field in a form an error message is shown.
02. Check default values are being populated.
03. Once submitted, the data in the forms is submitted to a live database or is
linked to a working email address.
04. Forms are optimally formatted for better readability.

Test business workflow- This will include


01. Testing your end - to - end workflow/ business scenarios which takes the user
through a series of web pages to complete.
02. Test negative scenarios as well, such that when a user executes an unexpected
step, appropriate error message or help is shown in your web application.
Functional Test Scenarios :
01. Test all the mandatory fields should be validated.
02. Test the asterisk sign should display for all the mandatory fields.
03. Test the system should not display the error message for optional fields.
04. Test that leap years are validated correctly & do not cause errors/miscalcula-
Test HTML and CSS to ensure that search engines can crawl your site easily. This
will include
01. Checking for Syntax Errors
02. Readable Color Schemas
03. Standard Compliance. Ensure standards such W3C, OASIS, IETF, ISO, ECMA, or
WS-I are followed.
Test Cookies are working as expected. Cookies are small files used by websites to
primarily remember active user sessions so you do not need to log in every time
you visit a website. Cookie Testing will include
01. Testing cookies (sessions) are deleted either when cache is cleared or when they
reach their expiry.
02. Delete cookies (sessions) and test that login credentials are asked for when you
next visit the site.

Usability Testing
570.What is Usability Testing ?
01. Usability testing is nothing but the User-friendliness check.
02. In Usability testing, the application flow is tested so that a new user can understand

Page | 125
the application easily.
03. Basically, system navigation is checked in Usability testing.

Goal of Usability Testing :


A Usability test establishes the ease of use and effectiveness of a product using a
standard Usability test practices.
tions.
05. Test the numeric fields should not accept the alphabets and proper error
message should display.
06. Test for negative numbers if allowed for numeric fields.
07. Test division by zero should be handled properly for calculations.
08. Test the max length of every field to ensure the data is not truncated.
09. Test the pop up message (“This field is limited to 500 characters”) should display
if the data reaches the maximum size of the field.
10. Test that a confirmation message should display for update and delete operations.
11. Test the amount values should display in currency format.
12. Test all input fields for special characters.
13. Test the timeout functionality.
14. Test the Sorting functionality. Test the Sorting functionality.
15. Test the functionality of the buttons available.
16. Test the Privacy Policy & FAQ is clearly defined and should be available for
users.
17. Test if any functionality fails the user gets redirected to the custom error
page.

Testing Activities Included :


Test the site Navigation:
01. Menus, buttons or Links to different pages on your site should be easily visible
and consistent on all webpages.
02. Test the Content.
03. Content should be legible with no spelling or grammatical errors.
04. Images if present should contain an “alt” text.

Usability Test Scenarios :


01. Web page content should be correct without any spelling or grammatical errors.
02. All fonts should be same as per the requirements.
03. All the text should be properly aligned.
04. All the error messages should be correct without any spelling or grammatical
errors and the error message should match with the field label.
05. Tool tip text should be there for every field.

Page | 126
06. All the fields should be properly aligned.
07. Enough space should be provided between field labels, columns, rows, and error
messages.
08. All the buttons should be in a standard format and size.
09. Home link should be there on every single page.
10. Disabled fields should be grayed out.
11. Check for broken links and images.
12. Confirmation message should be displayed for any kind of update and delete operation.
13. Check the site on different resolutions (640 x 480, 600x800 etc.?)
14. Check the end user can run the system without frustration.
15. If there is an error message on submit, the information filled by the user should
be there.
16. Title should display on each web page
17. All fields (Textbox, dropdown, radio button etc) and buttons should be accessible
by keyboard shortcuts and the user should be able to perform all operations by
using keyboard.
18. Check if the dropdown data is not truncated due to the field size and also check
whether the data is hardcoded or managed via administrator.

571.Interface Testing
Three areas to be tested here are - Application, Web and Database Server
01. Application: Test requests are sent correctly to the Database and output at the
client side is displayed correctly. Errors if any must be caught by the application
and must be only shown to the administrator and not the end user.
02. Web Server: Test Web server is handling all application requests without any
service denial.
03. Database Server: Make sure queries sent to the database give expected results.
Test system response when connection between the three layers (Application,
Web and Database) cannot be established and appropriate message is shown to the
end user.

572.Database Testing
Database is one critical component of your web application and stress must be laid
to test it thoroughly. Testing activities will include-
01. Test if any errors are shown while executing queries.
02. Data Integrity is maintained while creating, updating or deleting data in database.
03. Check response time of queries and fine tune them if necessary.
04. Test data retrieved from your database is shown accurately in your web application.
To perform the Database testing, the tester should be aware of the below mentioned
points:

Page | 127
01. The tester should understand the functional requirements, business logic, application
flow and database design thoroughly.
02. The tester should figure out the tables, triggers, store procedures, views and
cursors used for the application.
03. The tester should understand the logic of the triggers, store procedures, views
and cursors created.
04. The tester should figure out the tables which get affected when insert update
and delete (DML) operations are performed through the web or desktop applications.
Test Scenarios for Database Testing
01. Verify the database name: The database name should match with the specifications.
02. Verify the Tables, columns, column types and defaults. All things should match
with the specifications.
03. Verify whether the column allows a null or not.
04. Verify the Primary and foreign key of each table.
05. Verify the Stored Procedure.
06. Test whether the Stored procedure is installed or not.
07. Verify the Stored procedure name
08. Verify the parameter names, types and number of parameters.
09. Test the parameters if they are required or not.
10. Test the stored procedure by deleting some parameters
11. Test when the output is zero, the zero records should be affected.
12. Test the stored procedure by writing simple SQL queries.
13. Test whether the stored procedure returns the values
14. Test the stored procedure with sample input data.
15. Verify the behavior of each flag in the table.
16. Verify the data gets properly saved into the database after the each page submision.
17. Verify the data if the DML (Update, delete and insert) operations are performed.
18. Check the length of every field. The field length in the back end and front end
must be same.
19. Verify the database names of QA, UAT and production. The names should
beunique.
20. Verify the encrypted data in the database.
21. Verify the database size. Also test the response time of each query executed.
22. Verify the data displayed on the front end and make sure it is same in the back
end.
23. Verify the data validity by inserting the invalid data in the database.
24. Verify the Triggers.

Page | 128
Compatibility Testing
573.What is Compatibility Testing?
Compatibility testing is used to determine if your software is compatible with other
elements of a system with which it should operate, e.g. Browsers, Operating Systems,
or hardware.

Goal of Compatibility Testing :


The purpose of Compatibility testing is to evaluate how well software performs in
a particular browser, Operating Systems, hardware or software. Compatibility tests
ensure that your web application displays correctly across different devices.

Testing Activities Included :


Browser Compatibility Test: Same website in different browsers will display differently.
You need to test if your web application is being displayed correctly across
browsers, JavaScript, AJAX and authentication is working fine. You may also check
for Mobile Browser Compatibility.
The rendering of web elements like buttons, text fields etc. changes with change
in Operating System. Make sure your website works fine for various combination
of Operating systems such as Windows, Linux, Mac and Browsers such as Firefox,
Internet Explorer, Safari etc.

Compatibility Test Scenarios :


01. Test the website in different browsers (IE, Firefox, Chrome, Safari and Opera)
and ensure the website is displaying properly.
02. Test the HTML version being used is compatible with appropriate browser
versions.
03. Test the images display correctly in different browsers.
04. Test the fonts are usable in different browsers.
05. Test the java script code is usable in different browsers.
06. Test the Animated GIF's across different browsers.

Performance Testing
574.What is Performance Testing ?
Performance Testing is conducted to evaluate the compliance of a system or
component with specified performance requirements.

Testing Activities Included :


01. Website application response times at different connection speeds.
02. Load test your web application to determine its behavior under normal and
peak loads.

Page | 129
03. Stress test your web site to determine its break point when pushed to beyond
normal loads at peak time.
04. Test if a crash occurs due to peak load, how does the site recover from such
an event.
05. Make sure optimization techniques like gzip compression, browser and
server side cache enabled to reduce load times.

General Test Scenarios :


01. To determine the performance, stability and scalability of an application
under different load conditions.
02. To determine if the current architecture can support the application at
peak user levels.
03. To determine which configuration sizing provides the best performance
level.
04. To identify application and infrastructure bottlenecks.
05. To determine if the new version of the software adversely had an impact
on response time.
06. To evaluate product and/or hardware to determine if it can handle projected
load volumes.

575.Security Testing
Security Testing involves the test to identify any flaws and gaps from a security
point of view.
Test Scenarios for Security Testing :
01. Verify the web page which contains important data like password, credit card
numbers, secret answers for security question etc should be submitted via
HTTPS (SSL).
02. Verify the important information like password, credit card numbers etc should
display in encrypted format.
03. Verify password rules are implemented on all authentication pages like Registration,
forgot password, change password.
04. Verify if the password is changed the user should not be able to login with the
old password.
05. Verify the error messages should not display any important information.
06. Verify if the user is logged out from the system or user session was expired, the
user should not be able to navigate the site.
07. Verify to access the secured and non secured web pages directly without login.
08. Verify the “View Source code” option is disabled and should not be visible to the
user.
09. Verify the user account gets locked out if the user is entering the wrong password

Page | 130
several times.
10. Verify the cookies should not store passwords.
11. Verify if, any functionality is not working, the system should not display any application,
server, or database information. Instead, it should display the custom
error page.
12. Verify the SQL injection attacks.
13. Verify the user roles and their rights. For Example The requestor should not be
able to access the admin page.
14. Verify the important operations are written in log files, and that information
should be traceable.
15. Verify the session values are in an encrypted format in the address bar.
16. Verify the cookie information is stored in encrypted format.
17. Verify the application for Brute Force Attacks.

576.How do you deal with deferred defect?


Ans:1.Check with business analyst if it is ok to defer this defect
2.If Business Analyst agrees then make the defect status as deferred
3.It is QA engineers responsibility to get this added to backlog list and get them fixed in next
release

577.How do you deal when requirement are not clear?


Ans:1.I will coordinate with BA as much as I Can
2.I will check with SME and business team to understand logics
3.I will document everything myself and get them reviewed by business
4.Along with these I will provide feedback to my manager and get these gaps filled for next
release.

578. In an application currently in production, one module of code is being modified. Is it


necessary to re-test the whole application or is it enough to just test the functionality
associated with that module?
Answer: Well, the answer is both. You need to test the functionality of that module as well as
the other modules. It also depends on the module that you are modifying.
All the modules should be tested because recent changes might affect the other modules as well.
You can, therefore, differentiate it by the stress given on the module which is to be tested.

The below scenario will explain the answer to this question in a better way.

If Module A is modified, Module B is depending on module A, and Module C is a general


module independent of module A.

Page | 131
Here, you will first test module A deeply. Your next stress will be on module B. But what about
module C? This module will be tested as well but with less stress, because module C does not
depend on module A for its functioning, rather it depends on module B.

If you are a white box tester, you must know which modules are to be tested and which ones can
be affected. But in case you are a black box tester, then you will be required to do Regression
Testing as well.

Regression tests should be carried out only on those modules associated with the modified
module.

579. Share the most challenging situation that you have ever faced during testing?
Answer: This is an excellent question indeed! A few years back, when I switched my job, I was
asked the same question by my interviewer. A perfect answer to this question usually depends on
the challenges experienced by an individual.
Software Testing has a lot of challenges both in the Manual and automation.

Discovering a bug that was difficult to be found out could be the answer to this question. It was
quite challenging for me. Fixing these unreproducible bugs can be difficult, but it is often
possible.

Always keep in mind that whenever you are answering such a question, you need to be realistic
and don’t stress yourself. Do not let anyone dull your sparkle. Just be yourself.

580. What are you going to do if there is no Functional Spec, or any documents related to
the system and the developer who wrote the code does not work in the company anymore,
but you have a system and need to test?
Answer: It is, unfortunately, one of the typical situations in Indian companies because of the
high attrition rate.
Here, you need to do Exploratory Testing of the product. It is about exploring, finding out about
the software, what it does, what it doesn’t, what works, and what doesn’t work.
In this testing, you will come to know about the system and its basic workflow. In Exploratory
Testing, you can also discover ‘blocker’ bugs that are harmful to your system and therefore
protect your system from being crashed.

If you are a white box tester, the next step is to look for different module codes. By this, you will
be able to analyze the test cases for different modules and their relations.

581. On which basis we give priority and severity for a bug and give one example for high
priority and low severity and high severity and low priority?
Always the priority is given by team leader or Business Analyst. Severity is given by the reporter
of bug. For example, High severity: hardware bugs application crash. Low severity: User
interface bugs. High priority: Error message is not coming on time, calculation bugs etc. Low
priority: Wrong alignment, etc

Page | 132
582. What do you mean by reproducing the bug? If the bug was not reproducible, what is
the next step?
If you find a defect, for example click the button and the corresponding action didn’t happen, it
is a bug. If the developer is unable to find this behaviour he will ask us to reproduce the bug. In
another scenario, if the client complaints a defect in the production we will have to reproduce it
in test environment.
If the bug was not reproducible by developer, then bug is assigned back to reporter or goto
meeting or informal meeting (like walkthrough) is arranged in order to reproduce the bug.
Sometimes the bugs are inconsistent, so that that case we can mark the bugs as inconsistent and
temporarily close the bug with status working fine now.

583. What is the responsibility of a tester when a bug which may arrive at the time of
testing. Explain?
First check the status of the bug, then check whether the bug is valid or not then forward the
same bug to the team leader and then after confirmation forward it to the concern developer.
If we cannot reproduce it, it is not reproducible in which case we will do further testing around it
and if we cannot see it we will close it, and just hope it would never come back ever again.

584. How can we design the test cases from requirements? Do the requirements, represent
exact functionality of AUT?
Ofcourse, requirements should represents exact functionality of AUT.
First of all you have to analyze the requirements very thoroughly in terms of functionality. Then
we have to think about suitable test case design technique [Black Box design techniques like
Specification based test cases, functional test cases, Equivalence Class Partitioning
(ECP), Boundary Valve Analysis (BVA), Error guessing and Cause Effect Graphing] for writing
the test cases.
By these concepts you should design a test case, which should have the capability of finding the
absence of defects.

585. How is traceability of bug follow?


The traceability of bug can be followed in so many ways.
1. Mapping the functional requirement scenarios(FS Doc) – test cases (ID) – Failed test
cases(Bugs)
2. Mapping between requirements(RS Doc) – Test case (ID) – Failed test cases.
3. mapping between test plan (TP Doc) – test case (ID) – failed test cases.
4. Mapping between business requirements (BR Doc) – test cases (ID) – Failed test cases.
5. Mapping between high level design(Design Doc) – test cases (ID) – Failed test cases.
Usually the traceability matrix is mapping between the requirements, client requirements,
function specification, test plan and test cases.

586. What is the difference between use case, test case, test plan?
Use Case: It is prepared by Business analyst in the Functional Requirement Specification(FRS),
which are nothing but a steps which are given by the customer.
Test cases: It is prepared by test engineer based on the use cases from FRS to check the
functionality of an application thoroughly

Page | 133
Test Plan: Team lead prepares test plan, in it he represents the scope of the test, what to test and
what not to test, scheduling, what to test using automation etc.

Behavioral QA questions

Behavioral questions are an opportunity to explore your professional background and describe how
you’ve handled workplace situations. You’ll use the STAR method (Situation, Tasks, Actions,
Results) to answer behavioral questions with detailed, compelling stories about your past
successes.

587. Tell me about a time you missed a bug.

Interviewers ask this question to learn more about how you recover from and resolve inadvertent
QA errors and the results of your efforts to resolve the situation.

How to answer:
 Use the STAR method to compose your answer. Describe the situation you were in when you
missed the bug, the tasks you were responsible for and the role you played, the actions you took to
resolve the missed bug, and the results of your actions.
 Take this opportunity to exhibit self-awareness around past work-related mistakes and confidence
in being able to handle them.

Other forms this question might take:


 “Tell me about a QA mistake you made and how you resolved it.”
 “What do you typically do when you miss a bug?”

588. When you’ve found a bug, how have you resolved it?

Interviewers ask this question to learn more about your experience with different QA processes
and methodologies, your past successes in resolving bugs, and how these successes might translate
to your performance in the open position.

How to answer:
 Use the STAR method to compose your answer. Describe the situation you were in when you
found the bug, the tasks you were responsible for and the role you played, the actions you took to
resolve the bug, and the results of your actions.
 Take this opportunity to describe your QA successes in concrete terms and your process, step by
step.

Other forms this question might take:


 “How do you typically go about resolving bugs?”
 “Tell me about a time you successfully resolved a bug.”

Page | 134
589. Tell me about your most difficult project.

Interviewers ask this question to get a feel for your work ethic. They want to know how you
approach QA challenges, such as tight deadlines or fixing bugs during the testing process, and the
actions you take to succeed.

How to answer:
 Use the STAR method to describe the situation of your most difficult project, the tasks you were
responsible for and your role, the actions you took to overcome the challenge, and the results of
your actions.
 Take this opportunity to showcase your commitment to working through challenges and emphasize
the impact of your efforts.

Other forms this question might take:


 “What has been your most challenging QA experience, and how did you overcome the challenge?”
 “How do you typically handle challenges that come up in QA? Describe an example.”

Situational QA questions

Situational questions are prompts for describing how you would react to hypothetical workplace
situations and give employers a sense of your job performance potential. Skillful answers can
demonstrate how you think on your feet and imagine different approaches to QA scenarios.

As with behavioral questions, which focus on the past, you can use the STAR method to walk
interviewers through your proposed strategies.

590. How would you ensure your team accounts for all details in the QA process?

Interviewers ask this question to gauge your level of attention to detail and understand how you
motivate and collaborate with others to optimize the QA process.

How to answer:
 Use the STAR method to describe a hypothetical situation involving a QA process,
the tasks you’d be responsible for to ensure detailed attention to the project, actions you would
take, and the results you would anticipate.
 Take the opportunity to describe your QA methods and approaches in detail and how you would
apply them to future projects.

Other forms this question might take:


 “How would you ensure the team avoids missing details during QA?”
 “How do you come up with QA processes that are thorough and detailed?”

Page | 135
591. If a client found an error in a status report, how would you resolve the issue?

Interviewers ask this question to find out how you handle interactions with clients or project
stakeholders, especially when you or your team is responsible for an error.

How to answer:
 Use the STAR method to describe a hypothetical situation in which a client notices a status report
error, the tasks you’d be responsible for in this scenario, the actions you would take to resolve the
error and communicate with the client, and the results you would anticipate.
 Take the opportunity to emphasize your communication and problem-solving skills, as well as
your resilience when facing challenges.

Other forms this question might take:


 “How would you communicate with a client if they found an error in your status report and resolve
the issue?”
 “How would you address an error in your status report when the client points out the error?”

592. How would you approach a project that you have doubts about?

Interviewers ask this question to learn how you evaluate projects, raise questions, conduct more
research into a project, and communicate your misgivings to coworkers or managers.

How to answer:
 Use the STAR method to describe a hypothetical situation in which you have doubts about a
project, the tasks you’d be responsible for, the actions you’d take to communicate your doubts or
find out more through research, and the results you would anticipate.
 Take the opportunity to emphasize your critical thinking and communication skills, as well as your
conscientious approach to understanding a project inside and out.

Other forms this question might take:


 “What would you do if you had doubts about a project?”
 “If you were not to feel confident about a project or notice something amiss, how would you
handle this situation?”

Testing-related QA questions

These questions are your opportunity to showcase your QA knowledge and skills. To prepare,
review your training and experience, and refresh your memory of common concepts, terms, and
methods.

593. What does a test plan include?

Interviewers ask this question to gauge your familiarity and experience with this aspect of
quality assurance.

Page | 136
How to answer:
 Review your notes, documentation, or training materials on test planning and any experience
you’ve had with it.
 Be prepared to describe the components of a test plan, different kinds of test plans, how to create
one, and different use cases.

Other forms this question might take:


 “What are the components of a test plan?”
 “What goes into test planning?”

594. What is the QA testing life cycle?

Interviewers ask this question to discover your familiarity with this concept and experience with
the process.

How to answer:
 Review everything you’ve learned about testing and reflect on your experiences.
 Be prepared to discuss the testing life cycle and why each phase is important.

Other forms this question might take:


 “Can you walk me through the QA testing life cycle?”
 “What is your experience with the QA testing life cycle?”

595. Can you define stress testing, load testing, and volume testing?

Interviewers ask this question to gauge your understanding of these terms and any experience
you have with these types of testing.

How to answer:
 Refer to several authoritative QA sources to confirm that you have up-to-date definitions of these
terms.
 Prepare to define these terms clearly, discuss the scenarios necessitating each one, and describe
your experience with them.

Other forms this question might take:


 “What’s your understanding of different types of testing, such as stress testing, load testing, and
volume testing?”
 “Tell me the differences between stress testing, load testing, and volume testing.”

Questions to ask in a QA interview

Most interviewers will invite you to ask questions throughout the interview and at the end. This is
your opportunity to get the most out of your interview experience. Prepare questions in advance to:

Page | 137
 Signal your interest in a position.
 Demonstrate your conscientious approach to job-seeking (and, by extension, job performance).
 Get the exact information you need about the company and the position to make a career decision.

Draw from the example questions below to prepare your questions.

596. What are the characteristics of your top QA professionals?

Asking this question can give you insights into the skills and traits that lead to success in the QA
role you’re applying for. With these insights, you can refine your QA characteristics and cultivate
new ones to match the company's expectations.

597. What technologies do you use?

Asking this question shows that you are mindful of what individual companies are doing with
specific apps and tools. Depending on the interviewer’s answer, asking this question also presents
an opportunity to share your experience with technologies the company uses or commit to
becoming familiar with them.

598. What is your QA process?

Asking this question shows that you are mindful of different QA methods and practices from one
company to the next and are keen on aligning your QA experience and training with the
prospective employer’s QA process.

599. What does your development team need from a new QA hire?

Asking this question demonstrates that you are interested in learning more about what the
employer is looking for and how you can develop the workplace and technical skills to become an
attractive candidate for the development team.

600.How do you deal with non reproducible defects?

Ans:I will open a defect and get it closed by devloper as non reproducible

Always make sure you report every unusal behavior

Page | 138
601.How do you coordinate QA Testing progress with broader team?

Ans:I schedule QA Triage weekly status call with all QA team,developers,BA Product,business
teams.I will open all my open question and get clarification from product team and get them
documented.

602. Do You think testing team should be involved in initial stage?

Ans:1.QA Team should be involved as early as possible

2.This will make us understand the application

3.Also helps to suggest the potential that arise with the design plan this saves lot of time

4.Is QA Engineer as occupied with multiple project then he can be involved after development
phase

603. How do you deal when developer is not accepting your defect?

Ans:1.It must be because you/him have misunderstanding in this case you can send email to
product team with the actual behaviour and asking them if it is correct

2.You can bring this up in QA triage or standup meeting and if required share your screen and

Ask business analyst where it is right.

604.Do You think test case reviews are important?

Ans:Yes it is always good to go over your test case with broader team ,In case you miss any
scenario then review comment will save you.

605.How Often do you interact with BA?

Ans:1.Interact with him when I have any question on requirement

2.If I want requirement corrected

3.If I want him to add any defect to backlog list

4.If something is too difficult to deliver within the timeline

606.What is Code freeze?

Ans:Code Freeze is asking development team to maintain stable environment when code is
freezed nothing should be deployed to test environment

Page | 139
607.Do You ask for Code Freeze Date?

Ans:Yes I always ask for a code freeze date this date should be such that at that point all

Defects should be closed.Thats When I ask for code freeze so that I can perform my regression
testing.

608.Do You Prepare Requirement Tracebilty Matrix(RTM).

Ans:Yes I Prepare RTM,this helps me to determine my test coverage.

609.What do you mean by production stability?

Ans:1.Production Stability is to make sure we don’t have any issues to the code that we signed
off
2.My goal is always maintain 100% production stability.
3.I Prioritize my QA tasks in such a way that my primary focus is to maintain production
stability and it is never effected.

Types of Software Testing

610. Unit Testing?


Unit testing is a method of testing individual units or components of a software application. It
is typically done by developers and is used to ensure that the individual units of the software
are working as intended. Unit tests are usually automated and are designed to test specific parts
of the code, such as a particular function or method. Unit testing is done at the lowest level of
the software development process, where individual units of code are tested in isolation.
The main advantages of unit testing include:
1. It helps to identify bugs early in the development process, before they become more
difficult and expensive to fix.
2. It helps to ensure that changes to the code do not introduce new bugs.
3. It makes the code more modular and easier to understand and maintain.
4. It helps to improve the overall quality and reliability of the software.

Some popular frameworks and tools that are used for unit testing include JUnit, NUnit,
and xUnit.

It’s important to keep in mind that unit testing is only one aspect of software testing and it
should be used in combination with other types of testing such as integration testing, functional
testing, and acceptance testing to ensure that the software meets the needs of its users.
It focuses on the smallest unit of software design. In this, we test an individual unit or group of
interrelated units. It is often done by the programmer by using sample input and observing its
corresponding outputs.

Page | 140
Example:
a) In a program we are checking if the loop, method, or
function is working fine
b) Misunderstood or incorrect, arithmetic precedence.
c) Incorrect initialization
611. Integration Testing?
Integration testing is a method of testing how different units or components of a software
application interact with each other. It is used to identify and resolve any issues that may arise
when different units of the software are combined. Integration testing is typically done after
unit testing and before functional testing, and is used to verify that the different units of the
software work together as intended.

Integration testing can be performed in different ways, such as:

1. Top-down integration testing: It starts with the highest level modules and integrates them
with lower-level modules.
2. Bottom-up integration testing: It starts with the lowest-level modules and integrates them
with higher-level modules.
3. Big-Bang integration testing: It combines all the modules and integrates them all at once.
4. Incremental integration testing: It integrates the modules in small groups, testing each
group as it is added.

The main advantages of integration testing include:

1. It helps to identify and resolve issues that may arise when different units of the software
are combined.
2. It helps to ensure that the different units of the software work together as intended.
3. It helps to improve the overall reliability and stability of the software.
4. It’s important to keep in mind that Integration testing is essential for complex systems
where different components are integrated together.
5. As with unit testing, integration testing is only one aspect of software testing and it should
be used in combination with other types of testing such as unit testing, functional testing,
and acceptance testing to ensure that the software meets the needs of its users.
The objective is to take unit-tested components and build a program structure that has been
dictated by design. Integration testing is testing in which a group of components is combined
to produce output.
Integration testing is of four types: (i) Top-down (ii) Bottom-up (iii) Sandwich (iv) Big-Bang
Example:
(a) Black Box testing:- It is used for validation.
In this, we ignore internal working mechanisms and

Page | 141
focus on what is the output?.

(b) White box testing:- It is used for verification.


In this, we focus on internal mechanisms i.e.
how the output is achieved?

612. Regression Testing?


Regression testing is a method of testing that is used to ensure that changes made to the
software do not introduce new bugs or cause existing functionality to break. It is typically done
after changes have been made to the code, such as bug fixes or new features, and is used to
verify that the software still works as intended.
Regression testing can be performed in different ways, such as:
1. Retesting: This involves testing the entire application or specific functionality that was
affected by the changes.
2. Re–execution: This involves running a previously executed test suite to ensure that the
changes did not break any existing functionality.
3. Comparison: This involves comparing the current version of the software with a previous
version to ensure that the changes did not break any existing functionality.

The main advantages of regression testing include:

1. It helps to ensure that changes made to the software do not introduce new bugs or cause
existing functionality to break.
2. It helps to ensure that the software continues to work as intended after changes have been
made.
3. It helps to improve the overall reliability and stability of the software.
4. It’s important to keep in mind that regression testing is an ongoing process that should be
done throughout the software development
5. lifecycle to ensure that the software continues to work as intended. It should be automated
as much as possible to save time and resources. Additionally, it’s important to have a well-
defined regression test suite that covers
Every time a new module is added leads to changes in the program. This type of testing makes
sure that the whole component works properly even after adding components to the complete
program.
Example
In school, record suppose we have module staff, students
and finance combining these modules and checking if on
integration of these modules works fine in regression testing

Page | 142
613. Smoke Testing?
This test is done to make sure that the software under testing is ready or stable for further
testing
It is called a smoke test as the testing of an initial pass is done to check if it did not catch the
fire or smoke in the initial switch on.
Example:
If the project has 2 modules so before going to the module
make sure that module 1 works properly

614. Alpha Testing?


This is a type of validation testing. It is a type of acceptance testing which is done before the
product is released to customers. It is typically done by QA people.
Example:
When software testing is performed internally within
the organization
615. Beta Testing?
The beta test is conducted at one or more customer sites by the end-user of the software. This
version is released for a limited number of users for testing in a real-time environment
Example:
When software testing is performed for the limited
number of people

616. System Testing?


This software is tested such that it works fine for the different operating systems. It is covered
under the black box testing technique. In this, we just focus on the required input and output
without focusing on internal working.
In this, we have security testing, recovery testing, stress testing, and performance testing
Example:
This includes functional as well as nonfunctional
testing
617. Stress Testing?
In this, we give unfavorable conditions to the system and check how they perform in those
conditions.
Example:
(a) Test cases that require maximum memory or other
resources are executed
(b) Test cases that may cause thrashing in a virtual

Page | 143
operating system
(c) Test cases that may cause excessive disk requirement

618. Performance Testing?


It is designed to test the run-time performance of software within the context of an integrated
system. It is used to test the speed and effectiveness of the program. It is also called load
testing. In it we check, what is the performance of the system in the given load.
Example:
Checking several processor cycles.

619. Object-Oriented Testing?


This testing is a combination of various testing techniques that help to verify and validate
object-oriented software. This testing is done in the following manner:
 Testing of Requirements,
 Design and Analysis of Testing,
 Testing of Code,
 Integration testing,
 System testing,
 User Testing.

620. Acceptance Testing?


Acceptance testing is done by the customers to check whether the delivered products perform
the desired tasks or not, as stated in requirements.
We use this OOT, for discussing test plans and for executing the projects.
This article is contributed by Kritka. If you like GeeksforGeeks and would like to contribute,
you can also write an article using write.geeksforgeeks.org or mail your article to review-
[email protected]. See your article appearing on the GeeksforGeeks main page and
help other Geeks.
Please write comments if you find anything incorrect, or if you want to share more information
about the topic discussed above.

621.Advantages of software testing?

1. Improved software quality and reliability


2. Early identification and fixing of defects
3. Improved customer satisfaction
4. Increased stakeholder confidence
5. Reduced maintenance cost

Page | 144
622.Difference Between Quality Assurance and Quality Control?

Quality Assurance(QA) Quality Control(QC)


1.QA is the set of activities using 1.QC is the set of activities using which
Which we analyze the process used in we analyze the quality of the product
Software Development Build.

2.It is the Static Process of analyzing 2.It Involves dynamic testing of a Software
Product by running it.
the documents and not the actual end
Product.

3.Verification Comes Under QA 3.Validation Comes under QC

4.It is Preventive measure as the 4.It is Corrective measure as it tests


Weakness in the process to build the built product to find defects.
Software to prevent defects.

5.It Involves Activies like document 5.It Involves activities like functional
Review ,test case ,review,test case ,review testing,Automation testing.
Walkthrough,inspection.

6.Carrying Out QA activities is the 6.Carrying Out QC Activities is the


Responsibility of whole team involved responsibility of testing team involved
In SDLC. In QC.

623.Difference Between Static testing and Dynamic Testing ?

Static Testing Dynamic Testing

1.Testing was done without executing 1.Testing is done by executing the product
The program.

2.This testing does the verification 2.This Testing does the Validation Process
Process.

3.Static Testing is about prevention of 3.Dynamic testing is about finding and fixing
Defects. Defects.

4.Static Testing gives an assessment 4.Dynamic Testing gives bugs in the software

Page | 145
Of code and documentation System

5.Static Testing involves a checklist 5.Dynamic Testing involve test cases for
And process. Execution.

6.Static Testing covers the structural 6.Dynamic Testing technique are


And statement coverage testing. Boundary value analysis.

7.Cost of Finding Defects and Fixing is less 7.Cost of Finding and Fixing Defect High.

8.Return on investment will be high for this 8.Return on investment will be high for
Process. This Process.

9.Requires lots of meetings. 9.Comparatively require less meetings

624.Difference Between Smoke Testing and Sanity Testing?

Smoke Testing Sanity Testing


1.To check stability of Application. 1.To check rationality of Application.

2.Performed by both developer and 2.Performed by Tester Only.


Tester.

3.Subset of Acceptance Testing. 3.Subset of Regression Testing.

4.To Check critical functionality 4.To Check Minor changes functionality.


Of Application.

5.It Checks Whole system. 5.It Checks for Perticular component

6.Smoke Testing is scripted. 6.Sanity Testing is non scripted.

625.Difference Between Regression testing and Retesting?


Regression Testing ReTesting
1.The Purpose of Regression testing is 1.Retesting is done on basis of defect fixes.
That new code changes should not have any side
Effect to existing functionality.

2.Defect Verification is not the part of 2.Defect Verification is part of Retesting.


Regression Testing.

3.Regression testing is known as 3.Retesting is known as planned testing.


Generic testing.

Page | 146
4.You Can Automate Regression 4.You Can not automate Retesting.
Testing.

5.Regression testing is done for passed 5.Retesting is done for failed test cases.
Test cases.

6.Regression testing checks for 6.Retesting makes sure that the original
Unexpected side effects. Fault has been correct.

7.Test cases for regression testing 7.Test cases for Retesting is obtained
Can be obtained from the from failed test cases.
Functional specification.

626.Difference Between Test Case and Test Scenario?


Test Case Test Scenario
1.Test case contains clearly defined test steps 1.A test scenario contains a high level
For testing a feature of an application. Documentation describing an end to end.

2.Test Cases focus on How to Test. 2.Test Scenario focus on what to test.

3.Test Case are clearly defined steps. 3.Test Scenario are generally one liner.

4.Test Cases can be derived from test 4.Test Scenarios are derived from use case
Scenarios.

5.Test Cases are efficient in exhaustive 5.Test Scenarios are beneficial in quick
Testing of an application. Testing end to end functions.

6.More resources are required for 6.Relatively less time and resources are
Documentation and execution of required for creating and testing using
Test cases. Test scenarios.

627.Difference Between White Box Testing and Black Box Testing?

White Box Testing Black Box Testing


1.Knowledge of Application code 1.Knowledge of the internal functioning of
And architecture is required. The application is not required.

2.It is generally performed by 2.It is generally performed by independent


Developers or QA with sound QA team.
Knowledge of programming

3.It is applicable for lower levels 3.It is Applicable for higher level of testing
Of testing Unit Testing+Integration System Testing +Application Testing.

Page | 147
4.Statement Coverge,Branch Coverage 4.Equivalance Partitiioning is black box testing
And path coverage. Technique.

5.Exhaustive and Time 5.It is less Exhaustive and time consuming.


Consuming method .

6.The main objective of white 6.The Main Objective of testing is to check the
Box testing is done to check Functionality.
The quality of code.

628.Difference between SDLC and STLC?

SDLC STLC
1.The Main Objective is to completed 1.The Only Objective of STLC Phase is testing.
Successful development of software
Including testing and other phases.

2.In Requirement gathering phase 2.In Requirement gathering QA team analyze


BA gathers the requirement and create requirement document like functional and non
Development plan. Functional document and create system test plan

3.In SDLC the development team 3.In STLC the test analysis creates the integration
Create the high and flow level test plan.
Design plan.

4.The Real Code is developed 4.The Testing team prepare test environment and
And actual work takes place execute them.
As per design.

5.SDLC Phase also includes post 5.Testers,execute Regression suits usually


Deployment support and updates. Automation scripts to check maintainance code
Deployed.

629.Difference between Verification and Validation?

Verification Validation
1.Verification and ensure that product is 1.Validation ensures that product actually meets
Built according to the requirement and client need.
Design.

2.Verification is process oriented 2.Validation is Product Oriented Approch.


Approch.

Page | 148
3.It Involves static testing. 3.In Involves Dynamic Testing.

4.Verification uses methods like 4.It uses method like black box testing
Reviews,walkthrough,inspections. White Box testing .

5.It find bugs early in the development 5.It find the bugs that the verification process
Cycle. Can not catch.

630.Difference between Waterfall and Agile?

Waterfall Agile
1.The Waterfall methodology is 1.Agile Methodology is incremental and iterative.
Sequential and linear.

2.Requirement have to be frozen at 2.Requirement are expected change at any point.


The beginning of SDLC.

3.The Working model of software 3.The Working model is delivered during the
Is delivered at the later phase of initial phase and successive iteration of the
SDLC. Model is delivered to the client for feedback.

4.It is difficult to scale up 4.Scaling up project is easy.


Projects.

5.Testing is performed once 5.Continuous Testing is performed during each


The software is build. Cycle.

631.Difference Between Functional Testing and Non Functional Testing?

Functional Testing Non Functional Testing

1.It is performed before non 1.It is Performed after functional testing.


Functional testing.

2.It is Based on Customer requirement 2.It Foucses on Customer Expectation.

3.It is easy to define functional requirement 3.It is difficult to define the requirements
For non functional testing

4.Helps to validate the behavior of the 4.Helps to validate the performance of


Application. Application.

Page | 149
5.Carred out to validate software 5.It is done to validate the performance
Actions. Of Software.

6.Functional Testing is easy to execute 6.Its very hard to perform non functional
By manual testing. Testing.

7.It Describe what the product does . 7.It Describe how the Product Work.

632.Difference Between DDL and DML?


DDL
DML
1.DDL Statement used to create database schema 1.DML Statement is used to insert
Constraint ,users table. ,update,delete the records.

2.DDL has no further classification. 2.DML is further classified in to


Procedural and Non Procedural
DML.

3.Command are CREATE,DROP,RENAME 3.Commans are INSERT,UPDATE


ALTER. DELETE.

4.DDL Statement affect the whole table. 4.DML Statement affect one or more row.

Page | 150
RDBMS Interview Questions
Let’s start with the basic RDBMS interview questions first and then we will move to more
complex database interview questions. Since these questions focus on the database fundamentals
which are common to all the databases, so the questions hold good for the different databases –
SQL server, Oracle, MySQL, etc.

633. What is a database?


Ans. A database is a structured collection of data for faster and better access, storage, and
manipulation of data.
A database can also be defined as a collection of tables, schema, views, and other database
objects.

634. What is database testing?


Ans. Database testing involves checking the integrity of actual data in the front end with the data
present in the database. It involves validating the data, checking that there are no orphan records
(record with a foreign key to a parent record that has been deleted), no junk records are present,
updating records in the database, and verify the value in the front end.

635. What is RDBMS?


Ans. An RDBMS or Relational Database Management System is a type of DBMS having
relationships between the tables using indexes and different constraints like primary key, foreign
key, etc. The use of indexes and constraints helps in faster retrieval and better management of
data within the databases.

636. What is the difference between DBMS and RDBMS?


Ans. The primary difference between DBMS and RDBMS is, in RDBMS we have relations
between the tables of the database.
Whereas in DBMS there is no relation between the tables (data may even be stored in files).

RDBMS has primary keys and data is stored in tables. DBMS has no concept of primary keys
with data stored in navigational or hierarchical form.

RDBMS defines integrity constraints in order to follow ACID properties. While DBMS doesn’t
follow ACID properties.

637. What is a table?


Ans. A table is a database object that is used for storing related records in the form of rows and
columns.

638. What is a field in a table?


Ans. A field is an entity used for storing a particular type of data within a table like numbers,
characters, dates, etc.

Page | 151
639. What is a tuple, record, or row in a table?
Ans. A tuple is a single record or single row in a table. For example, in the case of a student
table, the data corresponding to a student will be called a tuple or record of that student.

640. What is SQL?


Ans. SQL stands for Structured Query Language, It is a language used for creating, storing,
fetching, and updating data and database objects in RDBMS.

641. What are the different types of SQL commands?


Ans. SQL commands are the set of commands used to communicate and manage the data present
in the database. The different type of SQL commands are-
1. DDL – Data Definition Language
2. DML – Data Manipulation Language
3. DCL – Data Control Language
4. TCL – Transactional Control Language

642. Explain DDL commands. What are the different DDL commands in SQL?
Ans. DDL refers to Data Definition Language. The DDL commands are used to define or alter
the structure of the database. The different DDL commands are-
 CREATE – Used to create a table in the DB
 DROP – Drops the table from the DB
 ALTER – Alters the structure of the DB
 TRUNCATE – Deletes all the records from the DB but not its database structure
 RENAME – Renames a DB object

643. Explain DML commands. What are the different DML commands in SQL?
Ans. DML refers to Data Manipulation Language. These commands are used for managing data
present in the database. Some of the DML commands are – select, insert, update, delete, etc.

644. Explain DCL commands. What are the different DCL commands in SQL?
Ans. DCL refers to Data Control Language. These commands are used to create roles, grant
permission, and control access to the database objects. The three DCL commands are-
 GRANT – Grants permission to a database user.
 REVOKE – Removes access privileges from a user-provided with the GRANT
command.
 Deny – Explicitly prevents a user from receiving particular permission(e.g. preventing a
particular user belonging to a group to receive the access controls.

645. Explain TCL commands. What are the different TCL commands in SQL?
Ans. TCL refers to Transaction Control Language. These commands are used to manage the
changes made by DML statements. These are used to process a group of SQL statements
comprising a logical unit. The three TCL commands are-
 COMMIT – Commit write the changes to the database
 SAVEPOINT – Savepoints are the breakpoints, these divide the transaction into smaller
logical units which could be further roll-backed.
 ROLLBACK – Rollbacks are used to restore the database since the last commit.

Page | 152
646. What are SQL constraints?
Ans. SQL constraints are the set of rules that impose some restrictions while inserting, deleting,
or updating the data in the databases. In SQL, we have both column level as well as table level
constraints which are applied at columns and tables respectively. Some of the constraints in SQL
are – Primary Key, Foreign Key, Unique Key, Not NULL, DEFAULT, CHECK, and Index
constraint.

647. What is a Unique constraint?


Ans. A unique constraint is used to ensure that a field or column will have only a unique value
(no duplication).

648. What is a Primary Key?


Ans. A primary key is a column or a combination of columns that uniquely identifies a record in
the database. A primary key can only have unique and not NULL values and there can be only
one primary key in a table.

649. What is the difference between a unique key and a primary key?
Ans. A unique key allows null value (although only one) but a primary key doesn’t allow null
values. A table can have more than one unique keys columns while there can be only one
primary key. A unique key column creates a non-clustered index whereas the primary key
creates a clustered index on the column.

650. What is a composite key?


Ans. A composite key is a primary key with multiple columns as in the case of some tables a
single field might not guarantee unique and not null values. So a combination of multiple fields
is taken as the primary key.

651. What is a NULL value?


Ans. A NULL value in SQL is an unknown or blank value. Since NULL is an unknown value so
the NULL value cannot be compared with another NULL value. Hence we cannot use the ‘=’
operator in where condition with NULL. For this, we have an IS NULL clause that checks if the
value in the field is NULL or not.

652. What is a Not NULL constraint?


Ans. A Not NULL constraint is used for ensuring that the value in the field cannot be NULL.

653. What is a Foreign Key?


Ans. A foreign key is used for enforcing referential integrity in which a field marked as a foreign
key in one table is linked with a primary key of another table. With this referential integrity, we
can have only the data in the foreign key which matches the data in the primary key of the other
table.

Page | 153
654. What is a Check constraint?
Ans. A check constraint is used to limit the value entered in a field. For example, we can ensure
that field ‘Salary’ can only have a value greater than 1000 using check constraint.
CREATE TABLE EMP_SALARY(
EmpID int NOT NULL,
NAME VARCHAR (30) NOT NULL,
Salary INT CHECK (Salary > 1000),
PRIMARY KEY (EmpID)
);

655. What is a Default constraint?


Ans. A Default constraint is used for providing a default value to a column when no value is
supplied at the time of insertion of record in the database.

656. What is a clustered index?


Ans. A clustered index defines the order in which data is physically stored in the database tables.
A table can have only one clustered index.

657. What is a non-clustered index?


Ans. In the case of a non-clustered index, the data and the indices are stored in different
locations. A non-clustered index has a jump table containing key-values with pointers pointing to
the location containing the actual rows. There can be multiple clustered indexes in a table.

658. What is the difference between delete, truncate and drop command?
Ans. The difference between the Delete, Truncate and Drop command is –
 Delete command is a DML command. It removes rows from a table based on the
condition specified in the where clause, being a DML statement we can rollback changes
made by the delete command.
 Truncate is a DDL command. It removes all the rows from the table and also frees the
space held, unlike the delete command. It takes a lock on the table while the delete
command takes a lock on rows of the table.
 Drop is a DDL command. It removes the complete data along with the table structure
(unlike the truncate command that removes only the rows).

659. What are the different types of joins in SQL?


Ans. Joins are used to combine records from multiple tables. The different types of joins in SQL
are-
1. Inner Join – To fetch rows from two tables having matching data in the specified
columns of both the tables.
SELECT * FROM TABLE1 INNER JOIN TABLE2 ON TABLE1.columnA =
TABLE2.columnA;
2. Left Join – To fetch all rows from the left table and matching rows of the right table
SELECT * FROM TABLE1 LEFT JOIN TABLE2 ON TABLE1.columnA =
TABLE2.columnA;

Page | 154
3. Right Join – To fetch all rows from right table and matching rows of the left table
SELECT * FROM TABLE1 RIGHT JOIN TABLE2 ON TABLE1.columnA =
TABLE2.columnA;
4. Full Outer Join – To fetch all rows of the left table and all rows of right table
SELECT * FROM TABLE1 FULL OUTER JOIN TABLE2 ON TABLE1.columnA =
TABLE2.columnA;
5. Self Join – Joining a table to itself, for referencing its own data
SELECT * FROM TABLE1 T1, TABLE1 T2 WHERE T1.columnA = T2.columnB;

660. What is the difference between cross join and full outer join?
Ans. A cross join returns the cartesian product of the two tables. So there is no condition or on
clause as each row of TabelA is joined with each row of TableB whereas a full outer join will
join the two tables on the basis of the condition specified in the on clause and for the records not
satisfying the condition null value is placed in the join result.

661. What is the difference between where and having clause?


Ans. This is one of the commonly asked DBMS interview questions in which the interviewer
wants to check your knowledge of the ‘where’ and ‘having’ clause along with their usage.

A ‘where’ clause is used to fetch data from the database that specifies particular criteria
(specified after the where clause). Whereas a ‘having’ clause is used along with ‘GROUP BY’ to
fetch data that meets particular criteria specified by the aggregate function.
For example – for a table with Employee and Project fields. If we want to fetch Employee
working on a particular project P2, we will use ‘where’ clause-
Select Employee
From Emp_Project
where Project = P2;
Now if we want to fetch Employees who are working on more than one project. We will first
have to group the Employee column along with the count of the project and then the ‘having’
clause can be used to fetch relevant records-
Select Employee
From Emp_Project
GROUP BY Employee
Having count(Project)>1;

662. What is the difference between Union and Union All command?
Ans. The fundamental difference between Union and Union All command is – Union is by
default distinct i.e. it combines the distinct result set of two or more select statements.
Whereas, Union All combines all the rows including duplicates in the result set of different
select statements.

663. Define the ‘Select into’ statement.


Ans. Select into statement is used to directly select data from one table and insert it into another.
The new table gets created with the same name and type as of the old table-
SELECT * INTO newtable FROM oldTable;

Page | 155
664. What is a View in SQL?
Ans. A view is a virtual table. It is a named set of SQL statements that can be later referenced
and used as a table.
CREATE VIEW VIEW_NAME AS
SELECT COLUMN1, COLUMN2
FROM TABLE_NAME WHERE CONDITION;

665. Can we use ‘where’ clause with ‘GROUP BY‘?


Ans. Yes, we can use ‘where’ clause with ‘GROUP BY’. The rows that don’t meet the where
conditions are removed first and then the grouping is done based on the GROUP BY column.
SELECT Employee, Count(Project )
FROM Emp_Project
WHERE Employee != 'A'
GROUP BY Project;

666. What is Database Normalisation?


Ans. Database normalization is the process of organization of data in order to reduce the
redundancy and anomalies in the database. We have different Normalisation forms in SQL like –
First Normal Form, Second Normal Form, Third Normal Form, and BCNF.

667. Explain the First Normal Form(1NF).


Ans. According to First Normal Form, a column cannot have multiple values. Each value in the
columns must be atomic.

668. Explain the Second Normal Form(2NF).


Ans. For a table to be considered in Second Normal Form. It must follow 1NF and no column
should be dependent on the primary key.

669. Explain the Third Normal Form(3NF).


Ans. For a table to be Third Normal Form, it must follow 2NF and each non-prime attribute must
be dependent on the primary key of the table.

For each functional dependency X -> Y either-


X should be the super key or Y should be the prime attribute (part of one of the candidate keys)
of the table.

670. Explain Boyce and Codd Normal Form(BCNF).


Ans. BCNF is the advanced or stricter version of 3NF.
For each functional dependency X -> Y, X should be a super key.

671. What are transactions in SQL?


Ans. Transactions are a set of operations performed in a logical sequence. It is executed as a
whole. If any statement in the transaction fails, the whole transaction is marked as failed and not
committed to the database.

Page | 156
672. What are the ACID properties?
Ans. This is one of the frequently asked database interview questions. ACID properties refer to
the four properties of transactions in SQL-
1. Atomicity – All the operations in the transaction are performed as a whole or not
performed at all.
2. Consistency – State of database changes only on successfully committed transactions.
3. Isolation – Even with concurrent execution of multiple transactions. The final state of the
DB would be the same as if transactions got executed sequentially. In other words, each
transaction is isolated from one another.
4. Durability – Even in the state of crash or power loss the state of the committed
transaction remains persistent.

673. What are locks in SQL?


Ans. Locks in SQL are used for maintaining database integrity in case of concurrent access to the
same piece of data.

674. What are the different types of locks in the database?


Ans. The different types of locks in the database are-
1. Shared locks – Allows data to be read-only(Select operations), prevents the data to be
updated when in the shared lock.
2. Update locks – Applied to resources that can be updated. There can be only one update
lock on a data at a time.
3. Exclusive locks – Used to lock data being modified (INSERT, UPDATE, or DELETE)
by one transaction. Thus ensuring that multiple updates cannot be made to the same
resource at the same time.
4. Intent locks – A notification mechanism using which a transaction conveys that intends to
acquire a lock on data.
5. Schema locks – Used for operations when schema or structure of the DB is required to be
updated.
6. Bulk Update locks – Used in case of bulk operations when the TABLOCK hint is used.

675. What are the aggregate functions in SQL?


Ans. Aggregate functions are the SQL functions that return a single value calculated from
multiple values of columns. Some of the aggregate functions in SQL are-
 Count() – Returns the count of the number of rows returned by the SQL expression
 Max() – Returns the max value out of the total values
 Min() – Returns the min value out of the total values
 Avg() – Returns the average of the total values
 Sum() – Returns the sum of the values returned by the SQL expression

676. What are scalar functions in SQL?


Ans. Scalar functions are the functions that return a single value by processing a single value in
SQL. Some of the widely used SQL functions are-
 UCASE() – USed to convert a string to upper case
 LCASE() – Used to convert a string to lower case

Page | 157
 ROUND() – Used to round a number to the decimal places specified
 NOW() – Used to fetch current system date and time
 LEN() – Used to find the length of a string
 SUBSTRING() or MID() – MID and SUBSTRING are synonyms in SQL. They are used
to extract a substring from a string by specifying the start and end index. Syntax –
SUBSTRING(ColumnName, startIndex, EndIndex).
 LOCATE() – Used to find the index of the character in a string. Syntax –
LOCATE(character,ColumnName)
 LTRIM() – Used to trim spaces from left
 RTRIM() – Used to trim spaces from right

677. What is a coalesce function?


Ans. Coalesce function is used to return the first, not NULL value out of the different values or
expressions passed to the coalesce function as parameters. Example-
COALESCE(NULL, NULL, 5, ‘ArtOfTesting’) will return the value 5.
COALESCE(NULL, NULL, NULL) will return NULL value as no not NULL value is
encountered in the parameters list.

678. What are cursors in SQL?


Ans. Cursors are objects in SQL that are used to traverse the result set of a SQL query one by
one.

679. What are the stored procedures? Explain their advantages.


Ans. Stored procedures are SQL procedures (a bunch of SQL statements) that are stored in the
database and can be called by other procedures, triggers, and other applications.
CREATE PROCEDURE
procedureName
AS
Begin
Set of SQL statements
End
The advantages of stored procedure are-
1. Stored procedures improve performance as the procedures are pre-compiled as well as
cached.
2. Make queries easily maintainable and reusable as any change is required to be made at a
single location.
3. Reduce network usage and traffic.
4. Improve security as stored procedures restrict direct access to the database.

680. What are the triggers in SQL?


Ans. Triggers are special types of stored procedures that get executed when a specified event
occurs. Syntax-
CREATE TRIGGER
triggerName

Page | 158
triggerTime{Before or After}
triggerEvent{Insert, Update or Delete}
ON tableName
FOR EACH ROW
triggerBody

681. What are orphan records?


Ans. Orphan records are records having a foreign key to a parent record that doesn’t exist or got
deleted.

682. How can we remove orphan records from a table?


Ans. In order to remove orphan records from the database. We need to create a join on the parent
and child tables and then remove the rows from the child table where id IS NULL.
DELETE PT
FROM ParentTable PT
LEFT JOIN ChildTable CT
ON PT.ID = CT.ID
WHERE PT.ID IS NULL

Top 40 SQL Query Interview Questions and Answers for Practice


Hello friends! in this post, we will see some of the most common SQL queries asked in
interviews. Whether you are a DBA, developer, tester, or data analyst, these SQL query
interview questions and answers are going to help you.

In fact, I have been asked most of these questions during interviews in the different phases of my
career.
If you want to skip the basic questions and start with some tricky SQL queries then you can
directly move to our SQL queries interview questions for the experienced section.
Consider the below two tables for reference while trying to solve the SQL queries for practice.
Table – EmployeeDetails
EmpId FullName ManagerId DateOfJoining City

121 John Snow 321 01/31/2019 Toronto

321 Walter White 986 01/30/2020 California

421 Kuldeep Rana 876 27/11/2021 New Delhi

Table – EmployeeSalary

Page | 159
EmpId Project Salary Variable

121 P1 8000 500

321 P2 10000 1000

421 P1 12000 0

Here is a list of top SQL query interview questions and answers for fresher candidates that will
help them in their interviews. In these queries, we will focus on the basic SQL commands only.

683. Write an SQL query to fetch the EmpId and FullName of all the employees working
under the Manager with id – ‘986’.
Ans. We can use the EmployeeDetails table to fetch the employee details with a where clause for
the manager-
SELECT EmpId, FullName

FROM EmployeeDetails

WHERE ManagerId = 986;

684. Write an SQL query to fetch the different projects available from the EmployeeSalary
table.
Ans. While referring to the EmployeeSalary table, we can see that this table contains project
values corresponding to each employee, or we can say that we will have duplicate project values
while selecting Project values from this table.

So, we will use the distinct clause to get the unique values of the Project.
SELECT DISTINCT(Project)

FROM EmployeeSalary;

685. Write an SQL query to fetch the count of employees working in project ‘P1’.
Ans. Here, we would be using aggregate function count() with the SQL where clause-
SELECT COUNT(*)

Page | 160
FROM EmployeeSalary

WHERE Project = 'P1';

686. Write an SQL query to find the maximum, minimum, and average salary of the
employees.
Ans. We can use the aggregate function of SQL to fetch the max, min, and average values-
SELECT Max(Salary),

Min(Salary),

AVG(Salary)

FROM EmployeeSalary;Ques.5. Write an SQL query to find the employee id whose salary
lies in the range of 9000 and 15000.
Ans. Here, we can use the ‘Between’ operator with a where clause.

SELECT EmpId, Salary

FROM EmployeeSalary

WHERE Salary BETWEEN 9000 AND 15000;

687. Write an SQL query to fetch those employees who live in Toronto and work under the
manager with ManagerId – 321.
Ans. Since we have to satisfy both the conditions – employees living in ‘Toronto’ and working
in Project ‘P2’. So, we will use AND operator here-
SELECT EmpId, City, ManagerId

FROM EmployeeDetails

WHERE City='Toronto' AND ManagerId='321';

688. Write an SQL query to fetch all the employees who either live in California or work
under a manager with ManagerId – 321.
Ans. This interview question requires us to satisfy either of the conditions – employees living in

Page | 161
‘California’ and working under Manager with ManagerId – 321. So, we will use the OR operator
here-
SELECT EmpId, City, ManagerId

FROM EmployeeDetails

WHERE City='California' OR ManagerId='321';

689. Write an SQL query to fetch all those employees who work on Projects other than P1.
Ans. Here, we can use the NOT operator to fetch the rows which are not satisfying the given
condition.
SELECT EmpId

FROM EmployeeSalary

WHERE NOT Project='P1';

Or using the ‘not equal to’ operator-

SELECT EmpId

FROM EmployeeSalary

WHERE Project <> 'P1';

For the difference between NOT and <> SQL operators, check this link – Difference between the
NOT and != operators.

690. Write an SQL query to display the total salary of each employee adding the Salary
with Variable value.
Ans. Here, we can simply use the ‘+’ operator in SQL.
SELECT EmpId,

Salary+Variable as TotalSalary

FROM EmployeeSalary;

Page | 162
691. Write an SQL query to fetch the employees whose name begins with any two
characters, followed by a text “hn” and ends with any sequence of characters.
Ans. For this question, we can create an SQL query using like operator with ‘_’ and ‘%’ wild
card characters, where ‘_’ matches a single character and ‘%’ matches ‘0 or multiple characters.
SELECT FullName

FROM EmployeeDetails

WHERE FullName LIKE ‘__hn%’;

692. Write an SQL query to fetch all the EmpIds which are present in either of the tables –
‘EmployeeDetails’ and ‘EmployeeSalary’.
Ans. In order to get unique employee ids from both tables, we can use the Union clause which
can combine the results of the two SQL queries and return unique rows.
SELECT EmpId FROM EmployeeDetails

UNION

SELECT EmpId FROM EmployeeSalary;

693. Write an SQL query to fetch common records between two tables.
Ans. SQL Server – Using INTERSECT operator-

SELECT * FROM EmployeeSalary


INTERSECT
SELECT * FROM ManagerSalary;

MySQL – Since MySQL doesn’t have INTERSECT operator so we can use the subquery-
SELECT *
FROM EmployeeSalary
WHERE EmpId IN
(SELECT EmpId from ManagerSalary);

Page | 163
694. Write an SQL query to fetch records that are present in one table but not in another
table.
Ans. SQL Server – Using MINUS- operator-
SELECT * FROM EmployeeSalary

MINUS

SELECT * FROM ManagerSalary;

MySQL – Since MySQL doesn’t have a MINUS operator so we can use LEFT join-

SELECT EmployeeSalary.*

FROM EmployeeSalary

LEFT JOIN

ManagerSalary USING (EmpId)

WHERE ManagerSalary.EmpId IS NULL;

695. Write an SQL query to fetch the EmpIds that are present in both the tables –
‘EmployeeDetails’ and ‘EmployeeSalary.
Ans. Using subquery-
SELECT EmpId FROM

EmployeeDetails

where EmpId IN

(SELECT EmpId FROM EmployeeSalary);

Page | 164
696. Write an SQL query to fetch the EmpIds that are present in EmployeeDetails but not
in EmployeeSalary.
Ans. Using subquery-
SELECT EmpId FROM

EmployeeDetails

where EmpId Not IN

(SELECT EmpId FROM EmployeeSalary);

697. Write an SQL query to fetch the employee’s full names and replace the space with ‘-’.
Ans. Using the ‘Replace’ function-
SELECT REPLACE(FullName, ' ', '-')

FROM EmployeeDetails;

698. Write an SQL query to fetch the position of a given character(s) in a


field.
Ans. Using the ‘Instr’ function-

SELECT INSTR(FullName, 'Snow')

FROM EmployeeDetails;

699. Write an SQL query to display both the EmpId and ManagerId together.
Ans. Here we can use the CONCAT command.
SELECT CONCAT(EmpId, ManagerId) as NewId

FROM EmployeeDetails;

700. Write a query to fetch only the first name(string before space) from the FullName
column of the EmployeeDetails table.
Ans. In this question, we are required to first fetch the location of the space character in the
FullName field and then extract the first name out of the FullName field.

For finding the location we will use the LOCATE method in MySQL and CHARINDEX in SQL
SERVER and for fetching the string before space, we will use the SUBSTRING OR MID

Page | 165
method.

SELECT MID(FullName, 1, LOCATE(' ',FullName))

FROM EmployeeDetails;

SQL Server – using SUBSTRING

SELECT SUBSTRING(FullName, 1, CHARINDEX(' ',FullName))

FROM EmployeeDetails;

701. Write an SQL query to uppercase the name of the employee and lowercase the city
values.
Ans. We can use SQL Upper and Lower functions to achieve the intended results.
SELECT UPPER(FullName), LOWER(City)

FROM EmployeeDetails;

702. Write an SQL query to find the count of the total occurrences of a particular
character – ‘n’ in the FullName field.
Ans. Here, we can use the ‘Length’ function. We can subtract the total length of the FullName
field from the length of the FullName after replacing the character – ‘n’.
SELECT FullName,

LENGTH(FullName) - LENGTH(REPLACE(FullName, 'n', ''))

FROM EmployeeDetails;

703. Write an SQL query to update the employee names by removing leading and trailing
spaces.
Ans. Using the ‘Update’ command with the ‘LTRIM’ and ‘RTRIM’ functions.
UPDATE EmployeeDetails

SET FullName = LTRIM(RTRIM(FullName));

Page | 166
704. Fetch all the employees who are not working on any project.
Ans. This is one of the very basic interview questions in which the interviewer wants to see if the
person knows about the commonly used – Is NULL operator.
SELECT EmpId

FROM EmployeeSalary

WHERE Project IS NULL;

705. Write an SQL query to fetch employee names having a salary greater than or equal to
5000 and less than or equal to 10000.
Ans. Here, we will use BETWEEN in the ‘where’ clause to return the EmpId of the employees
with salary satisfying the required criteria and then use it as a subquery to find the fullName of
the employee from the EmployeeDetails table.
SELECT FullName

FROM EmployeeDetails

WHERE EmpId IN

(SELECT EmpId FROM EmployeeSalary

WHERE Salary BETWEEN 5000 AND 10000);

706. Write an SQL query to find the current date-time.


Ans. MySQL-
SELECT NOW();

SQL Server-

SELECT getdate();

Oracle-

SELECT SYSDATE FROM DUAL;

Page | 167
707. Write an SQL query to fetch all the Employee details from the EmployeeDetails table
who joined in the Year 2020.
Ans. Using BETWEEN for the date range ’01-01-2020′ AND ’31-12-2020′-
SELECT * FROM EmployeeDetails

WHERE DateOfJoining BETWEEN '2020/01/01'

AND '2020/12/31';

Also, we can extract the year part from the joining date (using YEAR in MySQL)-

SELECT * FROM EmployeeDetails

WHERE YEAR(DateOfJoining) = '2020';

708. Write an SQL query to fetch all employee records from the EmployeeDetails table
who have a salary record in the EmployeeSalary table.
Ans. Using ‘Exists’-
SELECT * FROM EmployeeDetails E

WHERE EXISTS

(SELECT * FROM EmployeeSalary S

WHERE E.EmpId = S.EmpId);

709. Write an SQL query to fetch the project-wise count of employees sorted by project’s
count in descending order.
Ans. The query has two requirements – first to fetch the project-wise count and then to sort the
result by that count.

For project-wise count, we will be using the GROUP BY clause and for sorting, we will use the
ORDER BY clause on the alias of the project count.
SELECT Project, count(EmpId) EmpProjectCount

FROM EmployeeSalary

GROUP BY Project

Page | 168
ORDER BY EmpProjectCount DESC;

710. Write a query to fetch employee names and salary records. Display the employee
details even if the salary record is not present for the employee.
Ans. This is again one of the very common interview questions in which the interviewer just
wants to check the basic knowledge of SQL JOINS.

Here, we can use the left join with the EmployeeDetail table on the left side of the
EmployeeSalary table.
SELECT E.FullName, S.Salary

FROM EmployeeDetails E

LEFT JOIN

EmployeeSalary S

ON E.EmpId = S.EmpId;

711. Write an SQL query to join 3 tables.


Ans. Considering 3 tables TableA, TableB, and TableC, we can use 2 joins clauses like below-

SELECT column1, column2

FROM TableA

JOIN TableB ON TableA.Column3 = TableB.Column3

JOIN TableC ON TableA.Column4 = TableC.Column4;

Page | 169
SQL Query Interview Questions for Experienced
Here is a list of some of the most frequently asked SQL query interview questions for
experienced professionals. These questions cover SQL queries on advanced SQL JOIN concepts,
fetching duplicate rows, odd and even rows, nth highest salary, etc.

712. Write an SQL query to fetch all the Employees who are also managers from the
EmployeeDetails table.
Ans. Here, we have to use Self-Join as the requirement wants us to analyze the EmployeeDetails
table as two tables. We will use different aliases ‘E’ and ‘M’ for the same EmployeeDetails
table.
SELECT DISTINCT E.FullName

FROM EmployeeDetails E

INNER JOIN EmployeeDetails M

ON E.EmpID = M.ManagerID;

To learn more about Self Join along with some more queries, you can watch the below video that
explains the self-join concept in a very simple way.

Self Join and Its Demonstration

713. Write an SQL query to fetch duplicate records from EmployeeDetails (without
considering the primary key – EmpId).
Ans. In order to find duplicate records from the table, we can use GROUP BY on all the fields
and then use the HAVING clause to return only those fields whose count is greater than 1 i.e. the
rows having duplicate records.
SELECT FullName, ManagerId, DateOfJoining, City, COUNT(*)

FROM EmployeeDetails

GROUP BY FullName, ManagerId, DateOfJoining, City

HAVING COUNT(*) > 1;

Page | 170
714. Write an SQL query to remove duplicates from a table without using a temporary
table.
Ans. Here, we can use delete with alias and inner join. We will check for the equality of all the
matching records and then remove the row with a higher EmpId.
DELETE E1 FROM EmployeeDetails E1

INNER JOIN EmployeeDetails E2

WHERE E1.EmpId > E2.EmpId

AND E1.FullName = E2.FullName

AND E1.ManagerId = E2.ManagerId

AND E1.DateOfJoining = E2.DateOfJoining

AND E1.City = E2.City;

716. Write an SQL query to fetch only odd rows from the table.
Ans. In case we have an auto-increment field e.g. EmpId then we can simply use the below
query-
SELECT * FROM EmployeeDetails

WHERE MOD (EmpId, 2) <> 0;

In case we don’t have such a field then we can use the below queries.

Using Row_number in SQL server and checking that the remainder when divided by 2 is 1-

SELECT E.EmpId, E.Project, E.Salary

FROM (

SELECT *, Row_Number() OVER(ORDER BY EmpId) AS RowNumber

FROM EmployeeSalary

)E

Page | 171
WHERE E.RowNumber % 2 = 1;

Using a user-defined variable in MySQL-

SELECT *

FROM (

SELECT *, @rowNumber := @rowNumber+ 1 rn

FROM EmployeeSalary

JOIN (SELECT @rowNumber:= 0) r

)t

WHERE rn % 2 = 1;

717. Write an SQL query to fetch only even rows from the table.
Ans. In case we have an auto-increment field e.g. EmpId then we can simply use the below
query-
SELECT * FROM EmployeeDetails

WHERE MOD (EmpId, 2) = 0;

In case we don’t have such a field then we can use the below queries.

Using Row_number in SQL server and checking that the remainder, when divided by 2, is 1-

SELECT E.EmpId, E.Project, E.Salary

FROM (

SELECT *, Row_Number() OVER(ORDER BY EmpId) AS RowNumber

FROM EmployeeSalary

)E

Page | 172
WHERE E.RowNumber % 2 = 0;

Using a user-defined variable in MySQL-

SELECT *

FROM (

SELECT *, @rowNumber := @rowNumber+ 1 rn

FROM EmployeeSalary

JOIN (SELECT @rowNumber:= 0) r

)t

WHERE rn % 2 = 0;

718. Write an SQL query to create a new table with data and structure copied from
another table.
Ans.
CREATE TABLE NewTable

SELECT * FROM EmployeeSalary;

719. Write an SQL query to create an empty table with the same structure as some other
table.
Ans. Here, we can use the same query as above with the False ‘WHERE’ condition-
CREATE TABLE NewTable

SELECT * FROM EmployeeSalary where 1=0;

720. Write an SQL query to find the nth highest salary from a table.
Ans. Using Top keyword (SQL Server)-

SELECT TOP 1 Salary

Page | 173
FROM (

SELECT DISTINCT TOP N Salary

FROM Employee

ORDER BY Salary DESC

ORDER BY Salary ASC;

Using limit clause(MySQL)-

SELECT Salary

FROM Employee

ORDER BY Salary DESC LIMIT N-1,1;

721. Write SQL query to find the 3rd highest salary from a table without using the
TOP/limit keyword.
Ans. This is one of the most commonly asked interview questions. For this, we will use a
correlated subquery.

In order to find the 3rd highest salary, we will find the salary value until the inner query returns a
count of 2 rows having the salary greater than other distinct salaries.
SELECT Salary

FROM EmployeeSalary Emp1

WHERE 2 = (

SELECT COUNT( DISTINCT ( Emp2.Salary ) )

FROM EmployeeSalary Emp2

Page | 174
WHERE Emp2.Salary > Emp1.Salary

For nth highest salary-

SELECT Salary

FROM EmployeeSalary Emp1

WHERE N-1 = (

SELECT COUNT( DISTINCT ( Emp2.Salary ) )

FROM EmployeeSalary Emp2

WHERE Emp2.Salary > Emp1.Sala

Top SQL Join Interview Questions and Answers


June 25, 2021

SQL Joins are one of the most commonly used concepts while working with multiple tables. For
this reason, interview questions based on SQL joins are frequently asked during the interviews
involving SQL.

In this article, we have compiled top SQL joins interview questions (starting with the basic ones)
that you should prepare for the interviews. So let’s begin.

SQL Joins Interview Questions

722. What are Joins in SQL?


Ans. Joins in SQL are the statements or clauses using which we can combine two or more tables,
based on some common fields present among the tables.

A simple example can be combining the two tables – EmployeeDetails and EmployeeSalary.
Now, we may look to join these two tables in order to get useful information like fetching the
name of the employee getting the highest salary. Since the name is present in the

Page | 175
EmployeeDetails table and salary is present in EmployeeSalary, so, we will join these two tables
using joins.
EmpId Name ManagerId

121 John 321

321 Walter 986

421 Nick 589

EmployeeDetails

EmpId Project Salary

121 P1 8000

321 P2 9000

421 P3 9500

EmployeeSalary

SELECT *

FROM EmployeeDetails INNERJOIN EmployeeSalary

ON EmployeeDetails.EmpId = EmployeeSalary.EmpId;

723. Explain the different types of Joins in SQL?


Ans. Some of the major joins in SQL are-
 Inner Join – Inner join is used to return the records which are having matching values in
both the tables.
 Left Join – Left join is used to concatenate all the rows of the left table and the matching
rows in the right table.
 Right Join-Right join is used to concatenate all the rows of the right table and the
matching rows in the left table.

Page | 176
 Full Join-Full join is used to return all the records of both the tables as long as there is a
matching record in either table.
 Self Join-Self join is a join that is used to join a table to itself. In a self-join, a table is
considered as if it were two tables.
 Cartesian Join-Cartesian join is used to return the number of rows in the first table
multiplied by the number of rows in the second table. It is also referred to as cross join.

724. What is the difference between Inner and Self Join?


Ans. A Self join is a type of Inner join.
Inner join is used to return the records which are present in both tables. Whereas, in self join, a
table is joined to itself.

725. What is the difference between Full Join and Cross Join?
Ans. A Full Outer Join is a combination of a Left Outer and Right Outer Join. It returns all rows
in both tables that match the query’s WHERE clause, and in cases where the ON condition is not
satisfied, it puts NULL values.
Whereas, a Cross join produces a cartesian product between the two tables, returning all possible
combinations of all rows.

726. What is Natural Join?


Ans. Natural join is used to create an implicit join clause based on the value of common
attributes in the two tables. Common attributes are the attributes that have the same name in both
tables. Natural join does not need any comparison operator as in the case of equi join.

Example – In the below two tables the Employee and Department tables have a common field
‘EmpNo’. So, in the case of natural joins, we don’t need to mention the On clause over the
‘EmpNo’ field of both the tables.
EmpId Name City

568 KD Seattle

897 PK Austin

215 PP Miami

Employees

DeptId DName EmpId

5466 HR 897

Page | 177
DeptId DName EmpId

5219 IT 215

8795 HK 568

Department

SELECT Employees.Name, Department.DName

FROM Department

Natural JOIN Employees

727. What is an Equi Join?


Ans. An Equi Join is a type of join that combines tables based on matching values in the
specified columns.
 The column names do not need to be the same.
 The resultant table can contain repeated columns.
 It is possible to perform an equi join on more than two tables.
Syntax-
SELECT *

FROM TableName1

JOIN TableName2

ON TableName1.ColumnName = TableName2.ColumnName;

Also check – SQL Query Interview Questions.

728. What is a non-equi join?


Ans. A non-equi join is a join in which join conditions use conditional operators instead of
equals operator. Syntax-
SELECT *

FROM TableName1

Page | 178
JOIN TableName2

ON TableName1.ColumnName [>,<,>=,<= ] TableName2.ColumnName;

729. What is the difference between cross join and natural join?
Ans. A cross join produces a cross product or cartesian product of two tables whereas the natural
join is based on all the columns having the same name and data types in both the tables.

730. How are Joins different from the Union clause?


Ans. Some features of Joins are-
1. Join combines attributes of the rows present in the two tables that share some common
fields or attributes.
2. Join is applicable when the two tables have at least one common attribute.
3. There are many types of joins like INNER JOIN, OUTER JOIN, LEFT JOIN, RIGHT
JOIN, etc.
4. The length of the resultant rows is more as compared to the length of rows of the tables
involved.
Whereas in case of Union-

1. Join combines rows of the tables that are present in the query.
2. Join is applicable when the number of columns present in the query is the same and the
corresponding attributes have the same domain.
3. There are two types of a union like UNION and UNION ALL.
4. The number of the resultant rows is more as compared to the number of rows present in
each table involved in the query.

731. Write the SQL command to join 3 tables.


Ans. Consider the below 3 tables. Now in order to fetch EmpName, DeptName, Gender
information of all the employees, we will join the 3 tables.

EmpNo EmpName DeptId GenderId

1886 John Snow 101 1

1889 Amara Giselle 102 2

Page | 179
EmpNo EmpName DeptId GenderId

1890 Richie Tung 102 1

Table – Employees

DeptId DeptName

101 HR

102 IT

Table – Department

GenderId Gender

01 Male

02 Female

Table – Gender

SELECT EmpName, DeptName, Gender

FROM Employees

JOIN Departement ON Employees.DeptId=Department.DeptId

JOIN Genders ON Employees.GenderId=Genders.GenderID;

Page | 180
API Testing Interview Questions

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

732. What is API?

API (Application Programming Interface) helps in communication and data exchange between
two software systems. API act as an interface between two applications and allows the two
software systems communicate with one another. API is a collection of functions which can be
executed by another software program.

API works as; it takes a request from the source, takes that request to the database, fetches the
request data from the database and returns a response to the source. API takes the requests from
the user and gives the response without exposing the internal details. API acts as Abstraction.

Example: Amazon API, Google Map API

Page | 181
Play Video

733. What is API testing?

API testing is a type of software testing that involves testing APIs directly. API is a part of
integration testing to check whether the API meets expectations in terms of functionality,
reliability, performance, and security of applications. Multiple API system can performed API
testing. In API testing, our primary focus is on Business Logic Layer of the software
architecture.

734.What are the types of API testing?

API testing involves the following types of testing:

o Unit Testing
o Functional Testing
o Load Testing
o Runtime/Error Detection
o Security Testing
o UI Testing
o Interoperability and WS compliance Testing
o Penetration Testing
o Fuzz Testing

Page | 182
735. What are the protocols used in API Testing?

Protocols used in API testing are:

o HTTP
o REST
o SOAP
o JMS
o UDDI

736. What are the tools used for API Testing?

Tools used for API testing are:

o Parasoft SOAtest
o PostMan
o AlertSite API monitoring

737. What is API test environment?

For API the test environment is a quite complex method where the configuration of server and
database is done as per the requirement of the software application. API testing does not involve
graphical user interface (GUI).

API is checked for its proper functioning after installation.

738. What is API framework?

API framework is described by the config. File which consist of the list of all APIs that are
required to be activated and are activated for any particular program run. This is essential as
every test run does not require all APIs.

Page | 183
739. What are the limits of API usage?

Many APIs have certain limit set up by the provider. Hence, try to estimate our usage and
understand how that will impact the overall cost of the offering.

740. What are the advantages of API testing?

Advantages of API testing are:

o Test for core functionality: API testing provides access to the application without the
user interface. The core functionality of the application will be tested before the GUI
tests. This will help to detect the minor issue which can become bigger during the GUI
testing.
o Time effective: API testing is less time consuming than GUI testing. Particularly, API
test requires less code so it can provide better and faster test coverage compare to GUI
test automation. This will reduce the cost for the testing project.
o Language Independent: In API testing data is exchange using XML or JSON. These
transfer mode are completely language-independent, which allows users to select any
code language when adopting automation test service for the project.
o Easy Integration with GUI: API tests provide highly integrable tests which is useful to
perform functional GUI tests after GUI tests. Simple integration would allow new user
accounts to be created within the application before GUI started.

741. What are the principles of an API test design?

Here, are the seven principles of API test design.

1. Exhaustive Testing: Exhaustive testing is not possible. Instead we need optimal amount
of testing which is based on the risk assessment of the application.
2. Defect Clustering: Defect Clustering states that a small number of modules contain the
most of the defect detected. Approximately 80% of the defect found in 20% of the
modules. By experience we can identify such risky modules. But this approach has its
own problems. If the same tests are repeated over and over again, eventually the same
test case will no longer find new bugs.

Page | 184
3. Pesticide Paradox: Testers cannot depend on existing technique. They must have to look
continually to improve the existing method to make testing more effective. But even all
these hard work in testing we can never claim our product is bug free. To overcome this,
test cases need to be regularly reviewed and revised add new and different test cases to
help find more defects.
4. Testing shows presence of defects: Testing principle states that- testing talks about the
presence of defects not about the absence of defect. Software testing reduces the
probability of undiscovered defects remaining in the software but even if no defects
found, it is not a proof of correctness.

But if we work hard, taking all precautions and make our software products 99% bug
free. The software does not meet the needs and requirements of the client.
5. Absence of error -fallacy: This can be possible the software which is 99% bug free is
still unusable. The case can be if the system is tested for the wrong requirement. Software
testing is not finding the defects but also to check that software addresses the business
needs. The absence of error is fallacy i.e. finding and fixing defects does not help if the
system build is unusable and doesn't fulfill the user's needs and requirements.
6. Early Testing: Testing should start as soon as possible in the software development
lifecycle. So that defects in the requirement or design phase captured in the early stages.
It is cheaper to fix defect in the early stages of testing. We should start finding the bug at
the moment the requirements are defined.
7. Testing is context dependent: Testing is context dependent that we test an e-commerce
site will be different from the way we test the commercial. All the developed software's
are not identical. We will use different methodology; techniques and type of testing
depend on the application type.

742. What is API framework?

A framework or software framework is a platform for developing software applications. API


framework is a foundation on which software developer can build applications for a specific
platform.

Example: A framework can include predefined classes and functions that can be used to process
input, manage hardware devices and interact with system software.

Page | 185
Framework is similar to an Application Programming Interface, technically framework includes
API. Framework serves foundation for programming while API provides access to the elements
supported by the framework. Framework also includes code libraries, compiler and other
programs used in the software development process.

API framework is defined by configuration file which consists the list of all APIs that is required
to be activated and activated for a particular program run.

743. What are the common tests that performed on API?

Here, are the common tests that performed on API are as:

1. Response of the API should be verified based on the request. We will verify that the
return value is based on request.
2. When API is updating any data structure we should verify the system is authenticating
the outcome.
3. We will verify whether the API is trigger other event or request another API.
4. We will verify the behavior of the API when no value is return.

744.What exactly needs to verify in API testing?

In API testing, we send a request to API with the known data and then analysis the response.

1. We will verify the accuracy of the data.


2. Will see the HTTP status code.
3. We will see the response time.
4. Error codes in case API returns any errors.
5. Authorization would be check.
6. Non-Functional testing such as performance testing, security testing.

745.What are the differences between API and Web Services?


Sr. API Web Services

Page | 186
No.

1. API may or may not need network for its operations. Web Services always need network for its
operation.

2. API can be communicated through SOAP, REST, XML- Web service can be communicated
RPC and CURL calls as well. through SOAP, REST, AND RPC.
API can also be exposed in number of ways like JAR,
DLL, XML over HTTP, JSON over HTTP etc.

3. API can perform all the operations which web service Web service can't perform all the
can't perform. operations like API.

4. All APIs are not web service. All web services are API

746.What is API documentation?

A good documentation is must for any foundation. API documentation serves as quick reference
for accessing library or working within a program.

When we use any such documents, it must consists of proper plan, content source, proper layout,
information related to each function etc.

There are various documentation tools like Doxygen and JavaDoc. Here, are the functions which
are documented which revolve around the parameters like:

o Function description
o Type and syntax of error message that may occure
o Syntax, elements and sequence needed for each parameter
o Links regarding functions

747.What is the most used template for API documentation?

Here, are the various documentation template that make the whole process simple and easy. They
are:

Page | 187
o Swagger
o Miredot
o Slate
o FlatDoc
o API blueprint
o RestDoc
o Web service API specification

748.What are the types of bug that can be found during API testing?

API testing helps us to find many types of bugs which are:

o Stress
o Security
o Duplicate or missing functionality
o Reliability
o Unused flags
o Performance
o Incompatible error handling
o Multi-threaded issue
o Improper errors

749. What are the difference between API testing and UI testing?

UI (User Interface) testing means the testing of the graphical user interface. The focus of UI
testing is on the look and feel of the application. In user interface testing the main focus is on
how users can interact with app elements such as images, fonts, layout etc. are checked.

API testing allows the communication between two software systems. API testing works on
backend also known as backend testing.

Page | 188
750. What is SOAP?

SOAP (Simple Object Access Control) . It is an XML based protocol that helps in exchanging
information among computers.

751. What is REST API?

REST API is a set of function helps the developers performing requests when the response is
receiving. Through HTTP protocol interaction is made in REST API.

REST is defined as Representational state transfer. It is an effective standard for API creation.

752. What are the differences between SOAP and REST API?
Sr. SOAP API REST API
No.

1. SOAP stands as Simple Object REST stands as Representational State Transfer.


Access Protocol.

2. SOAP is a protocol. REST is an architectural pattern.

3. SOAP can work with XML format. In REST permit different data format such as Plain text, HTML,
SOAP all the data passed in XML XML, JSON etc. But the most preferred format for transferring
format. data is in JSON.

753. What are the major challenges faced during API testing?

The major challenges faced during the API testing are:

o Parameter Selection
o Parameter Combination

Page | 189
o Call sequencing
o Output verification and validation
o A major challenge is providing input values which are very difficult because GUI is not
available.

754.What are the difference between API Testing and Unit Testing?

Difference between API testing and Unit testing are:

Sr. API Testing UNIT Testing


No.

1. API testing is a form of black box testing. Unit testing is a form of white box testing.

2. API testing is performed after the project completion Unit testing is performed when the project is
during the test. created.

3. In API testing there is a wide scope of testing. In Unit testing there is a limited scope of
testing we can test only the basic functionality.

4. API testing is done by the testers. The whole purpose Unit testing is done by the developer. In unit
of API testing is end to end testing of the testing every functionality is separately tested.
functionality.

755.What is a RESTFUL web services?

There are two kinds of web services

1. SOAP Web Services


2. RESTFUL Web Services

1. SOAP (Simple Object Access Protocol) - SOAP is a XML based method which is used in
Web Services.

Page | 190
2. RESTFUL Web Services - To implement the concept of REST architecture HTTP method is
used. RESTFUL Web Services defines URI (Uniform Resource Identifier), and also provides
resource representation like JSON and a set of HTTP method.

756. What is Resource in REST?

REST architecture treats any content as resource, which can be text files, HTML pages, images,
videos or dynamic business information. REST server gives the functionality to access the
resources and modifies them. We can identify the each resources by URIs/ global IDs.

757. What is the way to represent the resource in REST?

REST uses different representation to define the resources like text, JSON and XML. The most
popular representation of resources is JSON and XML.

758. What protocol is used by the RESTFUL Web Services?

RESTFUL Web Services uses the HTTP protocol. They use the HTTP protocol as a medium of
communication between the client and the server.

759.What are the characteristics of REST?

Here, are the two characteristics of REST.

1. REST is stateless. With the use of the REST API the server has no status, we can restart
the server between two calls, inspite of all the data is transferred to the server.
2. Web Services uses POST method to perform operations, while REST uses GET method
to access the resources.

760. What is messaging in RESTFUL Web Services?

RESTFUL Web Services use the HTTP protocol as a communication tool between the client and
the server. This is the technique when the client sends a message in the form of HTTP request
the server send back the HTTP reply which is called Messaging. This message consists message
data and Meta data i.e. information on the message itself.

Page | 191
761. What are the components of an HTTP request?

An HTTP request have five components. These are:

1. Action showing HTTP method like GET, PUT, POST, DELETE.


2. Uniform Resource Identifier (URI): URI is the identifier for the resource on the server.
3. HTTP version: Indicate the HTTP version like- HTTP V1.1.
4. Request Header: Request Header carries metadata for the HTTP request message.
Metadata could be a client type, format supported by the client, format of a message
body, cache setting etc.
5. Request Body: Resource body indicates message content or resource representation.

762.What is the HTTP protocol supported by REST?

GET: GET is used to request data from the specified resource.

GET request can be cached and bookmark. It remains in the browser history and has length
restriction. When dealing with sensitive data GET requests should not be used.

POST: POST is used to send data to server for creation or updating the resources.

POST requests are never cached or bookmark.

PUT: PUT replaces the current representation of the target resource with the request payload.

DELETE: DELETE removes the specified resource.

OPTIONS: OPTION is used to describe the communication option for the target resources.

HEAD: HEAD asks for response which is identical to GET requests, but without the response
body.

763. Can we use GET request instead of PUT to create a resource?

PUT or POST method is used create a resource. GET is only used to request the resources.

Page | 192
764.What is URI? What is the purpose of web-based service and what is it's format?

URI stands for Uniform Resource Identifier. It is a string of characters designed for
unambiguous identification of resources and extensibility by the URI scheme. The purpose of
URI is to locate the resource on the server hosting of the web service.

A URIs format is <protocol>://<service-name>/<Resource Type>/<ResourceID>

765. What are SOAP Web Services?

SOAP (Simple Object Access Protocol) is defined as the XML based protocol. SOAP is also
known for developing and designing web services and also enable the communication between
the applications developed on different platform by using different programming languages on
the internet. SOAP is platform and language independent.

766. When we can use SOAP API?

We can use SOAP API to perform the operation on records like create, retrieve, update or delete.
We can use API to manage password, perform searches etc.

Page | 193
Top 55+ Most Asked Postman Interview Questions and Answers

767. What is Postman?

Postman is a free HTTP client-based software application and a collaboration platform for API
development. It is mainly used to perform API testing. It is a very popular API client which
facilitates developers and provides a platform to design, build, share, test, and document APIs.
Postman supports testing of HTTP requests by utilizing GUI (Graphical User Interface), which
later we can execute and validate the responses.

The Postman tool also facilitates us to send HTTP/s requests to a service and get their responses.
We can ensure that the service is up and running by using this.

768. What was the Postman originally developed?

When the Postman was developed, it was originally a Chrome browser plugin. It extends its
solution with the native version for both Mac and Windows.

769. Why do we use Postman?

The Postman tool has become a choice of more than 8 million users. Following are the main
reasons for using Postman:

Play Video

o It is free: Postman is free software that we can use for API testing. It is free to download
and use for teams of any size.
o It is easy to use: Postman is an easy-to-use software tool. We can send HTTP requests of
various types (such as GET, POST, PUT, PATCH, etc.). We have to download it, and we
can send our first request in minutes. It also gives us the ability to save environments for
future use.
o Community & Support: It has a huge community forum for customer support and
extensive documentation.
o It is extensible: Postman facilitates us customizing it according to our needs with the
Postman API.
Page | 194
o APIs Support: It facilitates us to make any API call (REST, SOAP, or plain HTTP) and
easily inspect even the largest responses. It also helps manage the end-to-end lifecycle of
the API - starting from design to mocking to testing and finally maintaining the APIs.
o Runtime Services: Postman provides Runtime Services that help us manage API
collections, environments, work-spaces, and different examples.
o Integration: Postman facilitates us to easily integrate test suites into our preferred CI/CD
tools and services, such as Jenkins with Newman (command-line collection runner).

770.What is an API?

API is an acronym that stands for "Application Programming Interface". It is a set of routines,
protocols, and tools used for building Software applications. API is an interface, so it specifies
how one software program should interact with other software programs.

In other words, we can say that API is an Application Programming Interface that acts as an
interface between two software applications and allows these two software applications to
communicate with each other. API is a collection of software functions that another software
program can execute.

771.What are the various authorization methods provided by Postman?

Postman provides the following API request authorization options:

o API Key
o Oauth 1.0
o Oauth 2.0
o Bearer Token
o Basic auth
o Digest auth
o Hawk Authentication
o AWS Signature
o NTLM Authentication

Page | 195
772. What is the use of the collection in Postman?

In Postman, a collection is used to group similar requests. It systematically arranges the requests
into folders.

773. What are the various tools used for API Testing?

Following is a list of some tools that are used for API Testing:

o Postman
o SoapUI
o Katalon Studio
o Tricentis Tosca
o Apigee
o Jmeter etc.

774.How can you access the Postman variables?

We can access the Postman variables by using the variable name as:{{variable_name}}

775.What are the different types of API requests supported in Postman?

Following is a list of the different types of API requests supported in Postman:

o GET
o POST
o PUT
o PATCH
o COPY
o DELETE
o HEAD
o OPTIONS

Page | 196
o LINK
o UNLINK
o PURGE
o LOCK
o UNLOCK
o PROPFIND
o VIEW

776.What is an HTTP request? Give an example of an HTTP request.

An HTTP request is a programming request made by the client to a named host located on a
server. HTTP works as a communication interface or a request-response protocol between a
client and server. The main aim of the HTTP request is to access a resource on the server. To
make the HTTP request, the client uses components of a URL (Uniform Resource Locator),
which includes the information needed to access the resource.

An example of the HTTP request:

A client (browser) sends an HTTP request to the server; then, the server responds to the client.
The response sent by the server contains the status information about the request, and it can also
contain the requested content.

777.What are the core components of an HTTP request?

Following are the five core components of an HTTP request:

o HTTP methods: It is a set of request methods used to perform needed action for a given
resource (GET, PUT, POST, and DELETE).
o Uniform Resource Identifier (URI): It is a kind of address that describes the resource.
o HTTP Version: It specifies the version of the HTTP. For example HTTP v1.1
o Request Headers: It specifies the content type and content length of the request. For
example: Content-type: application/ JSON, Content-Length: 511
o Payload: It is used to specify the Request Body that includes message content.

Page | 197
778.Why does Postman accept Base64 encoding only?

Postman accepts Base64 encoding only because it transmits the data into the textual form and
sends it in an easier form, such as HTML form data. This is also preferred because we can rely
on the same 64 characters in any encoding language we want to use.

779.Which type of encoding does Postman accept authorization credentials and why?

Postman accepts authorization credentials in Base64 encoding only. This is inbuilt in Postman,
or else you can refer to a third-party website to convert the credentials in base64. The Base64
authorization credentials are generally used because they transmit the data into a textual form
and send it in an easier form, such as HTML form data.

780.What are the core components of an HTTP Response?

Following are the four core components of an HTTP Response:

o Status/Response Code: The server generates the status or response codes when the client
makes a request. For example, 404 means Page Not Found, and 200 means Response is
OK.
o HTTP Version: It describes the HTTP version. For example: HTTP v1.1, HTTP v1.3 etc.
o Response Header: The Response Header includes the information for the HTTP response
message. For example, Content-type, Content-length, date, status, and server type.
o Response Body: The Response Body contains the client's data requested from the server.

781.What is the meaning of the term environment in Postman?

In Postman, the term environment is a set of key-value pairs. You can create multiple
environments in Postman and switch among them quickly by pressing a button. There are 2 types
of environment, global and local.

Page | 198
782. Can we have two global scope variables with the same name in Postman?

The global variables are global, so we cannot set duplicate names for them without any
environment as it creates confusion for the software. On the other hand, local variables can have
the same name but in different environments.

783.Which one is preferred in Postman, a global or local variable?

In Postman, if 2 variables have the same name (one being local, the other global), then the higher
priority is of the local variable. The local variable will overwrite the global variable.

784.How can you log variable values in Postman?

In Postman, we can log the variable values in the console by using the following command:

1. console.log(pm.variables.get("variable_name"));

785.What is the use of Postman monitor?

The Postman monitor is used for running collections. Collections run till the specified time
defined by the users. It requires the users to be logged in, and the users share the Monitor reports
over an email on a daily or monthly basis.

786.What do you understand by team workspace in Postman?

As we know, a workspace is a collaborative environment for users to develop and test APIs. In
the same way, a team workspace is a workspace that is shared by the whole team working on the
same collections of requests. Usually, it is time-consuming and hard to share the collections
through external drives or other sharing; the team workspace synchronizes and collaborates all
the team's work in one place.

787.What is the difference between Query Params and Path Variables?

Query Params or Query Parameters are used for sorting or filtering the resources. On the other
hand, Path Variables are used for identifying specific resources.

Page | 199
788.What is the use of Postman Collection runners?

The Postman Collection runner is used to perform Data-driven testing. It runs a group of API
requests for multiple iterations with different data sets.

789.What is Basic Auth in Postman?

In Postman, Basic Auth is an authorization technique provided for HTTP user agents like web
browsers to enter username and password. After entering the username and password, it gets
associated with the request.

790.Can we import local variables in Postman Monitors?

Yes, we can import local variables in Postman Monitors, but it is not allowed to import global
variables in Postman Monitors.

791.What are the main limitations of Postman?

Following is the list of key limitations of Postman:

o Postman cannot process 1000+ API requests.


o In the case of huge projects, it isn't easy to manage the collections and requests.
o Postman is not suitable for managing the workspace in the form of code. This is because
there would be a lot of code duplication for dynamic API requests.

792.What is a binary form in POST methods? What is its usage?

In POST methods, the binary form is designed to send data easily in a format it is impossible to
enter data manually. This is mainly used when sending large files like images, CSV files, etc., in
the POST request. The binary representation is one of the easiest representations used for
sending complex data with the request.

Page | 200
793.What is the use of Postman cloud when we are working in a company?

The Postman cloud is a common repository of companies to access Postman collections. That is
why we use it when we are working in a company. We can save the work instantly in the
Postman cloud after logging in. It facilitates the team members to access data/collections from
anywhere.

794.What is digest auth in Postman?

The digest auth or digest authorization is one of the authorization techniques provided by
Postman. This technique lets the clients send the request first to the API and get responses from
the server, including a number that can be used only once a real value and 401 unauthorized
responses. After that, the client can send back an encrypted data array with both username and
password and the data received from the server earlier. Now, the server uses this data to generate
an encrypted data string and compares this with what was sent for authenticating the request.

795.Why is it not suggested to save work in Postman cloud?

It is not suggested and is not preferred to save your work in the Postman cloud as the company's
work is not allowed to be leaked and remain confidential. While saving your work on Postman
cloud, it may cause a security breach as it requires sign-in. That's why the Postman Cloud is not
suggested for saving work, and team workspace is highly preferred.

796. What do you understand by status code 201?

The status code 201 means created when you have successfully created a resource using POST
or PUT request. It returns a link to a newly created resource using the location header.

797.What is the procedure to remove local variables?

The local variables are automatically removed once you have executed and completed the tests.

798.What is the procedure to save the responses of API to a file in Postman?

In Postman, there are two ways to save the responses of an API to a file:

Page | 201
o First, click on the download button in the response section.
o Second, click on the arrow next to the send button. Here, you will see an option to send
and download. After clicking on it, you will get a prompt Postman asking for the location
of saving the response post successful request execution.

799.What is the meaning of the status code 304?

The status code 304 means NOT MODIFIED. It is used to minimize the network bandwidth
usage in conditional GET requests. The response body should be empty. Headers should have a
date, and location, etc.

800.What is the use of the 301 status code in Postman?

In Postman, the 301 status code is used to specify that the page has been permanently redirected
from one website page to another. It tells the search engine that the old page is outdated, and the
search engine has to index the new page URL.

801.What is the method to organize requests in Postman?

We can organize requests in Postman with the Collections.

802. What are the various variable scopes provided by Postman?

Following is a list of several variable scopes provided by Postman:

o Global Variables: Global variables allow data access between different collections,
requests, and scripts. They are available throughout the workspace.
o Local Variables: Local variables are the temporary variables that can be accessed only
within the scope of requests scripts. Depending on the requirements, these variables are
either scoped to a single request or single collection. These variables are not available
once the script execution is completed.
o Environment Variables: The Environment variables allow us to tailor the requests about
different development environments such as local testing, stage testing, or prod testing.

Page | 202
o Collection Variables: The Collection variables are independent of the environment and
scoped to be available for all the requests present within the collection.
o Data Variables: The Data variables come from external JSON or CSV files and define
the datasets required to run the collection in Collection Runner or Newman.

803.What is the difference between the form data and x-www-form-urlencoded?

The key difference between the form data and x-www-form-urlencoded is that the URL will be
prearranged when sent through x-www-form-urlencoded.

804.In which conditions should we use global, collection, and local variables?

Global variables are the general-purpose variables. They are used while passing data to other
requests and are ideal for quick results and prototyping.

Collection variables are generally used for storing some constants that do not change during the
execution of the collection. These variables are used for constants that do not change during the
execution and URLs / authentication credentials if only one environment exists.

Local variables are the temporary variables and are only available within the request that has set
them or when using Newman/Collection runner during the script execution. These variables are
used whenever we have to override all other variable scopes.

805.How can we access the history of requests in Postman?

In Postman, we can access the history of requests in the History tab provided on the Postman
application. When we sign into the Postman account, the history will be synced across the
devices where you are logged in. After clicking on any of the requests present in the History tab,
the view will open the request that we saved while working on it earlier. History also contains
the collection runs that were executed as summarized versions.

When you click on the "View More option" on the request, you will see options to save,
document, monitor, delete or mock the request. You can also select multiple requests by using
Command or Control button and then clicking on the request.

Page | 203
806.How can we stop executing requests or stop the collection run?

We can stop executing requests or stop the collection run by using the following command:

1. postman.setNextRequest(null);

807.Is it possible to reuse the authentication token for multiple requests?

Yes, it is possible to reuse the authentication token for multiple requests. We can achieve it by
creating a collection and adding all the requests having the same authentication token to that
collection and then assigning the auth token to the same collection. We can apply it to the
individual requests by selecting the "Inherit auth from parent" option in the Authorization tab.

808.Where are the query parameters stored in a GET request in Postman?

In the GET request, the query parameters are stored in the URL in Postman.

809.What is executed first in a collection run?

The pre-request scripts at the compilation level are executed first in a collection run.

810.How can we access a Postman variable?

We can access a Postman variable by entering the variable name as {{var}}.

811.Which tool can be used to run Postman collections in Jenkins?

We can use the Newman tool to run Postman collections in Jenkins.

812.What are the most commonly seen status codes in Postman?

Following is the list of most commonly seen status codes in Postman:

o 200 (OK): Status code 200 specifies that the request was correct.

Page | 204
o 201 (Created): Status code 201 specifies that the value wrapped with the request has
been created in the database. Here, it is obvious that the request was correct.
o 204 (No Content): Status code 204 specifies that the request was correct and received,
but there is no content to send. It means there is no response to send to the client by the
server.
o 400 (Bad Request): Status code 400 specifies a bad request. A bad request means that
the syntax of the request was incorrect. It appears when we have sent the wrong
parameters along with the request URL or in the request's body.
o 401 (Unauthorized request): Status code 401 specifies an unauthorized request. An
unauthorized request is a request for which you are not authorized. This status code
appears when we are not authorized to access the server or enter the wrong credentials.
o 404 (Not Found): Status code 404 specifies that the server was connected, but it could
not find what was requested. It simply means "request not found". This status code
normally appears when we request a web page not available on the server.

813.What is Scratch Pad?

Postman provides a space known as Scratch Pad. The Scratch Pad facilitates us to work without
being connected to Postman servers and also provides the flexibility to utilize some of the
features of Postman offline. These features include collection creation, creating requests, and the
ability to send requests. The Scratch Pads are stored locally, and once logged in; the work is
saved into the workspace.

814.What are the different Request Method types in Postman?

The different Request Method types in Postman are as follows:

o Get
o Post
o Put
o Delete
o Patch
o Head

Page | 205
o Delete

815.How can you iterate a request 100 times in Postman?

We can iterate a request 100 times in Postman using Collection Runner.

816.What are some examples of the JS libraries available in Postman?

Some examples of the JS libraries available in Postman are Lodash, Moment, GUID, etc.

817. What is the full form of GUID? Where is it used?

GUID is an acronym that stands for Global Unique Identifier. It is a set of hexadecimal digits
separated by hyphens and solves the purpose of uniqueness.

In Postman, it is used to generate and send a random value to APIs.

Example:

1. {
2. "id": "{{$guid}}",
3. }

818.Which programming language is used for Postman tests?

JavaScript is used for Postman tests.

819.How can you generate random numbers of a given range in Postman?

In Postman, we can generate random numbers of a given range using some script. Suppose you
want to generate numbers between the range of 1 to N, then use the following pre-request script:

1. pm.globals.set('randomNumber', Math.floor(Math.random()* N));

Now, use this variable in the URL as {{randomNumber}}

Page | 206
820.How can we view request logs and response logs in Postman?

We can view request logs and response logs in Postman through the Postman Console window.

821.What is the binary form in the Post method in Postman?

In Postman, the binary form is designed to send the information in a specific format that cannot
be entered manually. For example, images, files, etc. Everything in a computer is converted to
binary.

822. How can you organize requests in Postman?

In Postman, we can use Collections to organize requests.

823.Which method is preferred to write the tests?/ JavaScript or Functional?

The functional method is advised and recommended while writing tests in Postman. Although we
can use JavaScript methods, there has been no notice of ending the support for the JavaScript
method.

824. Name the five important principles of an API design.

The five important principles of API design are:

Setup: Create objects, start services, initialize data, etc.


Execution: Steps to apply API or the scenario, including logging
Verification: Oracles to evaluate the result of the execution
Reporting: Pass, failed, or blocked
Clean up: Pre-test state

Page | 207
825. What are the challenges faced in API testing?

The challenges faced in API testing are:

 API chaining or sequencing the API calls

 Testing parameter combinations

 Frequent Schema changes

 Access to the database

826. What is the procedure for performing API testing?

The API testing steps/procedures are:

1. Select the test case that has to be fulfilled

2. For API calls, develop a test case

3. To meet the test case, configure the API parameters

4. Determine how will you validate a successful test

5. Using programming languages like PHP or .NET, execute the API call

6. Allow the API call to return the data to validate

827. What must be checked when performing API testing?

In order to perform an API test you must check the following:

 Accuracy of data

 Schema validation

 HTTP status codes

 Data type, validations, order, and completeness

 Authorization checks

 Implementation of response timeout

 Error codes in case API returns

Page | 208
 Non-functional testing like performance and security testing

828. Name some of the common API documentation templates.

The most common API documentation templates are: Swagger, RestDoc, FlatDoc, Slate, Web
Services API Specification, API Blueprint, and Miredot.

829. What is TestApi?

TestApi is known as the library of test building blocks which are essential for developers and
testers when creating testing tools as well as automated test suites.

830. What kinds of bugs does API testing find most commonly?

The types of bugs that APIs will find are:

 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

831. Describe some of the types of status codes.

Some status codes are:

 1xx informational response – the request was received, continuing process

 2xx successful – the request was successfully received, understood, and accepted

 3xx redirection – further action needs to be taken to complete the request

 4xx client error – the request contains bad syntax or cannot be fulfilled

Page | 209
 5xx server error – the server failed to fulfill a valid request

832. What is the difference between PUT, POST, and PATCH?


PUT: Put request is used for both creating and updating a new object in the database. If the
resource already exists, then Put will update the resource. If not, it will create one.
POST: Post request is used for creating a new object in the database. It allows clients to create
resources without knowing the URI of the new resources.
PATCH: Patch is used to apply the partial modification to a resource

833. What is payload?

Payload/body is a secured input data that is sent to API to process the request. The payload is
generally constructed in JSON format in REST API.

834. How can we pass dynamic data for a request?

We can write a pre-request script to pass dynamic data or we can create a collection and pass
dynamic data using a CSV file.

835. What do you understand about browser APIs?

Browser APIs are built-in with the browsers. They enable developers to implement complex
operations without administering the sophisticated lower-level code.

836. How is restful API implemented?

The implementation consisted of running the code from the JUnit tests into the APIs and then
refreshing the tests to summon those APIs. The modifyCertificate method, which gives the
implementation for the certificates resource PUT method, is the most difficult REST API to
implement.

837. What are some key characteristics of REST?

Key characteristics of REST include:

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

Page | 210
838. What is the most popular way to represent a resource in REST?

JSON is the most popular and important way to represent resources.

839. Explain caching in Rest API.

Caching is used for network optimization by reducing the load on servers. It is the ability to store
copies of frequently accessed data. Get Requests are by default cacheable, however, Post can be
made cacheable.

840. What is a Pre-Request script in Postman?

In short, a pre-request script is a script that runs before the execution of a request.

841. What is the importance of setNextRequest in Postman?

setNextRequest is used to define the workflow of API testing. setNextRequest is needed to


control the order of the execution of requests.

842. What are the two types of scripts in Postman?

Two types of scripts in Postman are test script and pre-request script.

843. Which type of communication API works in IoT?

REST is the most popular IoT Communication APIs.

844. Define SOAP.


SOAP stands for “Simple Object Access Control,” and it is an XML based protocol for
exchanging information between computers.

845. Why is SOAP more reliable than REST?

SOAP is more reliable than REST as it practices WS-Security for transmission with Secure
Socket Layer. Also, SOAP is state-full as it takes the request as a whole, unlike REST which
gives independent processing of various methods. No independent processing is present in
SOAP.

846. What is the major drawback of using SOAP?

When using SOAP, users often experience firewall security mechanisms as the biggest obstacle.
This blocks all the ports, leaving a few like HTTP port 80 and the HTTP port used by SOAP that
bypasses the firewall. The technical complaint against SOAP is that it mixes the specification for
message transport with the specification for message structure.

Page | 211
847. Can we automate API testing?

Yes, we can automate API testing by using automation testing tools for API testing.

848. Is JMeter good for API testing?

Yes, JMeter is good for API testing, especially REST API. JMeter is an open source tool used for
performance or load testing.

849. Can GET request be used instead of PUT to create a resource?

The PUT or POST method should be used to create a resource. GET is only used to request data
from a specified resource.

850. What is URI? What is the main purpose of REST-based web services and what is its
format?
URI stands for Uniform Resource Identifier. It is a string of characters designed for
unambiguous identification of resources and extensibility via the URI scheme.

The purpose of a URI is to locate a resource(s) on the server hosting of the web service.

A URI’s format is <protocol>://<service-name>/<ResourceType>/<ResourceID>.

851. What are the syntax rules for a SOAP message?

The syntax rules for a SOAP message include the following:

 Must use encoded XML

 Envelope namespace must be used

 Encoding namespace must be used

 Must not consist of a DTD reference

 Must not have XML processing instruction

852. What is Run Scope?

Run Scope is an API testing tool that is typically a web application supporting an easier user
interface platform to test back-end services.

Page | 212
853. Is it possible to hack API while testing?

Yes, it is possible. This is because we are sending requests over the internet which mostly
follows HTTP protocol. This protocol is text-based and is easier to read. Hence, it is required to
perform security testing of the APIs to ensure safer systems.

854. How should we test the API security?

To test the security of the API during API testing, we need to validate two components:

1. Authentication: Whether the identity of the end-user is correct


2. Authorization: Whether the user is allowed to access the resource
We can also validate whether the TLS or the SSL certificate used over the HTTPS protocol is
valid or not.

855. What helps hide the distinction between different micro-services?


The API Gateway hides the distinction between different micro-services.

856. What is the most commonly used command-line tool to explore API?
The most commonly used command-line tool to explore API is cURL.

857. When a user attempts to access records that do not belong to them, what should the API
return in the response status code?
The API should return the 401 status code.

858. What is the kind of API traffic that is internal to the organization?
The Internal Traffic is internal to the organization.

859 Which among the following options is used for requesting JSON instead of XML from
API?

The Use Accept Header would be used for requesting JSON instead of XML with API.

860. Which options help to identify the type of API requests?

The HTTP Methods help identify the type of API requests.

861. What category does API testing belong to?

API testing is generally black-box testing. We don't look at what happens behind the API server.
We only validate the responses.

Page | 213
862. Which markup language can be used in Restful Web API?
JSON and XML are the two markup languages that can be used in Restful Web API.

863. What is the upper limit for a payload to pass in the POST method?

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

864. What is REST?


Answer: REST stands for Representational State Transfer, and is an architectural style based on
the Hypertext Transfer Protocol (HTTP) for developing web-based applications.

REST outlines several guidelines that web services must follow to be considered RESTful. These
guidelines ensure that requests and resources are sent easily and efficiently between client and
server using standardized HTTP methods.

865. What is a REST API?


Answer: An application programming interface is a software-to-software interface that allows
otherwise separate applications to interact and share data. For example, a news website
could leverage the Twitter API to automatically find relevant tweets and include them in news
articles.

A REST API, also called a RESTful API, is an API that follows REST principles. In a REST
API, all data are treated as resources, each one represented by a unique uniform resource
identifier (URI). For example, the Twitter API makes each tweet an available resource that can
be retrieved by clients. Clients can also use Twitter’s API to post tweets and perform other
actions on the site.

866. What are the principles of REST?


Answer: REST APIs must adhere to five requirements:
 Client-server decoupling: The client and server can only interact in a series of requests and
responses. Only clients can make requests, and only servers can send responses. This simple
principle allows both parties to operate independently of each other.
 Uniform interface: All communications between the client and server must follow the same
protocol. For REST, this protocol is HTTP. A uniform interface simplifies integrations because
every application is using the same language to request and send data.

Page | 214
 Stateless: In stateless communication, the server does not store any information about past
requests/responses. Each request and response contains all information needed to complete the
interaction. Stateless communication reduces server load, saves memory, and improves
performance. It also eliminates the possibility of a failed request caused by missing data.
 Layered system: Layers are servers that sit between the client and API server. These additional
servers perform various functions, like identifying spam and improving performance (See
also: What Is a CDN?). In REST, layers are modular and can be added and removed without
affecting the messages between the client and the API server.
 Cacheable: Server responses indicate whether or not the resource is cacheable, so that clients
can cache any resources to improve performance.

Additionally, REST includes one optional condition:

 Code on demand: An API can send executable computer code to clients in its response. This
lets the client application run the code in its own back end.

867. What does it mean for an API to be stateless?


Answer: Statelessness is one of the key principles of REST architecture. In stateless
communication, the server does not store any information about previous communications. In
other words, the client and server do not know each other’s state. Every request and response is a
new interaction, and each request includes everything the server needs to give a successful
response.

Statelessness simplifies client-server interactions because the server does not rely on past
requests to process future requests, and thus does not need to consume space and resources
storing data from these requests.

868. Which protocol do REST APIs use?


Answer: REST APIs use the HTTP protocol to communicate with clients. This allows REST
APIs to be easily deployed over the internet, since HTTP is the same protocol that is used to
deliver web pages to client browsers.

869.What is messaging in the context of REST?


Answer: In REST, messaging refers to the back-and-forth communication between the client
and API. An interaction always starts with the client messaging the API with an HTTP request.
The API processes this request, then sends back an HTTP response that gives the status of the
request and any resources the client asked for.

870. What are the main parts of an HTTP request?


Answer: HTTP requests are sent by the client to the API. They request data or perform some
action on the server. There are five main components of an HTTP request in REST:
 Start line: Indicates the intended action of the request and includes:

Page | 215
o a request method that indicates the HTTP request method to be performed on the resource (i.e.,
GET, POST, PUT, DELETE).
o a URI that identifies the requested resource on the server.
o the HTTP version being used, which signals which version the API should respond with.
 HTTP Request Header: Lists metadata about the request, such as the user agent, file formats
the client will accept, format of the request body, language, caching preferences, etc.
 HTTP Request body: Contains any data associated with the request. This is only necessary if
the request is to modify data on the server with the POST or PUT methods.

871. What are the main parts of an HTTP response?


Answer: HTTP responses are sent by the API to the client. They inform the client that the
requested action was (or was not) completed and to deliver any requested resources. There are
four main components of an HTTP response:
 HTTP version: The version of HTTP version used.
 Status line: Indicates the status of the request with an HTTP response status code.
 HTTP Response Header: Lists metadata about the response, such as the date, server, user
agent, file formats of the returned resources, caching information, etc.
 HTTP Response body: Contains the resource data that was requested by the client, and is also
called the payload.
872. What are some common HTTP response status codes you might see when working
with a REST API?
Answer: HTTP response status codes tell the client the result of the requested action (GET,
POST, etc.). Some common codes you’ll see in HTTP responses are:
 200 OK: The request succeeded.
 201 Created: The request succeeded and a resource was created.
 400 Bad Request: The request was not fulfilled due to an error in the request, such as a typo or
missing data.
 401 Unauthorized: The request was not fulfilled because the client is not authenticated or
authorized to access the requested resource.
 403 Forbidden: The request was not fulfilled because the client is authenticated, but not
authorized to access the requested resource.
 404 Not Found: The request was not fulfilled because the server could not locate the requested
resource.
 500 Internal Server Error: The request was not fulfilled due to an unexpected problem with the
server. (See also: 500 Internal Server Errors: What They Are & How to Fix Them)
 502 Bad Gateway: The request was not fulfilled due to an invalid response from an upstream
server.
 503 Service Unavailable: The server was unable to process the request due to maintenance,
overloading, or another temporary interference.

Page | 216
873. What is a resource?
Answer: In REST, every accessible piece of content on the server is labeled as a resource. A
resource is an object with a type, associated data, a relationship with other resources on the
server, and a list of methods that can be used with it. For example, a resource could be an HTML
or text file, a data file, an image or video, or an executable code file.

A resource is identified with a uniform resource identifier, or URI. Clients access resources by
including their URIs in HTTP requests.

874. What is a URI?


Answer: URI stands for uniform resource identifier. In REST, a URI is a string that identifies a
resource on a web server. Each resource has its own unique URI which, when included in an
HTTP request, allows clients to target that resource and perform actions on it. The process of
targeting a resource with its URI is called “addressing.”

The format of a URI is as follows:

<protocol>://<service-name>/<ResourceType>/<ResourceID>
875. What is caching?
Answer: Caching is the method of temporarily storing a copy of a server response in a location
(like computer memory) in order to retrieve it more quickly in the future.

When working with REST APIs, Caching improves server performance by reducing the work the
server has to do to fulfill the request. Caching also makes applications that use the API run faster
since they don’t need to send a new request every time they need a resource.

Cache duration of a resource (i.e., how long the resource can be cached by the client before the
resource is retrieved again) is specified in the HTTP response header with the Cache-
Control field.

876. What’s a real-world example of a REST API?


Answer: Here are some examples of REST APIs in use:

 Twitter allows publishing sites to pull information like tweets, users, tweet streams, and so on.
Developers can also write programs to post tweets through the API instead of the website
interface.

 Airlines expose their flight times and prices through APIs so travel and ticketing sites can use
them.

 To display weather information, weather apps harness public APIs that share weather data.

Page | 217
 Public transportation services usually make their data publicly in real-time via APIs so that
mapping and navigation apps (like Google Maps) can use them.

 In turn, Google Maps hosts several APIs that make its mapping data available to developers.
Developers leverage these APIs to palace dynamic maps on their websites or in their apps.

877. What is the difference between REST and SOAP?


Answer: REST and SOAP (Simple Object Access Protocol) are two different approaches to
building APIs. Here are the key differences between them:

 SOAP is a strict protocol for building secure APIs. REST is not a protocol — it is an
architectural style dictated by a set of guidelines (see question 3).

 REST APIs are simpler to build, more lightweight, and generally faster than SOAP APIs.

 SOAP APIs are considered more secure than REST APIs, though REST APIs can still
implement safety features to make them reasonably secure.

 REST allows caching of responses, whereas SOAP does not.

 SOAP encodes data in XML format. REST allows you to encode data in any format, though
XML and JSON are most popular.
878. What is the difference between REST and AJAX?
Answer: Asynchronous JavaScript, or AJAX, is a set of web development techniques used in
web applications. At its core, AJAX allows a web page to make requests to a server and update
the page interface without needing to refresh.

An AJAX client might utilize REST APIs with its requests, but AJAX doesn’t have to work with
REST APIs exclusively. REST APIs can communicate with any client, whether the client uses
AJAX or not.

Also, unlike REST which uses HTTP requests and responses for messaging, AJAX sends its
requests to the server with the XMLHttpRequest object that is built into JavaScript. Server
responses are executed by the page’s JavaScript code to alter the page content.
879. What are some benefits of REST?
Answer: REST is by far the most common method for building web APIs. Here are some
reasons why:

 REST is based around HTTP and fits within the existing infrastructure of the web, making it
easy to implement by web applications.

 REST uses simple web technologies like XML and JSON, making it easy to learn.

 Because REST communications are stateless, the client and server are decoupled. This means
that integrations are scalable and easy to build and manage over time.

Page | 218
 The REST architecture is flexible enough to adapt to a huge variety of use cases.
 REST is a lightweight architecture. Applications built with REST are generally faster than those
built with other types of APIs.

 REST is easy to test in the browser with an API testing tool.


880. What are some drawbacks of REST?
Answer: While statelessness is a benefit of REST, it can sometimes be a disadvantage too.
REST does not preserve state. In other words, the server does not keep records of past
interactions. If preserving state is necessary, that responsibility falls on the client.

Additionally, REST is less strict with its security measures than SOAP, so developers need to be
cautious and only work with APIs from legitimate, reputable providers. It also makes REST a
poor choice for sending confidential information between servers and clients.
881. How do you test APIs?
Answer: There are many software tools designed for testing RESTful APIs — Postman, JMeter,
and Katalon Studio are a few. The testing process usually involves sending various requests from
your testing tool and monitoring how your API responds. Many testing tools also support
automated testing, allowing you to run many different scenarios quickly.
To learn more about how API testing works and what kinds of tests you can run, see our guide to
API testing.
882. How do you keep REST APIs secure?
Answer: REST APIs do not employ as strict security measures as SOAP APIs, and therefore
should not be used to send or retrieve sensitive information. However, good REST APIs still
implement safety measures for secure and reliable data transfers.
 Authentication and authorization: All requests to the API should be authenticated and
authorized. Authentication is the process of verifying the identity of the client, and authorization
is confirming that the client has permission to access the requested resources.
 Validation: After authentication and authorization, requests still need to be scanned for
potentially malicious code before the API gives access to its resources. Otherwise, a server will
be vulnerable to an injection attack.
 Encryption: TLS/SSL encryption secures the connection between client and server and
prevents attackers from intercepting requests and responses.
 Rate-limiting: Rate-limiting methods like quotas and throttling prevent brute-force attacks
like DDoS that attempt to slow or crash the server.
 No sensitive information in URIs: Protected information (e.g., username, password, or
authentication token) should not be visible in the URI of a resource.
For more in-depth explanations, see our post on API security.
883. What are some main characteristics of REST?
Answer: If you’re asked to point out the main features that distinguish REST APIs from others,
here are some points to touch on:

 REST uses the HTTP protocol for communication.

 REST makes server resources available via URIs. Each resource has a unique URI.

Page | 219
 REST is stateless, meaning the server does not store information about past communications
with clients.

 REST uses GET to retrieve resources from a server, whereas other web service methods use
POST.

884.Why do we use Postman?


Here are some most prominent reasons for using Postman:

 It is free to use software which is helpful for API testing


 It helps you to manage the end-to-end lifecycle of API
 It offers Runtime Service that helps manage API collections, workspaces, environments,
and different examples.
 You can also integrate Postman with CI/CD tools like Circle CI, Jenkins, etc.
 It has a vast community forum that can easily address any technical issues you face while
using the tool.

885.What is a binary form in POST methods?


Post binary firm is designed to send the information in a format that is impossible to enter
manually. These options are used while sending larger files like CSV files, etc.

886.What is a Pre-Request script?


Pre-request scripts help you to execute JavaScript before a request runs. It allows you to
accomplish pre-processing tasks like setting variable values, parameters, headers, and body data.

887. Why does Postman never accepts any other encoding apart from Base64?
You can use base64 as it helps us transmit the data into the textual form and send it as HTML
form data. Moreover, we must rely upon the same 64 characters in any encoding language.

888.Which kind of encoding does Postman accepts for authorization credentials?


Postman only accepts Base64 encoding, which is provided inbuilt in Postman. Otherwise, it
would benefit when you use 3rd party websites that help you to convert the credentials into
base64.

Page | 220
889. What is the Postman execution order for a collection?
For all the requests in a collection, the scripts will execute in the following given order:

Step 1) A pre-request script associated with a collection will run before every request.
Step 2) A pre-request script associated with a folder will run before every request in a specific
folder.
Step 3) A test script associated with a collection will run after every request.
Step 4) A test script associated with a folder will run after the request in the specific folder.

890.Can you have two global scope variables with the same name in Postman?
No, the global scope never has duplicate/same names, while variables having local scope can
have the same name in various environments.

891.How can you use POSTMAN to generate random numbers in a specific range?
In your Pre-request script define your variable with:

pm.globals.set('randomNum', Math.floor(Math.random() * 5));


Then in your URL call your variable in the URL like so:
Output:

{{randomNum}}

892.,How do you remove local variables?


Local variables are automatically removed once the tests have been executed.

893. Why saving your work in the Postman cloud is not advisable?
You should not save your work in Postman as your business details do not remain confidential.
Moreover, saving your on-Postman cloud may cause a security breach as it requires sign-in.
Therefore, saving your work in the Postman cloud is not advisable.

894.How are Query Parameters different from Path Variables?


In Postman, Path Variables are used to identify specific resources, and Query Parameters are
used to sort or filter the resources.

895.What are the main drawbacks of Postman?

Here are some cons/ disadvantages of using Postman:

 Postman cannot process more than 1000 API requests.


 It is not easy to manage the collections and requests in a massive size project.

Page | 221
 Postman is not an ideal API tool for workspace management in the form of code as there
can be lots of code duplication while handing the dynamic API requests.

896. What would happen if {{$randomInt}} dynamic variable is added?


You need to add a random integer between 0 and 1000.

897.Can you read the Postman Chrome application to read and write cookies?
No, it is impossible to read and write cookies using the app.

898.Which programming language is used for Postman tests?

JavaScript is used for Postman tests.

899.Which tool can be used to run Postman Collections in Jenkins?


Newman can be used to run Postman Collection in Jenkins.

Page | 222
Basic GIT Interview Questions

900. What is a version control system (VCS)?

A VCS keeps track of the contributions of the developers working as a team on the projects.
They maintain the history of code changes done and with project evolution, it gives an upper
hand to the developers to introduce new code, fixes bugs, and run tests with confidence that
their previously working copy could be restored at any moment in case things go wrong.

885.What is a git repository?

A repository is a file structure where git stores all the project-based files. Git can either stores
the files on the local or the remote repository.

901. What does git clone do?

The command creates a copy (or clone) of an existing git repository. Generally, it is used to get
a copy of the remote repository to the local repository.

902. What does the command git config do?

The git config command is a convenient way to set configuration options for defining the
behavior of the repository, user information and preferences, git installation-based
configurations, and many such things.

For example:
To set up your name and email address before using git commands, we can run the below
commands:

 git config --global


user.name
“<<your_name>>”

 git config --global user.email “<<your_email>>”

Page | 223
903. Can you explain head in terms of git and also tell the number of heads that can be
present in a repository?

 A head is nothing but a reference to the last commit object of a branch.


 For every repository, there will always be a default head referred to as “master” or now “main”
(as per GitHub) but there is no restriction to the count of heads available. In other words, it can
have any number of heads.
 Usages:

- To go or checkout to 1 commit before the latest commit, we use git checkout HEAD~1

- To uncommit the last 3 commits without losing the changes, we first run git reset HEAD~3.
Then we can see the changes made in the last 3 commits and then update it manually and
commit it finally.

- In order to uncommit the last 3 commits and also remove the changes, we can run the
command: git reset --hard HEAD~3. This command will completely remove all the changes.

- To look into the changes made in the last 3 commits, we can run git diff HEAD~3

- To make a new commit by reverting the last 3 commits, we can run the command: git revert -
-no-commit HEAD~3...HEAD

904. What is a conflict?

 Git usually handles feature merges automatically but sometimes while working in a team
environment, there might be cases of conflicts such as:

1. When two separate branches have changes to the same line in a file
2. A file is deleted in one branch but has been modified in the other.

 These conflicts have to be solved manually after discussion with the team as git will not be
able to predict what and whose changes have to be given precedence.

905. What is the functionality of git ls-tree?

This command returns a tree object representation of the current repository along with the
mode and the name of each item and the SHA-1 value of the blob.

906. What does git status command do?

git status command is used for showing the difference between the working directory and the
index which is helpful for understanding git in-depth and also keep track of the tracked and
non-tracked changes.

Page | 224
907. Define “Index”.

Before making commits to the changes done, the developer is given provision to format and
review the files and make innovations to them. All these are done in the common area which is
known as ‘Index’ or ‘Staging Area’.

In the above image, the “staged” status indicates the staging area and provides an opportunity
for the people to evaluate changes before committing them.

908. What does git add command do?

 This command adds files and changes to the index of the existing directory.

 You can add all changes at once using git add . command.

 You can add files one by one specifically using git add <file_name> command.

 You can add contents of a particular folder by using git add /<folder_name>/ command.

Intermediate GIT Interview Questions

909. Why is it considered to be easy to work on Git?

With the help of git, developers have gained many advantages in terms of performing the
development process faster and in a more efficient manner. Some of the main features of git
which has made it easier to work are:

 Branching Capabilities:

- Due to its sophisticated branching capabilities, developers can easily work on multiple
branches for the different features of the project.
- It also has an easier merge option along with an efficient work-flow feature diagram for
tracking it.

 Distributed manner of development:

- Git is a distributed system and due to this nature, it became easier to trace and locate data if
it's lost from the main server.
- In this system, the developer gets a repository file that is present on the server. Along with
this file, a copy of this is also stored in the developer’s system which is called a local
repository.
- Due to this, the scalability of the project gets drastically improved.

 Pull requests feature:

- This feature helps in easier interaction amongst the developers of a team to coordinate merge-

Page | 225
operations.
- It keeps a proper track of the changes done by developers to the code.

 Effective release cycle:

- Due to the presence of a wide variety of features, git helps to increase the speed of the release
cycle and helps to improve the project workflow in an efficient manner.

910. How will you create a git repository?

 Have git installed in your system.


 Then in order to create a git repository, create a folder for the project and then run git init.
 Doing this will create a .git file in the project folder which indicates that the repository has
been created.

911. Tell me something about git stash?

Git stash can be used in cases where we need to switch in between branches and at the same
time not wanting to lose edits in the current branch. Running the git stash command basically
pushes the current working directory state and index to the stack for future use and thereby
providing a clean working directory for other tasks.

912. What is the command used to delete a branch?

 To delete a branch we can simply use the command git branch –d [head].
 To delete a branch locally, we can simply run the command: git branch -d
<local_branch_name>
 To delete a branch remotely, run the command: git push origin --delete
<remote_branch_name>
 Deleting a branching scenario occurs for multiple reasons. One such reason is to get rid of the
feature branches once it has been merged into the development branch.

913. What differentiates between the commands git remote and git clone?

git remote command creates an entry in git config that specifies a name for a particular URL.
Whereas git clone creates a new git repository by copying an existing one located at the URL.

914. What does git stash apply command do?

 git stash apply command is used for bringing the works back to the working directory from the
stack where the changes were stashed using git stash command.
 This helps the developers to resume their work where they had last left their work before
switching to other branches.

Page | 226
915. Differentiate between git pull and git fetch.
git pull git fetch

This command is also used for a similar purpose


but it follows a two step process:
1. Pulls all commits and changes from desired
This command pulls new changes from the branch and stores them in a new branch of the
currently working branch located in the local repository.
remote central repository. current
2. For changes to be reflected in the current /
target branch, git fetch should be followed by git
merge command.

git pull = git fetch + git merge

915. Can you give differences between “pull request” and “branch”?
pull request branch

This process is done when there is a need to put a developer’s A branch is nothing but a
change into another person’s code branch. separate version of the code.

916. Why do we not call git “pull request” as “push request”?

 “Push request” is termed so because it is done when the target repository requests us to push
our changes to it.
 “Pull request” is named as such due to the fact that the repo requests the target repository to
grab (or pull) the changes from it.

917. Can you tell the difference between Git and GitHub?
Git GitHub

This is a distributed version control system installed on


This is a cloud-based source code
local machines which allow developers to keep track of
repository developed by using git.
commit histories and supports collaborative work.

This is maintained by “The Linux Foundation”. This was acquired by “Microsoft”

GitLab, Atlassian BitBucket, etc are


SVN, Mercurial, etc are the competitors
the competitors.

 GitHub provides a variety of services like forking, user management, etc along with providing
a central repository for collaborative work.
Page | 227
918. What do the git diff and git status commands do?
git diff git status

This shows the changes between This shows the difference between the working directory
commits, working trees, etc. and index that is essential in understanding git in depth.

 git diff works in a similar fashion to git status with the only difference of showing the
differences between commits and also between the working directory and index.

919. What has to be run to squash multiple commits (last N) into a single commit?

Squashing multiple commits to a single one overwrites the history which is why it is
recommended to be done using full caution. This step can be done by running the
command: git rebase -i HEAD~{{N}} where {{N}} represents the number of commits needed
to be squashed.

920. How would you recover a branch that has already pushed changes in the central
repository but has been accidentally deleted from every team member’s local machines?

We can recover this by checking out the latest commit of this branch in the reflog and then
checking it out as a new branch.

921. Can you tell something about git reflog?

This command tracks every single change made in the repository references (that can be
branches or tags) and also maintains the branches/tags log history that was either created
locally or checked out. Reference logs such as the commit snapshot of when the branch was
created or cloned, checked-out, renamed, or any commits made on the branch are maintained
by Git and listed by the ‘reflog’ command.

 This recovery of the branch is only possible when the branch was either created locally or
checked-out from a remote repository in your local repository for Git to store its reference
history logs.
 This command should be executed in the repository that had the lost branch.

921. What consists of a commit object?

A commit object consists of the following components:

 A set of files that represents the state of a project at a given point in time.
 Reference to parent commit objects.
 A 40 character string termed as SHA-1 name uniquely identifies the commit object.

Page | 228
922. Explain the levels in git config and how can you configure values using them?

 In order to make git work, it uses a set of configurations that are pre-defined by default by
means of configuration files (or config files). We can change the default behavior of git by just
modifying these files which are basically text files. In order to do this, it is important to
understand how git identifies these files. It does so by following the below steps:

- Firstly, git searches for the config values in the system-wide gitconfig file stored
in <<installation_path>>/etc/gitconfig file that has settings defined and applied to every
user of the system and all their repos.
- In case you want git to search from this particular file and read/write on it, we can pass the
option --system to git config command.

- Next, git searches for the ~/.gitconfig file or ~/.config/git/config that has the scope specific to
the user.
- Git can be made to read/ write from this file specifically bypassing --global to the git config
command.

- Lastly, git searches for the config values in the git directory of the local repository that we are
currently working on.
- These config values are specific to that particular repository alone and can be accessed by
passing --local to the git config command.This is the default config file that gets accessed and
modified upon in case we do not specify any levels.

923. What is a detached HEAD and what causes this and how to avoid this?

Detached HEAD indicates that the currently checked-out repository is not a local branch. This
can be caused by the following scenarios:

 When a branch is a read-only branch and we try to create a commit to that branch, then the
commits can be termed as “free-floating” commits not connected to any branch. They would be
in a detached state.
 When we checkout a tag or a specific commit and then we try to perform a new commit, then
again the commits would not be connected to any branch. When we now try to checkout a
branch, these new commits would be automatically placed at the top.

In order to ensure that detached state doesn't happen, =instead of checking out commit/tag, we
can create a branch emanating from that commit and then we can switch to that newly created
branch by using the command: git checkout -b <<new_branch_name>>. This ensures that a
new branch is checkout out and not a commit/tag thereby ensuring that a detached state
wouldn't happen.

Page | 229
924. What does git annotate command do?

 This command annotates each line within the given file with information from the commit
which introduced that change. This command can also optionally annotate from a given
revision.
 Syntax: git annotate [<options>] <file> [<revision>]
 You can get to learn more about this command from the official git documentation here.

925. What is the difference between git stash apply vs git stash pop command?

 git stash pop command throws away the specified stash (topmost stash by default) after
applying it.
 git stash apply command leaves the stash in the stash list for future reuse. In case we wanted to
remove it from the list, we can use the git stash drop command.

git stash pop = git stash apply + git stash drop

Advanced GIT Interview Questions

926. What command helps us know the list of branches merged to master?

 git branch --merged helps to get the list of the branches that have been merged into the current
branch.
 Note: git branch --no-merged lists the branches that have not been merged to the current
branch.

927. How will you resolve conflict in Git?

 Conflicts occur whenever there are multiple people working on the same file across multiple
branches. In such cases, git won't be able to resolve it automatically as it is not capable of
deciding what changes has to get the precedence.
 Following are the steps are done in order to resolve git conflicts:
1. Identify the files that have conflicts.
2. Discuss with members who have worked on the file and ensure that the required changes are
done in the file.
3. Add these files to the staged section by using the git add command.
4. Commit these changes using the git commit command.
5. Finally, push the changes to the branch using the git.

928. What is best advisable step in cases of broken commit: Create an additional commit
OR amend an existing commit?

 It is always advisable to create an additional commit rather than amending the existing commit
due to the following reasons:
- Doing the amend operation destroys the previously saved state of that commit. If only the

Page | 230
commit message gets changes or destroyed, it's acceptable but there might be cases when the
contents of the commits get amended. This results in the loss of important information
associated with the commit.
- Over usage of git commit --amend can have severe repercussions as the small commit amend
can continue to grow and gather unrelated changes over time.

929. How to revert a bad commit which is already pushed?

There can be cases where we want to revert from the pushed changes and go back to the
previous version. To handle this, there are two possible approaches based on the situations:

 Approach 1: Fix the bad changes of the files and create a new commit and push to the remote
repository. This step is the simplest and most recommended approach to fix bad changes. You
can use the command: git commit -m "<message>"
 Approach 2: New commit can be created that reverts changes done in the bad commit. It can
be done using git revert <name of bad commit>

930. What is the functionality of “git cherry-pick” command?

This command is used to introduce certain commits from one branch onto another branch
within the repository. The most common use case is when we want to forward- or back-port
commits from the maintenance branch to the development branch.

931. Explain steps involved in removing a file from git index without removing from the
local file system?

 Sometimes we end up having certain files that are not needed in the git index when we are not
being careful while using the git add command. Using the command git rm will remove the file
from both the index and the local working tree which is not always desirable.

 Instead of using the git rm command we can use the git reset command for removing the file
from the staged version and then adding that file to the .gitignore file to avoid repeating the
same mistake again.

git reset <file_name> # remove file from index


echo filename >> .gitingore # add file to .gitignore to avoid mistake repetition.

932. What are the factors involved in considering which command to choose among: git
merge and git rebase?

Both these commands ensure that changes from one branch are integrated into another branch
but in very different ways. Git rebasing can be thought of as saying to use another branch as a
new base for the work.

 Whenever in doubt, it is always preferred to use the git merge command.

Page | 231
Following are some factors that tell when to use merge and rebase commands:

 In case our branch gets contributions from other developers outside the team as in open-source
or public repositories, then rebase is not preferred.
- This is because rebase destroys the branch and it results in broken and inconsistent
repositories unless the git pull --rebase command is used.
 Rebase is a very destructive operation. If not applied correctly, it results in loss of committed
work which might result in breaking the consistency of other developer’s contribution to the
repository.
 If the model of having branches per feature is followed, rebasing is not a good idea there
because it keeps track of related commits done by the developers. But in case the team follows
having branches per developer of the team, then the branch has no additional useful
information to be conveyed. In this model, rebasing has no harm and can be used.
 If there is any chance where there might be a necessity to revert a commit to previous commits,
then reverting a rebase would be almost impossible as the commit data would be destroyed. In
such cases, the merge can be used.

933. How do you find a commit which broke something after a merge operation?

 This can be a time-consuming process if we are not sure what to look at exactly. Fortunately,
git provides a great search facility that works on the principle of binary search as git-
bisect command.
 The initial set up is as follows:

git bisect start # initiates bisecting session


git bisect bad # marks current revision as bad
git bisect good revision # marks last known commit as good revision

 Upon running the above commands, git checks out a revision that is labeled as halfway
between “good” and “bad” versions. This step can be run again by marking the commit as
“good” or “bad” and the process continues until the commit which has a bug is found.

934. What are the functionalities of git reset --mixed and git merge --abort?

 git reset --mixed command is used for undoing changes of the working directory and the git
index.
 git merge --abort command is used for stopping the merge process and returning back to the
state before the merging occurred.

Page | 232
935. Can you tell the differences between git revert and git reset?
git revert git reset

This command is used for creating a new commit This command is used for undoing the local
that undoes the changes of the previous commit. changes done in the git repository

Using this command adds a new history to the This command operates on the commit
project without modifying the existing history history, git index, and the working directory.

Page | 233
Jenkins Interview Questions For Freshers

936. What is Jenkins?

Jenkins is a self-contained, open-source automation server that can be used to automate all
sorts of tasks related to building, testing, and delivering or deploying software. Jenkins can be
installed through native system packages, Docker, or even run standalone by any machine with
a Java Runtime Environment (JRE) installed.

937. Tell me something about Continuous Integration, Continuous Delivery, and


Continuous Deployment?

Continuous Integration: A software development process where the changes made to


software are integrated into the main code as and when a patch is ready so that the software
will be always ready to be - built, tested, deployed, monitored - continuously.

Continuous Delivery: This is a Software Development Process where the continuously


integrated (CI) changes will be tested & deployed continuously into a specific environment,
generally through a manual release process, after all the quality checks are successful

Continuous Deployment: A Software Development practice where the continuously


integrated (CI) changes are deployed automatically into the target environment after all the
quality checks are successful

Based on the level of automation, the above three paradigms can be better represented as below
-

CI/CD and Continuous Deployment

938. What are the common use cases Jenkins is used for?

Jenkins being open-source automation can be used for any kind of software-based automation.
Some of the common use-cases include but not limited to -

 Software build jobs


 Sanity/Smoke/CI/Regression test jobs
 Web/Data Scraping related jobs
 Code coverage measurement jobs
 General-purpose automation
 Reverse Engineering jobs
 Key Decoding jobs & many other jobs where software automation will be applicable.

Page | 234
939. What are the ways to install Jenkins?

Jenkins can be installed using -

1. Native System Package Manager like - apt (Linux), brew (Mac), etc.
2. Docker (popular docker images for Jenkins is available for different platforms like
Unix/Mac/Windows in the docker registry)
3. Kubernetes (available as a helm chart and can be installed on our Kubernetes clusters)
4. Standalone (on any machine with a Java Runtime Environment installed)

For more detailed installation instructions refer official documentation

940. What is a Jenkins job?

A Job/Project is the fundamental unit of a logical work (like a software build, an automation
task, test execution, etc) using the Jenkins automation server and other required plugins,
configurations & infrastructures.

Jobs can be of different types like - a freestyle project, a multi-configuration project, a pipeline
project, a multi-branch project, etc

941. What is a Jenkins Pipeline?

Jenkins Pipeline

The pipeline is a special type of Jenkins job - simply a sequence of steps controlled by a
defined logic - which Orchestrates long-running activities that can span across multiple build
agents. It is suitable for building pipelines (formerly known as workflows) and/or organizing
complex activities that cannot be easily achieved using a freestyle job.

Understand how to create your first pipeline here

942. What are the types of Jenkins pipelines?

Jenkins Pipelines can be either - a Declarative pipeline or a Scripted Pipeline. Declarative


pipeline makes use of numerous, generic, predefined build steps/stages (i.e. code snippets) to
build our job according to our build/automation needs whereas, with Scripted pipelines, the
steps/stages can be custom-defined & used using a groovy syntax which provides better control
& fine-tuned execution levels.

Page | 235
943. Explain Jenkins Multibranch Pipeline?
Jenkins Multibranch Pipeline

It is a pipeline job that can be configured to Create a set of Pipeline projects according to the
detected branches in one SCM repository. This can be used to configure pipelines for all
branches of a single repository e.g. if we maintain different branches (i.e. production code
branches) for different configurations like locales, currencies, countries, etc.

944. How do you store credentials in Jenkins securely?

Credentials can be stored securely in Jenkins using the Credentials plugin, which stores
different types of credentials like - Username with a password, SSH username with the private
key, AWS Credentials, Jenkins Build Token, Secret File/Text, X509 & other certificates, Vault
related credentials securely with proper encryption & decryption as and when required.

945. How can we stop a scheduled job from being executed temporarily?

Disable the job from the job details page to temporarily stop all scheduled executions & other
factors/events from triggering the job and enable it back to resume the job schedules/triggers.
If a job is not required permanently, we can delete the job from the jobs list view page.

Intermediate Questions

946. What are the ways to trigger a Jenkins Job/Pipeline?

There are many ways we can trigger a job in Jenkins. Some of the common ways are as below
-

 Trigger an API (POST) request to the target job URL with the required data.
 Trigger it manually from the Jenkins web application.
 Trigger it using Jenkins CLI from the master/slave nodes.
 Time-based Scheduled Triggers like a cron job.
 Event-based Triggers like SCM Actions (Git Commit, Pull Requests), WebHooks, etc.
 Upstream/Downstream triggers by other Jenkins jobs.

947. What is Jenkins Build Cause?

Build Cause is a text attribute that represents what made a job's build to be triggered, say it
could be a Jenkins User (from UI), Timer for Scheduled jobs, Upstream jobs for a job which
was triggered by upstream job, etc. This is mainly used to identify the nature of the builds - be
it nightly, manual, automated, etc.

Page | 236
948. How Jenkins knows when to execute a Scheduled job/pipeline and how it is
triggered?

Jenkins master will have the cron entries set up for the jobs as per the scheduled Job's
configurations. As and when the time for a particular job comes, it commands agents (based on
the configuration of the job) to execute the job with required configurations.

949. What are the credential types supported by Jenkins?

In Jenkins, credentials are a set of information used for authentication with internal/external
services to accomplish an action. Jenkins credentials are provisioned & managed by a built-in
plugin called - Credentials Binding - plugin. Jenkins can handle different credentials as follows
-

 Secret text - A token such as an API token, JSON token, etc.


 Username and password - Basic Authentication can be stored as a credential as well.
 Secret file - A secret file used to authenticate some secure data services & security handshakes.
 SSH Username with a private key - An SSH public/private key pair for Machine to Machine
authentication.
 Certificate - a PKCS#12 certificate file and an optional password.
 Docker Host Certificate Authentication credentials.

And as we can guess, this can be extended to several other extensible credential types like -
AWS credential, Azure secrets, etc. using commonly available plugins.

950. What are the Scopes of Jenkins Credentials?

Jenkins credentials can be of one of the two scopes - Global & System

Global - the credential will be usable across all the jobs configured in the Jenkins instance (i.e.
for all jobs). This is more suited for user Jobs (i.e. for the freestyle, pipeline, or other jobs) to
authenticate itself with target services/infrastructures to accomplish the purpose of the job)

System - This is a special scope that will allow the Jenkins itself (i.e. the core Jenkins
functionalities & some installed plugins) to authenticate itself to external
services/infrastructures to perform some defined tasks. E.g. sending emails, etc.

951. What is a Jenkins Shared Library and how it is useful?

As an organization starts using more and more pipeline jobs, there is a chance for more and
more code being duplicated in every pipeline job, since a part of the build/automation
processes will be the same for most of the jobs. In such a situation, every other new upcoming
job should also duplicate the same piece of code. To avoid duplications, the Jenkins project
brought in the concept of Shared Libraries, to code - DRY - Don't Repeat Yourself.

Page | 237
Shared libraries are a set of code that can be common for more than one pipeline job and can
be maintained separately. Such libraries improve the maintenance, modularity & readability of
the pipeline code. And it also speeds up the automation for new jobs.

952. How Jenkins jobs can be Triggered/Stopped/Controlled programmatically?

Jenkins Remote Access API can be used to do things like -

 Retrieving information about jobs, views, nodes, builds, etc. from Jenkins for programmatic
consumption.
 Trigger a build (both parameterized & non-parameterized), stop/abort a build, enable/disable a
Job, group/remove jobs into/from views, etc.
 Create/copy/modify/delete jobs.

and many other programming language-specific functionalities. It has wrappers for main
programming languages like - Python, Ruby & Java. It can be triggered via CURL as below -

Jobs without parameters

Simply an HTTP POST on JENKINS_URL/job/JOBNAME/build.

Jobs with parameters

Simple example - sending "String Parameters":

curl JENKINS_URL/job/JOB_NAME/buildWithParameters --user USER:TOKEN --data


id=123 --data verbosity=high

953. How to get the Jenkins version programmatically in Jobs/Pipelines or nodes other
than master?

To check the version of Jenkins, load the top-level page or any top-level Remote Access API
path like the '.../api/*' page and then check for the 'X-Jenkins' response header.

This contains the version number of Jenkins, like "1.404". This is also a good way to check if
an URL is a Jenkins URL.

954. What happens when a Jenkins agent is offline and what is the best practice in that
situation?

When a job is tied to a specific agent on a specific node, the job can only be run on that agent
and no other agents can fulfill the job request. If the target node is offline or all the agents on
that particular node are busy building other jobs, then the triggered job has to wait until the
node comes online or an agent from that node becomes available to execute the triggered build
request.

Page | 238
As a result, a triggered job may sometimes wait indefinitely without knowing that the target
node is offline. So, it is always the best practice to tie the jobs to a group of nodes & agents,
referred to with a 'Label'. Once a job is tied to a Label, instead of a specific node/agent, any of
the nodes/agents falling under the label can fulfill a build request, when a job is triggered. This
way we can reduce the overall turn-around time of the builds.

Even then if a job is waiting for more time for the nodes/agents, then it is time to consider
adding more nodes/agents.

955. What is the Blue Ocean?

Blue Ocean is the redefined user experience for Jenkins. Designed from the ground up for
Jenkins Pipeline, it is still compatible with freestyle jobs, Blue Ocean reduces clutter and
increases clarity. Blue Ocean’s main features include -

 Sophisticated visualizations of continuous delivery (CD) Pipelines, allowing for fast and
intuitive comprehension of your Pipeline’s status.
 Pipeline editor - makes the creation of Pipelines approachable by guiding the user through an
intuitive and visual process to create a Pipeline.
 Personalization to suit the role-based needs of each member of the team.
 Pinpoint precision when intervention is needed and/or issues arise. Blue Ocean shows where in
the pipeline attention is needed, facilitating exception handling and increasing productivity.
 Native integration for branch and pull requests, enables maximum developer productivity when
collaborating on code with others in GitHub, Bitbucket, etc.

Conventional UI - Job Details Page

Conventional UI Jenkins

956. What is the Jenkins User Content service?

Jenkins has a mechanism known as "User Content", where administrators can place files inside
the $JENKINS_HOME/userContent folder and these files are served from
yourhost/jenkins/userContent.

This can be thought of as a mini HTTP server to serve images, stylesheets, and other static
resources that you can use from various description fields inside Jenkins.

Advanced Interview Questions

957. How is continuous integration achieved using Jenkins?

Continuous integration is a process where a developer’s code changes are constantly integrated
into the main code and the same will be tested automatically and the results of the tests will
decide whether the change is ready for deployment. In this process -

Page | 239
 Developer Makes a change - commit/pull_request - in feature/dev branch
 Source Control Management system generates appropriate events
 SCM Specific Jenkins Plugins like Git/SVN will detect those events from the configured
repositories and these events will be used to Trigger - build/dependent/test - jobs on Jenkins
 After the Test/Dependent jobs are completed, the change/patch will be labeled according to the
status of the test job
 Based on the Status (i.e. readiness of a change to be merged with the main branch), the
Continuous Delivery or Continuous Deployment strategy/tool will take it forward.

958. What is Artifact Archival & how to do it in Pipelines?

Artifacts are the exportable/storable/archivable results of a specific job build. This can be
configured using a plugin called - Copy artifact Plugin. Based on the configured pattern, the
files/directories matching the configured patterns will be archived for a Jenkins build, which
can be used for future references. In the pipeline, it can be configured as follows -

archiveArtifacts artifacts: 'output/**/*'

959. How to configure inclusions & exclusions in Artifacts Archival?

Artifact archival takes in a pattern for matching target files. Similarly, it also takes in a pattern
(ANT build system pattern for matching files) for exclusion as well which will be ignored
while selecting the files for archival.

For e.g.
archiveArtifacts artifacts: 'output/*.txt', excludes: 'output/specific_file.txt'

The above command will archive all the text files from the output folder except
specific_file.txt

960. How can we share information between different build steps or stages in a Jenkins
Job?

Every build step or stage will be running in its process and hence sharing information between
two different build steps is not so direct. We can use either a File, a Database Entry, an
Environment Variable, etc. to share info from one build step to another or a post-build action.

961. How code coverage is measured/tracked using Jenkins in a CI environment?

Using language-specific code coverage plugins like JaCoCo, CodeCov, etc or generic
tools/plugins like Sonarqube which will add the code coverage data to builds with some minor
tweaks in the code and the same can be displayed as a graph in Jenkins.

Page | 240
962. Default Environment Variables by Jenkins & How to introduce custom environment
variables?

Jenkins provides several environment variables by default like - BRANCH_NAME,


BUILD_NUMBER, BUILD_TAG, WORKSPACE, etc.

963. How can a job configuration be reset to an earlier version/state?

From the Job details page, we can use Job Config History to - See diff, Review & Revert the
Job configs from the history of changes we have made to a particular job. This will be super
useful when a job is misconfigured by someone by mistake, it can be reviewed and reverted
easily to any of its earlier states.

964. How to do Global Tools Configuration in Jenkins?

Global Tools are tools that need to be installed outside the Jenkins environment and need to be
controlled from within the Jenkins environment. Hence it needs its corresponding Jenkins
plugin as well. Steps to using a Global Tool generally include -

 Install the tool Plugin into the Jenkins instance, to include the global tool into a list of global
tools used by Jenkins.
 Install the tool in the Jenkins instance or provide away (maybe a command to download and)
install the tool during runtime.
 Go to Manage Jenkins -> Global Tools Configuration and Scroll through the tool list and
configure the global tool-specific configurations.
 Make use of the installed global Tool in your job/pipeline.

965. How to create & use a Shared Library in Jenkins?

Basic requirements for a Jenkins shared library to be used in a Pipeline Code are -

 A Repository with pipeline shared library code in SCM.


 An appropriate SCM Plugin configuration for the Jenkins instance.
 Global Shared Library should be configured in Jenkins Global configuration.
 Include the Shared Library in the Pipeline Code and use the methods defined in the Jenkins
Shared Library.

E.g.

#!/urs/bin/env groovy
@Library('[email protected]')_

Page | 241
966. How to install a Custom Jenkins Plugin or a Version of Plugin Not available in
Jenkins Update Center?

Generally, it is the best practice to use the latest version of a plugin. But there are ways to
install custom plugins or outdated versions of a published plugin. Jenkins Plugins are exported
using a .hpi file and the same can be installed in multiple ways -

Using the Jenkins CLI

java -jar jenkins-cli.jar -s http://localhost:8080/ install-plugin SOURCE ... [-deploy] [-name


VAL] [-restart]

The above command Installs a plugin either from a file, an URL or from the update center.

 SOURCE: If this points to a local file, that file will be installed. If this is an URL, Jenkins
downloads the URL and installs that as a plugin. Otherwise, the name is assumed to be the
short name of the plugin in the existing update center (like "findbugs") and the plugin will be
installed from the update center.
 -deploy: Deploy plugins right away without postponing them until the reboot.
 -name VAL: If specified, the plugin will be installed as this short name (whereas normally the
name is inferred from the source name automatically).
 -restart: Restart Jenkins upon successful installation.

Advanced Installation - via - Web UI

Assuming a .hpi file has been downloaded, a logged-in Jenkins administrator may upload the
file from within the web UI:

 Navigate to the Manage Jenkins > Manage Plugins page in the web UI.
 Click on the Advanced tab.
 Choose the .hpi file under the Upload Plugin section.
 Upload the plugin file.
 Restart the Jenkins instance

Advanced Installation - via - On the master

Assuming a .hpi file has been explicitly downloaded by a systems administrator, the
administrator can manually place the .hpi file in a specific location on the file system.

Copy the downloaded .hpi file into the JENKINS_HOME/plugins directory on the Jenkins
controller (for example, on Debian systems JENKINS_HOME is generally /var/lib/jenkins).

The master will need to be restarted before the plugin is loaded and made available in the
Jenkins environment.

Page | 242
967. How to download the Console log for a particular Jenkins build programmatically?

Using the Jenkins CLI - console - command

java -jar jenkins-cli.jar console JOB [BUILD] [-f] [-n N]

Produces the console output of a specific build to stdout, as if you are doing 'cat build.log'

 JOB: Name of the job


 BUILD: Build number or permalink to point to the build. Defaults to the last build
 -f: If the build is in progress, append console output as it comes, like tail -f
 -n N: Display the last N lines.

E.g.

ssh -l <ssh_username> -p <port_no> <Jenkins_URL> console <JOB_NAME>

968. What is Jenkins Remote Access API?

Jenkins provides remote access API to most of its functionalities (though some functionalities
are programming language-dependent). Currently, it comes in three flavors -

 XML
 JSON with JSONP support
 Python

Remote access API is offered in a REST-like style. That is, there is no single entry point for all
features, and instead, they are available under the ".../api/" URL where the "..." portion is the
data that it acts on.

For example, if your Jenkins installation sits at interviewbit.com, visiting /api/ will show just
the top-level API features available – primarily a listing of the configured jobs for this Jenkins
instance.

Or if we want to access information about a particular build, e.g.


https://ci.jenkins.io/job/Infra/job/jenkins.io/job/master/lastSuccessfulBuild/, then go to
https://ci.jenkins.io/job/Infra/job/jenkins.io/job/master/lastSuccessfulBuild/api/ and you’ll see
the list of functionalities for that build.

969. What is In-process Script Approval and how it works?

Jenkins, and several plugins, allow users to execute Groovy scripts in Jenkins. To protect
Jenkins from the execution of malicious scripts, these plugins execute user-provided scripts in
a Groovy Sandbox that limits what internal APIs are accessible.

Page | 243
This protection is provided by the Script Security plugin. As soon as an unsafe method is used
in any of the scripts, the "In-process Script Approval" action should appear in "Manage
Jenkins" to allow Administrators to make a decision about which unsafe methods, if any,
should be allowed in the Jenkins environment.

This in-process script approval inherently improves the security of the overall Jenkins
ecosystem.

970. Can we monitor Jenkins using common Observability tools?

Common monitoring platforms like DataDog, Prometheus, JavaMelody & few others - have
their corresponding Jenkins plugin, which when configured, sends Metrics to the
corresponding Monitoring platform, which can then be Observed with the latest tools &
technologies. The same can be configured with Alarms & Notifications for immediate attention
when something goes wrong.

971. What is a Ping Thread in Jenkins and how it works?

Jenkins installs "ping thread" on every remote connection, such as Controller/Agent


connections, regardless of its transport mechanism (such as SSH, JNLP, etc.). The lower level
of the Jenkins Remoting Protocol is a message-oriented protocol, and a ping thread
periodically sends a ping message that the receiving end will reply to. The ping thread
measures the time it takes for the reply to arrive, and if it’s taking excessive time (currently 4
minutes and configurable), then it assumes that the connection was lost and initiates the formal
close down.

This is to avoid an infinite hang, as some of the failure modes in the network cannot be
detected otherwise. The timeout is also set to a long enough value so that a temporary surge in
the load or a long garbage collection pause will not trip off the close-down.

Ping thread is installed on both controller & agent; each side pings the other and tries to detect
the problem from their sides.

The ping thread time out is reported through java.util.logging. Besides, the controller will also
report this exception in the agent launch log. Note that some agent launchers, most notably
SSH agents, writes all stdout/stderr outputs from the agent JVM into this same log file, so you
need to be careful.

972. What are the ways to trigger a Jenkins Job/Pipeline?

There are many ways we can trigger a job in Jenkins. Some of the common ways are as below -

 Trigger an API (POST) request to the target job URL with the required data.
 Trigger it manually from the Jenkins web application.
 Trigger it using Jenkins CLI from the master/slave nodes.
 Time-based Scheduled Triggers like a cron job.

Page | 244
 Event-based Triggers like SCM Actions (Git Commit, Pull Requests), WebHooks, etc.
 Upstream/Downstream triggers by other Jenkins jobs

Page | 245
SOFWARE TESTING PROJECT RELATED QUESTIONS
973. Explain your project?
Ans: Utah Retirement Systems administers pension plans and retirement savings plans for
public employees in the U.S. state of Utah. There are eight separate defined-benefit pension
plans administered by URS, as well as various retirement savings plans. As of December 31,
2014, the URS was managing over $31 billion in its pension trust funds, for nearly 200,000
members.[1] Besides the pension trust funds, the URS manages a 401(k), 457(b), a traditional
IRA and Roth IRA with around $4.5 billion in assets combined at the end of 2014. [2]
Membership[edit]

Members of the eight URS pension systems are the employees of over 700 different employers.
The two largest systems are the Public Employees Noncontributory Retirement Systems, Tier I
and Tier II, with 463 participating employers including all of Utah's school districts, the State of
Utah, and its counties and various political subdivisions. The old Contributory system has 159
employers, the Public Safety system has 131, and the Firefighters' system has 59 employers.
(Tier 2 Public Safety and Firefighters has 149.) There is a separate retirement system for Judges,
and one for Governors and Legislators. 161 employers participate in the URS 457 Savings Plans,
and 380 in the 401(k) Plans.[3]

974. Tell me your roles and responsibilities?


Ans:1 Understanding the requirements and functional specifications of the application
2.Identify the required test scenarios for the project.
3.Designing and preparing test cases to validate the application.
4.Execute Test Cases to validate the Application
5.Log test Results(How many test cases pass or fail)
6.Defect Reporting and tracking.

7.Retest fixed defects of previous build.


8.Performed various type of testing assigned by test lead
9.Reports to test lead about status of the assigned tasks like daily status report
Daily defect report,weekly status report,Retesting report
10.Participate in regular team meetings by lead and manager.
11.Creating enhancements.

Page | 246
975. What type of tests you have performed?
Ans:Unit Testing,System Testing,System Integration Testing Usability testing ,UI Testing
,Smoke testing ,Sanity testing ,Regression testing.

976. How u report that there is a bug in the software?


Ans:I report the bug by verifying the requirement as per document if its not matching then I wil
report.

Also if requirement is matched I will apply various application checklist to verify the
requirement if its passed or not
It its fail I will report bug using NeoTrack,JIRA.

977. When do you start writing test cases/test scripts?


Ans:As Development walkthrough is given by developer on module and there is confirmation
recived by tech lead to test lead,then test lead assign the task to Tester to worked on.

978. What was the duration of your project?


Ans:The Duration of our project is 6 years.

979. How many testers were there on this project?


Ans:In My current Project there is 15 tester from offshore team.

980. How many test cases have you designed? How many do you write in a day?
Ans:I Wrote and Desing around 25 test cases in a day.

981. How many bugs did you find?


Ans:I found 1000+ bugs on current project.

982. Which tool do you use for defect reporting?


Ans.I used defect reporting tool like NeoTrack,JIRA.

983. What is the database used for your project?


Ans:Database Used for the project is MSSQL Server

984. In which technology this application is developed?


Ans:Application Is developed In .Net Framework.

Page | 247
27 HR Interview Questions and Answers

985 "Tell me a little about yourself."

If you're the interviewer, there's a lot you should already know: The candidate's resume and
cover letter should tell you plenty, and LinkedIn and Twitter and Facebook and Google can tell
you more.

The goal of an interview is to determine whether the candidate will be outstanding in the job, and
that means evaluating the skills and attitude required for that job. Does she need to be an
empathetic leader? Ask about that. Does she need to take your company public? Ask about that.

If you're the candidate, talk about why you took certain jobs. Explain why you left. Explain why
you chose a certain school. Share why you decided to go to grad school. Discuss why you took a
year off to backpack through Europe, and what you got out of the experience.

When you answer this question, connect the dots on your resume so the interviewer understands
not just what you've done, but also why. Interviewers will be listening for a genuine response.

986. "What are your biggest weaknesses?"

Every candidate knows how to answer this question: Just pick a theoretical weakness and
magically transform that flaw into a strength in disguise.

ADVERTISING

For example: "My biggest weakness is getting so absorbed in my work that I lose all track of
time. Every day I look up and realize everyone has gone home. I know I should be more aware
of the clock, but when I love what I'm doing I just can't think of anything else."

So your "biggest weakness" is that you'll put in more hours than everyone else? Great. A
seasoned interviewer has a BS detector that can easily pick up on such silliness.

A better approach for a candidate is to choose an actual weakness, but one you're working to
improve. Share what you're doing to overcome that weakness. No one is perfect, but
showing you're willing to honestly self-assess and then seek ways to improve comes pretty
darned close.

987. "What are your biggest strengths?"

Although a job candidate's resume and experience should make their strengths readily apparent,
interviewers ask this popular interview question because they want to know how their skills can
drive a long-term growth in the company.

If you're asked, provide a sharp, on-point answer. Be clear and precise. If you're a great problem
solver, don't just say that: Provide a few examples, pertinent to the opening, that prove you're a

Page | 248
great problem solver. If you're an emotionally intelligent leader, don't just say that: Provide a few
examples that prove you know how to answer the unasked question.

In short, don't just claim to have certain attributes--prove you have those attributes.

988. "Where do you see yourself in five years?"

Answers to this question go one of two basic ways. Candidates try to show their incredible
ambition (because that's what they think you want) by providing an extremely optimistic answer:
"I want your job!" Or they try to show their humility (because that's what they think you want)
by providing a meek, self-deprecating answer: "There are so many talented people here. I just
want to do a great job and see where my talents take me."

In either case, you learn nothing, other than possibly how well candidates can sell themselves.

For interviewers, here's a better question: "What business would you love to start?"

That question applies to any organization, because every employee at every company should
have an entrepreneurial mind-set.

The business a candidate would love to start tells you about her hopes and dreams, her interests
and passions, the work she likes to do, the people she likes to work with -- so just sit back and
listen.

989. "Out of all the candidates, why should we hire you?"

Since candidates cannot compare themselves with people they don't know, all they can do is
describe their incredible passion and desire and commitment and, well, basically beg for the job.
(Way too many interviewers ask the question and then sit back, arms folded, as if to say, "Go
ahead. I'm listening. Try to convince me.")

And you learn nothing of substance.

Here's a better interview question: "What do you feel I need to know that we haven't discussed?"
Or even, "If you could get a do-over on one of my questions, how would you answer it now?"

Rarely do candidates come to the end of an interview feeling they've done their best. Maybe the
conversation went in an unexpected direction. Maybe the interviewer focused on one aspect of
their skills and totally ignored other key attributes. Or maybe candidates started the interview
nervous and hesitant, and now wish they could go back and better describe their qualifications
and experience.

Plus, think of it this way: Your goal as an interviewer is to learn as much as you possibly can
about every candidate, so don't you want to give them the chance to ensure you do?

Just make sure to turn this part of the interview into a conversation, not a soliloquy. Don't just
passively listen and then say, "Thanks. We'll be in touch." Ask follow-up questions. Ask for
examples.

Page | 249
And of course if you're asked this question, use it as a chance to highlight things you haven't
been able to touch on.

990. "How did you learn about the opening?"

Job boards, general postings, online listings, job fairs -- most people find their first few jobs that
way, so that's certainly not a red flag.

But a candidate who continues to find each successive job from general postings probably hasn't
figured out what he or she wants to do -- and where he or she would like to do it.

He or she is just looking for a job; often, any job.

So don't just explain how you heard about the opening. Show that you heard about the job
through a colleague, a current employer, by following the company--show that you know about
the job because you want to work there.

Employers don't want to hire people who just want a job; they want to hire people who want a
job with their company.

991. "Why do you want this job?"

Now go deeper. Don't just talk about why the company would be great to work for; talk about
how the position is a perfect fit for what you hope to accomplish, both short-term and long-term.

And if you don't know why the position is a perfect fit, look somewhere else. Life is too short. A
skilled interviewee loves this interview question because a well-crafted answer shows
interviewers the value you will bring to the company.

992. "What do you consider your biggest professional achievement?"

Here's an interview question that definitely requires an answer relevant to the job. If you say
your biggest achievement was improving throughput by 18 percent in six months but you're
interviewing for a leadership role in human resources, that answer is interesting but ultimately
irrelevant.

Instead, talk about an underperforming employee you "rescued," or how you overcame infighting
between departments, or how so many of your direct reports have been promoted.

The goal is to share achievements that let the interviewer imagine you in the position -- and see
you succeeding.

993. "Tell me about the last time a co-worker or customer got angry with you. What
happened?"

Conflict is inevitable when a company works hard to get things done. Mistakes happen. Sure,
strengths come to the fore, but weaknesses also rear their heads. And that's OK. No one is
perfect.

Page | 250
But a person who tends to push the blame -- and the responsibility for rectifying the situation --
onto someone else is a candidate to avoid. Hiring managers would much rather choose
candidates who focus not on blame but on addressing and fixing the problem.

Every business needs employees who willingly admit when they are wrong, step up to take
ownership for fixing the problem, and, most important, learn from the experience.

994. "Describe your dream job."

Three words describe how you should answer this question: relevance, relevance, relevance.

But that doesn't mean you have to make up an answer. You can learn something from every job.
You can develop skills in every job. Work backward: Identify things about the job you're
interviewing for that will help you if you do land your dream job someday, and then describe
how those things apply to what you hope to someday do.

And don't be afraid to admit that you might someday move on, whether to join another company
or -- better -- to start your own business. Employers no longer expect "forever" employees.

995. "Why do you want to leave your current job?"

Let's start with what you shouldn't say (or, if you're the interviewer, what are definite red flags).

Don't talk about how your boss is difficult. Don't talk about how you can't get along with other
employees. Don't bad-mouth your company.

Instead, focus on the positives a move will bring. Talk about what you want to achieve. Talk
about what you want to learn. Talk about ways you want to grow, about things you want to
accomplish; explain how a move will be great for you and for your new company.

Complaining about your current employer is a little like people who gossip: If you're willing to
speak badly of someone else, you'll probably do the same to me. An experienced interviewer will
push to get a real answer by asking this follow-up question: How is your current employer not
satisfying these needs?

996. "What kind of work environment do you like best?"

Maybe you love working alone, but if the job you're interviewing for is in a call center, that
answer will do you no good.

So take a step back and think about the job you're applying for and the company's culture
(because every company has one, whether intentional or unintentional). If a flexible schedule is
important to you, but the company doesn't offer one, focus on something else. If you like
constant direction and support and the company expects employees to self-manage, focus on
something else.

Find ways to highlight how the company's environment will work well for you -- and if you can't
find ways, don't take the job, because you'll be miserable.

Page | 251
When you're the one in the interviewer's seat, you'll get a more honest answer by asking: What
do you care about most at work?

997. "Tell me about the toughest decision you had to make in the past six months."

The goal of this question is to evaluate the candidate's reasoning ability, problem-solving skills,
judgment, and possibly even willingness to take intelligent risks.

Having no answer is a definite warning sign. Everyone makes tough decisions, regardless of their
position. My daughter worked part-time as a server at a local restaurant and made difficult
decisions all the time -- like the best way to deal with a regular customer whose behavior
constituted borderline harassment.

A good answer proves you can make a difficult analytical or reasoning-based decision -- for
example, wading through reams of data to determine the best solution to a problem.

A great answer proves you can make a difficult interpersonal decision, or better yet a difficult
data-driven decision that includes interpersonal considerations and ramifications.

Making decisions based on data is important, but almost every decision has an impact on people
as well. The best candidates naturally weigh all sides of an issue, not just the business or human
side exclusively.

998. "What is your leadership style?"

This is a tough question to answer without dipping into platitudes. Try sharing leadership
examples instead. Say, "The best way for me to answer that is to give you a few examples of
leadership challenges I've faced," and then share situations where you dealt with a problem,
motivated a team, worked through a crisis. Explain what you did and that will give the
interviewer a great sense of how you lead.

And, of course, it lets you highlight a few of your successes.

999. "Tell me about a time you disagreed with a decision. What did you do?"

No one agrees with every decision. Disagreements are fine; it's what you do when you disagree
that matters. (We all know people who love to have the "meeting after the meeting," where
they've supported a decision in the meeting but they then go out and undermine it.)

Show that you were professional. Show that you raised your concerns in a productive way. If you
have an example that proves you can effect change, great -- and if you don't, show that you can
support a decision even though you think it's wrong (as long as it's not unethical, immoral, etc.).

Every company wants employees to be honest and forthright, to share concerns and issues, but to
also get behind a decision and support it as if they agreed, even if they didn't.

Page | 252
1000. "Tell me how you think other people would describe you."

I hate this question. It's a total throwaway. But I did ask it once, and got an answer I really liked.

"I think people would say that what you see is what you get," the candidate said. "If I say I will
do something, I do it. If I say I will help, I help. I'm not sure that everyone likes me, but they all
know they can count on what I say and how hard I work."

Can't beat that.

1001. "What can we expect from you in your first three months?"

Ideally the answer to this should come from the employer: They should have plans and
expectations for you.

But if you're asked, use this general framework:

 You'll work hard to determine how your job creates value -- you won't just stay busy,
you'll stay busy doing the right things.

 You'll learn how to serve all your constituents -- your boss, your employees, your peers,
your customers, and your suppliers and vendors.

 You'll focus on doing what you do best -- you'll be hired because you bring certain skills,
and you'll apply those skills to make things happen.

 You'll make a difference -- with customers, with other employees, to bring enthusiasm and
focus and a sense of commitment and teamwork.

Then just layer in specifics that are applicable to you and the job.

1002. "What do you like to do outside of work?"

Many companies feel cultural fit is extremely important, and they use outside interests as a way
to determine how you will fit into a team.

Even so, don't be tempted to fib and claim to enjoy hobbies you don't. Focus on activities that
indicate some sort of growth: skills you're trying to learn, goals you're trying to accomplish.
Weave those in with personal details. For example, "I'm raising a family, so a lot of my time is
focused on that, but I'm using my commute time to learn Spanish."

1003. "What was your salary in your last job?"

While this question has been a long-time favorite, new laws now make asking about salary
history off limits in some cities and states, including California, Massachusetts, and New York.
The aim of the new prohibitions is to end the cycle of pay discrimination.

Even so, it's still OK to ask: Does your current salary really reflect the market rate in your field?
Or, is your current salary what you hope to get in your next job?

Page | 253
For job candidates, this is a tough one. You want to be open and honest, but frankly, some
companies ask the question as the opening move in salary negotiations. Try an approach
recommended by Liz Ryan. When asked, say, "I'm focusing on jobs in the $50K range. Is this
position in that range?" (Frankly, you should already know--but this is a good way to deflect.)

Maybe the interviewer will answer; maybe she won't. If she presses you for an answer, you'll
have to decide whether you want to share or demur. Ultimately your answer won't matter too
much, because you'll either accept the salary offered or you won't, depending on what you think
is fair.

1004. "A snail is at the bottom of a 30-foot well. Each day he climbs up three feet, but at
night he slips back two feet. How many days will it take him to climb out of the well?"

Questions like these are now among the most popular interview questions (thanks, Google) in
recent years. As the interviewer, you're not necessarily looking for the right answer, but instead a
little insight into the job candidate's reasoning abilities.

Listen carefully as they talk through their logic as they try to solve the problem. Who cares if
people get it wrong? The best candidates will laugh at themselves. Assess how the interviewee
deals with failure. Moreover, do they know how to be a good communicator?

1005. "What questions do you have for me?"

A great candidate doesn't waste this opportunity. Smart questions not only signal a great
candidate but also reveal to the candidate whether the company is a good fit for them. After all,
they're being interviewed, but they're also interviewing the company and have a keen sense of
the questions to ask during an interview.

Here goes:

1006. "What do you expect me to accomplish in the first 90 days?"

A great job candidate will ask this question if they haven't already gleaned this information at
some point in their interview. Why? High performers want to hit the ground running. They don't
want to spend weeks or months "getting to know the organization." They don't want to spend
huge chunks of time in orientation, in training, or in the futile pursuit of getting their feet wet.

They want to make a difference--and they want to make that difference right now.

1007. "What are the three traits your top performers have in common?"

Great candidates also want to be great employees. They know every organization is different --
and so are the key qualities of top performers in those organizations. Maybe your top performers
work longer hours. Maybe creativity is more important than methodology. Maybe constantly
landing new customers in new markets is more important than building long-term customer
relationships. Maybe the key is a willingness to spend the same amount of time educating an
entry-level customer as helping an enthusiast who wants high-end equipment.

Page | 254
Great candidates want to know, because:

 they want to know if they will fit in, and,

 if they do fit in, they want to know how they can be a top performer.

1008. "What really drives results in this job?"

Employees are investments, and you expect every employee to generate a positive return on his
or her salary. (Otherwise why do you have them on the payroll?)

In every job, some activities make a bigger difference than others. You need your HR team to fill
job openings, but what you really want is for them to find the right candidates, because that
results in higher retention rates, lower training costs, and better overall productivity.

You need your service techs to perform effective repairs, but what you really want is for those
techs to identify ways to solve problems and provide other benefits -- in short, to build customer
relationships and even generate additional sales.

Great candidates want to know what truly makes a difference and drives results, because they
know helping the company succeed means they will succeed as well.

1009. "What are the company's highest-priority goals this year, and how would my role
contribute?"

Is the job the candidate will fill important? Does that job matter?

Great candidates want a job with meaning, with a larger purpose -- and they want to work with
people who approach their jobs the same way.

Otherwise a job is just a job.

1010. "What percentage of employees was brought in by current employees?"

Employees who love their jobs naturally recommend their company to their friends and peers.
The same is true for people in leadership positions -- people naturally try to bring on board
talented people they previously worked with. They've built relationships, developed trust, and
shown a level of competence that made someone go out of their way to follow them to a new
organization.

And all of that speaks incredibly well to the quality of the workplace and the culture.

Page | 255
1011. "What do you plan to do if ...?"

Every business faces a major challenge: technological changes, competitors entering the market,
shifting economic trends. There's rarely one of Warren Buffett's moats protecting a small
business.

So while some candidates may see your company as a stepping-stone, they still hope for growth
and advancement. If they do eventually leave, they want it to be on their terms, not because you
were forced out of business.

Say I'm interviewing for a position at your ski shop. Another store is opening less than a mile
away: How do you plan to deal with the competition? Or you run a poultry farm (a huge industry
in my area): What will you do to deal with rising feed costs?

Great candidates don't just want to know what you think; they want to know what you plan to do
-- and how they will fit into those plans.

00:20

02:19

Page | 256
CUCUMBER

1012. What is Cucumber? Why is it used?

Cucumber is a testing tool based on Behavior Driven Development (BDD) framework. It is used
to run functional tests written in plain text and develop test cases for software functionality. It
plays a supporting role in automated testing.

In other words, we can say that "Cucumber is a software tool used by the testers to develop test
cases for the testing of behavior of the software."

1013. In which language is Cucumber software written?

Cucumber software is written in a Ruby programming language.

Pause

Unmute

Current Time 0:05

Duration 18:10
Loaded: 1.10%
Â

Fullscreen

1014. What is the main aim of the Behavior Driven Development (BDD) framework?

The main aim of the Behavior Driven Development framework is to make various project roles
such as Business Analysts, Quality Assurance, Developers, etc., understand the application
without diving deep into the technical aspects.

Page | 257
1015. What language is used by the Cucumber tool?

The Cucumber tool uses the Gherkin language, a simple English representation of the application
behavior. The Gherkin language uses several keywords to describe the behavior of applications
such as Feature, Scenario, Scenario Outline, Given, When, Then, etc.

1016. What are the two files required to execute a Cucumber test scenario?

Following are the two files required to execute a Cucumber test scenario:

o Features
o Step Definition

1017. What do you understand by a feature file?

A feature file is used to provide a high-level description of an Application Under Test (AUT).
The first line of the feature file must start with the keyword 'Feature' followed by the description
of the application under test. A feature file may include multiple scenarios within the same file,
and the extension of the feature file must be ".feature."

1018.What are the various keywords used in the Cucumber tool for writing a scenario?

Following are the keywords that are used for writing a scenario in the Cucumber tool:

o Given
o When
o Then
o And

1019. What is the use of the Background keyword in Cucumber?

In the Cucumber tool, the Background keyword is used to group multiple given statements into a
single group. The keyword is mostly used when the same set of given statements are repeated in
each scenario of the feature file.
Page | 258
1020. What is the usage of a Scenario Outline in the Cucumber tool?

In Cucumber, a Scenario outline is used as a parameter of scenarios. This is used when the same
scenario needs to be executed for multiple sets of data; however, the test steps remain the same.
Scenario Outline must be followed by the keyword 'Examples', which specify the set of values
for each parameter.

1021.What do you understand by the term step definition in Cucumber?

In Cucumber, a step definition is the actual code implementation of the feature mentioned in the
feature file.

1022. Which programming languages are supported by Cucumber?

The Cucumber tool supports multiple programming languages such as Java, .Net, Ruby, etc. You
can also integrate this tool easily with multiple tools such as Selenium, Capybara, etc.

1023. What are the differences between Jbehave and Cucumber?

Although Cucumber and Jbehave are designed for the same purpose, the most distinctive
difference between them is that Jbehave is based on stories while Cucumber is based on features.

1024. What do you understand by regular expressions?

A regular expression is a pattern used to describe a certain amount of text. The most basic
regular expression consists of a single literal character.

1025. What software is used to run a Cucumber Web Test case?

Following software is used to run a Cucumber Web Test case:

o Cucumber
o Ruby and its Development Kit
o IDE like ActiveState
o Watir ( To simulate browser)

Page | 259
o Ansicon and RSpec (if required)

1026.What are the most significant advantages of the Cucumber framework?

Following is the list of advantages of the Cucumber framework that makes Cucumber an ideal
choice for rapidly evolving agile methodology in today's corporate world:

o Cucumber is an open-source and free-to-use tool.


o It is easy to use. Even non-technical users can also understand the scenarios because of its
plain text representation.
o It bridges the communication gap between various project stakeholders such as Business
Analysts, Developers, and Quality Assurance personnel.
o With the Cucumber tool, we can develop automation test cases that are easier to maintain
and understand.
o It is easy to integrate with other tools such as Selenium and Capybara.

1027. What do you understand by test harness in Cucumber?

In Cucumber, the test harness allows for separating responsibility between setting up the context
and interacting with the browser, and cleaning up the step definition files. It collects stubs,
drivers, and other supporting tools required to automate test execution in testing.

1028.What is the difference between RSpec and Cucumber? When should we use RSpec and
when to use Cucumber?

RSpec and Cucumber both are the example of testing frameworks. RSpec uses traditional Unit
Testing. It means it uses testing a class or part of the application in isolation from the rest of the
application. So your model does what your model is supposed to do, the controller does what it is
supposed to do, etc. RSpec and Cucumber both are used for Acceptance Testing, also called
ATDD, BDD, etc.

Difference between RSpec and Cucumber

o The main difference between RSpec and Cucumber is the business readability factor.

Page | 260
o RSpec is mainly used for Unit Testing. On the other hand, Cucumber is mainly used for
Behavior-driven development. We can also use it for System and Integration Testing.
o In Cucumber, the specifications or features are separate from the test code, so the product
owners can provide or review the specification without going through the code. These are
the .feature files that you make in Cucumber.
o RSpec also has a similar mechanism, but instead of describing a step with a Describe or
Context, it uses the business specification to execute that statement. This approach is a
little easier for developers to work with but a bit harder for non-technical guys.

Which should we use?

o For a core developer, it is the best choice to use RSpec. It is easier to understand for a
technical person and offers a few advantages in keeping things scoped and under control
because you don't have to mess up with RegExs for test steps.
o If you are building this for a client, you should choose Cucumber for Acceptance Testing
and use RSpec for Unit Testing.

1029.What is Selenium?

Selenium is a web browser automation tool widely used for Functional Testing of web-based
applications. Selenium supports different programming languages such as Java, Python, Ruby,
C#, etc.

1030.What is the difference between Selenium and Cucumber?

Selenium and Cucumber are both open-source testing tools, and both are used for functional
testing. But there are some differences between them.

Following are some critical differences between Selenium and Cucumber:

o Selenium is a web browser automation tool for web apps, while Cucumber is an
automation tool for behavior-driven development that can be used with Selenium (or
Appium).
o Selenium is used for automated UI testing, while Cucumber is used for acceptance
testing.

Page | 261
o Selenium is preferred by technical teams (SDETs/programmers), while Cucumber is
typically preferred by non-technical teams (business stakeholders and testers).
o Selenium can work independently of Cucumber. Cucumber depends on Selenium or
Appium for step-definition implementation.
o In Selenium, the script creation is complex, while Cucumber is simpler than Selenium.

1031.Why we have to use Cucumber with Selenium?

Cucumber and Selenium are both testing frameworks and prevalent technologies. Many
organizations use Selenium for functional testing. Along with Selenium, these organizations
integrate Cucumber with Selenium as Cucumber makes it easy to read and understand the
application flow. The most significant benefit of using Cucumber with Selenium is that it
facilitates developers to write test cases in simple feature files easily understood by managers,
non-technical stakeholders, and business analysts. It provides the facility to write tests in a
human-readable language called Gherkin. The Selenium-Cucumber framework supports
programming languages such as Java, .NET, PHP, Python, Perl, etc.

1032. What do you understand by the Step Definition?

Step definition is used to map the Test Case Steps in the feature files to code. It executes the
steps on Application under Test and checks the results. To execute step definition, it must match
the given component in a feature.

1033. What are the maximum numbers of scenarios that we can includ in the feature file?

In Cucumber, a feature file can contain a maximum of 10 scenarios. This number can vary from
project to project and from one organization to another organization. It is the best practice to
limit the number of scenarios included in the feature file.

1034.What is the purpose of the behavior-driven development (BDD) methodology in the real
world?

Behavior Driven Development or BDD is a methodology used to understand the functionality of


an application in the simple plain text representation. The primary purpose of the Behavior
Driven Development framework is to make various project roles such as Business Analysts,

Page | 262
Quality Assurance, Developers, Support Teams understand the application without diving deep
into the technical aspects.

1035.What do you understand by TDD, and what are the different processes used in TDD?

TDD is an acronym that stands for Test-Driven Development. This is a software development
technique used to create the test cases first and then write the code underlying those test cases.
Although TDD is a development technique, it can also be used for automation testing
development. TDD takes more time for development because it tends to find very few defects.
The result provided by the TDD development technique has improved the quality of code, and
that can be more reusable and flexible. TDD also helps developers to achieve high test coverage
of about 90-100%. The only disadvantage for developers following TDD is to write their test
cases before writing the code.

Following is the list of simple 6 step process used by TDD methodology:

1. First, write the test case: You have to write an automated test case according to your
requirements.
2. Run all the test cases: Now, run these automated test cases on the currently developed
code.
3. Develop the code for that test case: In this process, you must write the code to make
that test case work as expected if the test case fails.
4. Run test cases again: Now, you have to rerun the test cases and check if all the test cases
developed so far are implemented.
5. Refactor your code: This is an optional step. But, it is advised to refactor your code to
make it more readable and reusable. That's why it is essential.
6. Repeat steps 1- 5 for new test cases: This is the last step. Here, you have to repeat the
cycle for the other test cases until all the test cases are implemented.

1036.What are the similarities between BDD and TDD?

TDD stands for Test-Driven Development, and BDD stands for Behavior Driven Development.
Both are two software development techniques.

BDD and TDD are both very similar as they are both testing strategies for a software application.
In both cases, the developers have to write the test before writing the code to pass the test. The

Page | 263
second main similarity between them is in both cases; the tests can be used as part of an
automated testing framework to prevent bugs.

1037.What are the main differences between TDD and BDD?

Following is the list of main differences between TDD and BDD:

TDD BDD

TDD stands for Test-Driven Development. It is a BDD stands for Behavior Driven Development. It is a
test-centered development process. This means the Behavior centered development process.
developers have first to write the test cases then
code.

In TDD, writing a test fails because the specified In BDD, creating an executable specification that fails
functionality doesn't exist, then writing the most because the feature doesn't exist, then writing the most
straightforward code that can make the test pass, straightforward code that can make the spec pass. You
then refactoring to remove duplication, etc. repeat this until a release candidate is ready to ship.

TDD tests are written using programming languages BDD tests are written in a human-readable format using
such as Java, .Net, Python, Ruby, etc. Given-When-Then steps. These tests are readable and
understandable by non-technical persons also.

TDD tests are difficult to read by non-programmers BDD tests are readable by non-programmers also as they
as they are written in specific programming are written in a human-readable format.
languages.

The critical difference between TDD and BDD is On the other hand, BDD is a team methodology.
the scope. TDD is a development practice.

In TDD, the developers write the test cases. In BDD, the automated specifications are created by
users or testers then the developers wiring them to the
code under test.

Page | 264
1038. What do you understand by cucumber dry run?

Cucumber dry run is used to compile cucumber features files and step definitions. It is run to find
any compilation errors. If it finds anyone, it will show when we use dry run.

1039.What do you understand by the TestRunner class in the Cucumber testing approach?
Explain with example.

In the Cucumber testing approach, the TestRunner class provides the link between the feature
file and the step definition file. The TestRunner class is generally an empty class with no class
definition.

Example of a TestRunner class in Cucumber:

1. Package com.sample.TestRunner
2. importorg.junit.runner.RunWith;
3. importcucumber.api.CucumberOptions;
4. importcucumber.api.junit.Cucumber;
5. @RunWith(Cucumber.class)
6. @CucumberOptions(features="Features",glue={"StepDefinition"})
7. public class Runner
8. {
9. }

1040.Should we write code within the TestRunner class?

It is advised not to write code under the TestRunner class. It should include the tags @RunWith
and @CucumberOptions.

1041. What is the starting point of execution for feature files?

When Cucumber is integrated with Selenium, the starting point of execution must be from the
TestRunner class.

Page | 265
1042. How can you use the Options tag in the Cucumber framework?

In the Cucumber framework, the Options tag is a part of the TestRunner file and comes in the
form of an annotation called @CucumberOptions. It contains two parameters feature and glue.

o Feature parameter: The feature parameter is used to specify the path of the feature file.
o Glue parameter: The glue parameter is used to specify the path of the step definition
file.

See the code implementation of TestRunner file with Option tag:

1. import org.junit.runner.RunWith;
2. import cucumber.api.CucumberOptions;
3. import cucumber.api.junit.Cucumber;
4. @RunWith (Cucumber.class)
5. @CucumberOptions (
6. features = "src/test/java/features ",
7. glue = {"stepDefinitions"}
8. )
9. public class TestRunner {
10. }

We have to import org.junit.runner.RunWith for the @RunWith annotation and


cucumber.api.CucumberOptions for the @CucumberOptions annotation.

1043.What is the use of features property under the Cucumber Options tag?

In the Cucumber framework, the features property is used to identify the location of the feature
files.

1044. What is the use of glue property under the Cucumber Options tag?

The Glue property is used to facilitate the Cucumber framework to identify the location of step
definition files.

Page | 266
1045.What are the two build management tools that can be integrated with Cucumber?

Following are the two build management tools that can be integrated with Cucumber:

o Gradle
o Maven

Page | 267
Maven Interview Questions for Beginners

1046. When should one use Maven?

The Maven Build Tool can be used in the following conditions:

 When the project has a large number of dependencies. Then, using Maven, you can easily
manage those dependencies.
 When the version of a dependency changes frequently. To update dependencies, simply update
the version ID in the pom file.
 Maven makes it simple to handle continuous builds, integration, and testing.
 When you need a quick way to generate documentation from source code, this is the tool you
use. It helps in compiling source code, and then packaging it into JAR or ZIP files.

1047. Discuss the core concepts of Maven.

The core concepts of Maven are:

 POM Files: Project Object Model (POM) files are XML files that include information about
the project and configuration information used by Maven to construct the project, such as
dependencies, source directory, plugin, goals, and so on. When you want to run a maven
command, you provide it with a POM file to run. To complete its configuration and functions,
Maven reads the pom.xml file.
 Dependencies and Repositories: Repositories are folders containing bundled JAR files, and
dependencies are external Java libraries necessary for Project. The local repository is simply a
folder on your computer's hard drive. Maven retrieves dependencies from a central Maven
repository and places them in your local repository if they aren't found in the local Maven
repository.
 Build Life Cycles, Phases, and Goals: A build life cycle is made up of a series of build
phases, each of which contains a set of goals. A build lifecycle, phase, or goal is referred to as
a Maven command. When a lifecycle is asked to be run using the maven command, all of the
build steps in that life cycle are likewise run. When a build phase is requested to be executed, it
is followed by all build phases in the given sequence.
 Build Profiles: Build Profiles are a set of configuration parameters that allow you to build
your project using a variety of setups. For example, you might need to develop and test your
project on your local computer. You can add different build profiles to your POM files using
its profile elements to enable different builds, which can be triggered in a variety of ways.
 Build Plugins: Build Plugins are used to accomplish a certain task. A plugin can be added to
the POM file. Maven comes with various pre-installed plugins, but you can also write your
own in Java.

Page | 268
1048. How does Maven work?

Maven works in three steps:

 Reading the pom.xml file is the first step.


 The dependencies mentioned in pom.xml are then downloaded from the central repository into
the local repository.
 Finally, it builds and generates a report based on the requirements, as well as handles life
cycles, phases, goals, plugins, and other tasks.

Page | 269
1049. List a few differences between Maven and ANT.
Ant Maven

Maven has a convention for storing source code,


Because Ant lacks formal conventions,
compiled code, and so forth. As a result, we don't need
we must include project structure
to provide project structure information in the pom.xml
information in the build.xml file.
file.

Maven has a convention for storing source code,


Ant is procedural, so you'll need to
compiled code, and so forth. As a result, we don't need
write code to tell it what to do and when
to provide project structure information in the pom.xml
to do it. You must maintain order.
file.

Ant has no life cycle. Maven has a life cycle.

Ant is a toolbox. Maven is a framework.

Ant is primarily a build tool. Maven is primarily a project management tool.

The ant scripts can not be reused. The maven plugins can be reused.

1050. What elements are used for creating a pom.xml file?

The following elements are necessary for creating a pom.xml file:

 project- The root element of the pom.xml file is the project.


 modelVersion- It identifies which version of the POM model you're working with. For Maven
2 and Maven 3, use version 4.0.0.
 groupId- groupId is the project group's identifier. It is unique, and you will most likely use a
group ID that is similar to the project's root Java package name.
 artifactId- It is used for naming the project you're working on.
 version- The version number of the project is contained in the version element. If your project
has been released in multiple versions, it is helpful to list the versions.

Other Pom.xml File Elements

 dependencies- This element is used to establish a project's dependency list.


 dependency- dependency is used inside the dependencies tag to define a dependency. The
groupId, artifactId, and version of each dependency are listed.
 name- This element is used to give our Maven project a name.
 scope- This element is used to specify the scope of this maven project, which can include
compile, runtime, test, among other things.
 packaging- The packaging element is used to package our project into a JAR, WAR, and other
output formats.

Page | 270
1051. What are the different types of Maven repositories? Discuss.

The three types of repositories of Maven are:

 Local repository
 Central repository
 Remote repository

Maven scans these repositories for dependencies. Maven looks in the Local repository first,
then the Central repository, and finally the Remote repository if the Remote repository is
defined in the POM.

 Local Repository: Local repository is a directory on the developer's device. The local
repository contains all of Maven's dependencies. Even though several projects rely on
dependencies, Maven only needs to download them once.
 Central Repository: The Maven community has built the central Maven repository. Maven
searches this central repository for any dependencies that aren't available in your local
repository. The dependencies are subsequently downloaded into your local repository by
Maven.
 Remote Repository: Maven may download dependencies from a remote repository hosted on
a web server. It is frequently used to host internal organization projects. The dependencies are
subsequently downloaded into your local repository by Maven.

1052. What command should one use to install JAR files in the Local Repository?

 JAR files are installed in the local repository using mvn install.
 The following plugin is used to manually install the JAR into the local Maven repository:
install-file-Dfile = <file path>

1053. In Maven, what do you mean by Clean, Default, and Site?

The three built-in build life cycles are:

 Clean: The clean lifecycle is in charge of project cleaning.


 Default: The project deployment is handled by the default lifecycle.
 Site: The creation of the project's site documentation is referred to as the site lifecycle.

1054. What are the different phases of the default life cycle?

The different phases of the default lifecycle are:

 Validate: Make sure the project is correct and that you have all of the necessary information.
 Test: Test the compiled source code using an appropriate unit testing framework. These tests
should not demand that the code be packed or deployed; instead, take the compiled code and
package it in a manner that can be distributed, such as a JAR.
 Compile: Compile the project's source code.

Page | 271
 Verify: Perform any necessary checks on integration test findings to ensure that quality criteria
are met.
 Install: Adds the package to the local repository, allowing it to be used as a dependency in
other projects.
 Deploy: Copies the entire package to the remote repository for sharing with other developers
and organizations, and is done in the build environment.

1055. What are Maven plugins used for? What are the types of Maven plugins?

Maven Plugins are used for:

 Creating JAR files.


 Creating WAR files.
 Compiling the source code files.
 Unit testing of the code.
 Creating the project documentation.
 Creating project reports.

Maven plugins are divided into two categories:

 Build plugins: These plugins are used throughout the build process and are configured in the
pom.xml file's <build/> element.
 Reporting plugins: These plugins are configured in the pom.xml's <reporting/> element and
run during stage generation.

1056. “Maven uses convention over configuration” - Why is it so?

 Because developers simply need to establish a Maven project while employing


convention, Maven uses convention over configuration. The rest of the structure is generated
automatically. In the case of configuration, build processes are to be created manually.
 For setting up a project, creating artifacts, releasing code, and running unit tests, Maven has a
number of conventions.

1057. What is Maven's inheritance order?

In Maven, the order of inheritance is:

 Settings
 CLI parameters
 Parent POM
 Project POM

Page | 272
1058. In Maven, what is a snapshot?

A snapshot is a specific version of a project that shows the most recent development copy of
the project being worked on. Maven always checks out a SNAPSHOT of the project in the
remote repository for each build.

As a result, anytime Maven discovers a newer SNAPSHOT of the project, it downloads and
replaces the project's older .jar file in the local repository.

1059. What are the locations where Maven dependencies are stored?

Maven saves all of the JARs, dependency files, and other things it downloads in the Maven
local repository. All of the artifacts are kept locally in the Maven local repository, which is a
folder on the local machine.

1060. What are the different types of Maven build profiles? In what ways can build
profiles of maven be activated?

The different types of Maven build profiles are:

 Per-User: This is defined in the Maven settings.xml file.


 Per Project: This is defined in the project’s pom.xml.
 Global: This is defined in the global Maven settings.xml file.

Maven build profiles can be activated or triggered in the following ways:

 Using explicit commands


 Maven settings
 On the basis of environment variables
 Configuration of the operating system
 Present/missing files

1061. How would you refer to a property declared in your pom.xml file?

In order to refer to a property declared in your pom.xml, the property name makes use of the
names of the XML components that designate the value, with "pom" being accepted as a
synonym for the project (root) element.

So ${pom.name} is the project's name, ${pom.version} is the project's version,


${pom.build.finalName} is the final name of the file generated when the built project is
packaged, and so on.

Page | 273
1062. How to generate javadocs in Maven?

The maven-javadoc plugin is used by Maven to generate a project's javadocs. To create


javadocs, this plugin internally uses the JDK\bin\javadoce.exe command. The javadocs for the
project are generated when the project is deployed with the mvn install command.

1063. What exactly is MOJO?

Every Maven plain Old Java Object (MOJO) is an executable goal, and a plugin pertains to the
distribution of these MOJOs. MOJO allows Maven to add functionalities that it doesn't already
have. In Maven, a MOJO is a single unit of the task.

1064. What do you understand about the term ‘Super POM’?

Any POM file has the ability to point to its parent POM. There is a system-wide POM file that
is automatically considered as the parent POM file if the parent POM element is absent. The
super POM is the name given to this POM file. Finally, the super POM is used to extend all of
the application POM files. The apex of the POM hierarchy is the super POM file. The super
POM file contains all of the default configurations. All of the configurations defined in the
super POM file will be inherited by even the simplest version of a POM file. You can alter any
option you want by redefining the same section in your application POM file.

Page | 274
1065. What is a 'Dependency Scope'? What are the different types of Dependency
Scopes?

The dependency scope pertains to all dependencies related to the present stage of the build.

The following are the several sorts of dependence scopes:

 Compile- It's the default scope, and it shows which dependencies are available in the project's
classpath.

Page | 275
 Provided- It denotes that the dependency is delivered at runtime by the JDK, web server, or
container.
 Runtime- This indicates that the dependency is not required during compilation but is
necessary during execution.
 Test- It claims that dependencies are only available during the test compilation and execution
phases.
 System- It implies that you must specify the system path.
 Import- This means that the dependencies in that POM's section should be used instead of the
identified or specified POM.

Maven Interview Questions for Experienced

1066. What do you mean by a Maven Archetype? How will you create a new project
based on an Archetype?

Maven Archetype is a Maven plugin that makes it possible to create a project structure based
on a template. These archetypes are essentially project templates that Maven generates when
you create a new project. Archetype is a Maven project templating toolkit, in a nutshell.

After getting to the directory where the project is located, type the command: – mvn
archetype: generate in the command prompt. This aids in creating a new project based on an
archetype.

There are four steps for creating a project from an archetype:

 prepare a repository reference


 the choice of an archetype,
 that archetype's configuration,
 the efficient creation of the project using the data gathered

In most cases, an archetype is procured from a remote repository. You're ready to go if that
repository can be reached using your Maven configuration. You must add the repository to
your settings.xml if the repository is not managed and you wish to refer to it directly.

1067. What command is used to create a new project from a hard drive?

The -mvn archetype: create is used to start a new project.


After reading the source and resource files, as well as the values of its parameters and other
properties, the archetype is constructed.

1068. What are the phases of the clean lifecycle?

The Maven clean lifecycle takes care of eliminating all temporary files from the output
directory, including generated source files, compiled classes, and previous JAR files, among
other things.

Page | 276
 pre-clean- performs tasks that are necessary prior to actual project cleaning.
 clean- delete all files created by the previous build.
 post-clean- performs tasks that are necessary to finalize project cleaning.

1069. What are the phases of the site lifecycle?

Everything related to generating documentation for your project is handled by the Maven site
lifecycle.

 pre-site- performs tasks that are necessary prior to actual project site generation.
 site- develop the project’s site generation.
 post-site- performs tasks that are necessary to finalize project site generation, also prepares for
site deployment.
 site-deploy- deploy the developed site documentation to the web server of your choice.

1070. Explain the three commonly used plugins: clean, surefire, antrun.

Maven clean is a plugin that, as the name implies, attempts to clean the files and directories
generated by Maven during the build process. The target folder, which contains all of the class
files, documentation, and JAR files, is removed by the plugin.

The Surefire Plugin is used to run an application's unit tests during the test phase of the build
lifecycle. It can generate reports in one of two file formats: plain text files or XML files.

The Antrun Plugin allows you to perform Ant tasks directly from within Maven. Your Ant
scripts can even be embedded in the POM!

1071. What is the settings.xml file in Maven?

A Maven installation is configured using the settings.xml file. It's comparable to a pom.xml
file, but it's either global or user-specific. The Maven settings.xml file provides elements that
define the values required to configure Maven's execution in several ways. These values
include the location of the local repository, authentication information, and alternate remote
repository servers among others.

Let's look at the elements in the settings.xml file that we can change. The settings.xml file's
main element, settings, can include up to nine predefined child elements:

<settings xmlns = "http://maven.apache.org/SETTINGS/1.0.0"


xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository/>
<interactiveMode/>
<offline/>
<pluginGroups/>

Page | 277
<servers/>
<mirrors/>
<proxies/>
<profiles/>
<activeProfiles/>
</settings>

The following configurations are included:

 Proxy configuration
 Local repository configuration
 Remote repository configuration
 Central repository configuration

1072. What is dependency mediation and dependency management?

When multiple versions of an artifact are encountered, Maven determines which version of the
dependency should be used. The earliest declared dependence will be used if two dependency
versions are at the same depth in the dependency tree. This is referred to as "dependency
mediation."

Dependency management allows project authors to declare the versions of artifacts that are to
be utilized when they are discovered in transitive dependencies or dependencies that have no
version specified.

1073. What do you mean by the term “system dependency”?

The term "system dependency" refers to the scope system's dependency. These dependencies
are typically used to let Maven know the dependencies the JDK or VM provides. System
dependencies are typically used to resolve dependencies on JDK-provided artifacts. Some
common examples are the Java Authentication and Authorization Service (JAAS) or the JDBC
standard extensions.

1074. What is the use of an Optional Dependency?

When splitting a project into submodules isn't practicable (for some reason), optional
dependencies are employed. The concept is that some of the dependencies are just required for
particular project features and will not be required if those features are not used. Such a feature
should ideally be divided into a sub-module that is dependent on the project's main
functionality. Only non-optional dependencies would be included in this new subproject, as
you'd need them all if you wanted to use the subproject's features.

If a user wants to use functionality associated with an optional dependency, they must
redeclare it in their own project. Optional dependencies save storage and memory. They
prevent troublesome jars from being packed into a WAR, EAR, fat jar, or other formats if they
violate a license agreement or cause classpath difficulties.

Page | 278
1075. What do you understand about ‘Transitive Dependency’ in Maven? What is
dependency exclusion?

By incorporating transitive dependencies automatically, Maven eliminates the need to discover


and define libraries that the dependencies require. According to transitive dependency, if X is
dependent on Y and Y is dependent on Z, then X is dependent on both Y and Z.

The "exclusion" element can be used to exclude any transitive dependency. If X is reliant on Y
and Y is reliant on Z, then X can declare Z as excluded.

1076. What are the elements that must be defined for each external dependency?

The Maven software relies heavily on external dependencies. It is an intrinsic component of


the system without which it is impossible to find dependencies in a system. We'll need the
following information to specify the external dependency:

 It necessitates a group ID that is identical to the library name.


 It necessitates an artifact ID that is identical to the library name.
 The system's dependency scope must be mentioned.
 The system path that corresponds to the project position must be mentioned.

1077. What are user-defined properties?

You have the opportunity to define your own arbitrary properties in addition to the implicit
properties. A POM or a Profile can be used to define properties. The properties defined in a
POM or a Maven Profile can be referenced in Maven just like any other property. User-defined
properties can be used to filter resources via the Maven Resource plugin, or they can be
referenced in a POM. In a Maven POM, here's an example of defining some arbitrary
properties.

<project>
...
<properties>
<arbitrary.property.x>Text</arbitrary.property.x>
<hibernate.version>3.2.1.ga</hibernate.version>
</properties>
...
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>${hibernate.version}</version>
</dependency>
</dependencies>
...
</project>

Page | 279
arbitrary.property.x and hibernate.version are two properties defined in the preceding example.
In a dependency declaration, hibernate.version is mentioned. It's usual practice in Maven
POMs and Profiles to use the period character as a separator in property names. The following
example demonstrates how to define a property in a Maven POM profile.

<project>
...
<profiles>
<profile>
<id>random-profile</id>
<properties>
<arbitrary.property>Text</arbitrary.property>
</properties>
</profile>
</profiles>
...
</project>

1078. Discuss the profile element in settings.xml file.

The settings.xml profile element is a trimmed version of the pom.xml profile element. It is
made up of the elements: activation, repositories, pluginRepositories, and properties. These
four components are the only ones included in the profile elements since they deal with the
build system as a whole (which is what the settings.xml file is for), not individual project
object model settings.

If a profile is activated from settings, its values will override any POM or profiles.xml profiles
with the same ID.

 Activation: The strength of a profile, like that of the POM's profiles, comes from its capacity
to modify specific values only under certain conditions, which are stated via an activation
element.
 Repositories: Repositories are remote collections of projects that Maven utilizes to populate
the build system's local repository.
 pluginRepositories: Maven plugins are a unique form of artifact in themselves. Plugin
repositories may be segregated from other repositories as a result of this. Each of the
pluginRepository components specifies a remote source where Maven can look for new
plugins.
 Properties: Maven properties, like Ant properties, value placeholders. The notation ${X},
where X is the property, can be used to obtain their values anywhere within a POM.

1079. What is maven-release plugin and how does it work?

The maven release plugin is used to automate the build and release process. When maven
executes the maven-release-plugin, the following activities are performed:

Page | 280
 mvn release:clean - clears the workspace from the previous build and prepares it for a new
one.
 mvn release:rollback - If the previous process failed, it rollbacks the workspace.
 mvn release:prepare - It performs the following tasks:
o Checks the local workspace for any uncommitted files.
o Checks for SNAPSHOT dependencies and verifies they aren't present.
o Prepares the final version for release.
o Updates the pom to SCM (SVN/Git/Mercurial/CVS).
o Runs the test cases.
o Executes the ultimate commit to the SCM.
o Tags the script/code.
o Increases the version number and includes the SNAPSHOT as part of the subsequent releases.
 mvn release:perform - fetches the code from the repository and executes the maven goal to
develop and deploy the artifacts.

1080. Why are exclusions made on a dependency-by-dependency basis instead of at the


POM level?

This is primarily to ensure that the dependency graph is predictable, as well as to prevent
inheritance effects from eliminating a dependent that should not be excluded. If you have to
use the method of last resort and add an exclusion, make sure you know which of your
dependencies is causing the undesirable transitive dependency.

The banned dependencies rule can be specified to fail the build if a troublesome dependency is
identified, regardless of path. You'll need to add specific exclusions to each path the enforcer
detects if the build fails.

1081. Explain the default and the advanced configuration inheritance.

The default behavior includes merging the content of the configuration element according to
the element name. If a certain element exists in the child POM, that value becomes the
effective value. The parent value becomes the effective value if the child POM does not have
an element but the parent does. It's important to note that this is solely an XML operation, with
no code or plugin settings involved. Only the elements are involved, not their values.

Advanced configuration inheritance includes adding attributes to the children of the


configuration element to regulate how child POMs inherit configuration from parent POMs.
Combine.children and combine.self are the two attributes. These attributes can be used in a
child POM to regulate how Maven integrates the parent's plugin configuration with the child's
explicit configuration.

1082. Explain Project Aggregation.

Project Aggregation specifies the modules from the parent POM instead of specifying the
parent POM from the module. As a result, the parent project is aware of its modules, and if a

Page | 281
Maven command is issued against the parent project, the Maven command is also applied to
the parent's modules. For Project Aggregation, you must accomplish the following:

 Change the packaging of the parent POMs to "pom."


 Specify the modules' directories in the parent POM (children POMs).

1083. What is the use of the Maven Wagon plugin?

The Maven Wagon Plugin, as its name suggests, allows you to access numerous Maven Wagon
functionalities. To transfer resources to and from Maven repositories, Maven Wagon offers a
layer of abstraction over the core transport protocols. Maven Wagon's unified API includes
implementations for seven transports.

The following picture depicts the architecture of the Maven Wagon:

The plugin allows you to use the wagon to upload resources from your build to a remote site,
get resources from a repository and list the contents of a repository. Finally, it may merge a

Page | 282
Maven repository to another in a generic fashion by merging the upload and download
capabilities.

1084. How is Doxia used by Maven?

Doxia is a content creation framework that aims to give powerful approaches for creating static
and dynamic content to its users: Doxia can be used to create static web pages in a web-based
publication context, as well as in dynamic content creation systems such as blogs, wikis, and
content management systems.

Maven makes substantial use of Doxia, which powers the project's complete documentation
system. It enables Maven to take any Doxia-supported document and output it in any format.

For instance, 'mvn site' is the command used by Maven to produce javadocs for a specific
project. Maven calls Doxia document generation and other report generating plugins when this
command is run.

1085. How will you run JUnit tests in parallel with a Maven build?

It is now possible to run tests in parallel without utilizing TestNG in junit 4.7. It's been feasible
since 4.6, but 4.7 will include a number of improvements that will make it a realistic
alternative. You may also use spring to execute parallel tests.

You can also use this maven plugin:

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.6.0</version>
<configuration>
<parallel>classes</parallel>
<threadCount>4</threadCount>
</configuration>
</plugin>
</plugins>
</build>

1086. How can you skip running the tests for a particular project?

Set the skipTests attribute to true to skip the tests for a certain project.

<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.13.0</version>

Page | 283
<configuration>
<skipTests>true</skipTests>
</configuration>

You may also skip the tests by using the following command from the command line:

mvn install -DskipTests

You can also use the maven.test.skip option to avoid compiling the tests if you have to.
Surefire, Failsafe, and the Compiler Plugin all recognize maven.test.skip.

mvn install -Dmaven.test.skip=true

You must go through a properties section in the pom if you want to skip tests by default but
have the possibility to re-enable tests from the command line:

<properties>
<skipTests>true</skipTests>
</properties>

And,

<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.13.0</version>
<configuration>
<skipTests>${skipTests}</skipTests>
</configuration>

This will allow you to run tests with the default tests disabled and execute them with the
following command:

mvn install -DskipTests=false

The "skip" parameter and other booleans on the plugin can be used in the same way.

1087. What is the difference between the maven package and the maven install?

package: converts the compiled code into a distributable format, such as a JAR.

install: adds the package to the local repository, allowing it to be used as a dependency in
other projects.

Page | 284
CORE JAVA AND OOPS CONCEPT
1088.Is Java platform independent?

Yes. Java is a platform independent language. We can write java code on one platform and run it
on another platform. For e.g. we can write and compile the code on windows and can run the
generated bytecode on Linux or any other supported platform. This is one of the main features of
java.

1089. What all memory areas are allocated by JVM?

Classloader, Class area, Heap, Stack, Program Counter Register and Native Method Stack

1090.Java vs. C ++?

Here are the few differences between Java and C++:

 Platform dependency – C++ is platform dependent while java is platform independent


 No goto support – Java doesn’t support goto statement while C++ does.
 Multiple inheritance – C++ supports multiple inheritance while java does not.
 Multithreading – C++ does not have in-build thread support, on the other hand java
supports multithreading
 Virtual keyword – C++ has virtual keyword, it determines if a member function of a class
can be overridden in its child class. In java there is no concept of virtual keyword.

1091.Explain public static void main(String args[])

Here public is an access modifier, which means that this method is accessible by any class.

static – static keyword tells that this method can be accessed without creating the instance of the
class. Refer: Static keyword in java

void – this main method returns no value.

main – It is the name of the method.

String args[] – The args is an array of String type. This contains the command line arguments
that we can pass while running the program.

Page | 285
1092. What is javac ?

The javac is a compiler that compiles the source code of your program and generates bytecode.
In simple words javac produces the java byte code from the source code written *.java file. JVM
executes the bytecode to run the program.

1093. What is class?

A class is a blueprint or template or prototype from which you can create the object of that class.
A class has set of properties and methods that are common to its objects.

1094.What is the base class of all classes?

java.lang.Object is the base class (super class) of all classes in java.

1095.What is a wrapper class in Java?

A wrapper class converts the primitive data type such as int, byte, char, boolean etc. to the
objects of their respective classes such as Integer, Byte, Character, Boolean etc. Refer: Wrapper
class in Java

1096. What is a path and classPath in Java?

Path specifies the location of .exe files. Classpath specifies the location of bytecode (.class files).

1097.Different Data types in Java.

 byte – 8 bit
 short – 16 bit
 char – 16 bit Unicode
 int – 32 bit (whole number)
 float – 32 bit (real number)
 long – 64 bit (Single precision)
 double – 64 bit (double precision)

1098. What is Unicode?

Java uses Unicode to represent the characters. Unicode defines a fully international character set
that can represent all of the characters found in human languages.

1099.What are Literals?

Any constant value that is assigned to a variable is called literal in Java. For example –

Page | 286
// Here 101 is a literal
int num = 101
1100. Dynamic Initialization?

Dynamic initialization is process in which initialization value of a variable isn’t known at


compile-time. It’s computed at runtime to initialize the variable.

1101.What is Type casting in Java?

When we assign a value of one data type to the different data type then these two data types may
not be compatible and needs a conversion. If the data types are compatible (for example
assigning int value to long) then java does automatic conversion and does not require casting.
However if the data types are not compatible then they need to be casted for conversion.

For example:

//here in the brackets we have mentioned long keyword, this is casting


double num = 10001.99;
long num2 = (long)num;

1102.What is an Array?

An array is a collection (group) of fixed number of items. Array is a homogeneous data structure
which means we can store multiple values of same type in an array but it can’t contain multiple
values of different types. For example an array of int type can only hold integer values.

1103.What is BREAK statement in java?

The break statement is used to break the flow sequence in Java.

 break statement is generally used with switch case data structure to come out of the
statement once a case is executed.
 It can be used to come out of the loop in Java

1104.Arrays can be defined in different ways. Write them down.

int arr[];
int[] arr;
OOPs Interview Questions

Page | 287
1105. Four main principles of OOPS Concepts?

 Inheritance
 Polymorphism
 Data Encapsulation
 Abstraction

1106.What is inheritance?

The process by which one class acquires the properties and functionalities of another class is
called inheritance. Inheritance brings reusability of code in a java application. Refer: Guide
to Inheritance in Java.

1107.Does Java support Multiple Inheritance?

When a class extends more than one classes then it is called multiple inheritance. Java doesn’t
support multiple inheritance whereas C++ supports it, this is one of the difference between java
and C++. Refer: Why java doesn’t support multiple inheritance?

1108.What is Polymorphism and what are the types of it?

Polymorphism is the ability of an object to take many forms. The most common use of
polymorphism in OOPs is to have more than one method with the same name in a single class.
There are two types of polymorphism: static polymorphism and dynamic polymorphism. Refer
these guides to understand the polymorphism concept in detail: 1) Java Polymorphism 2) Types
of Polymorphism

1109. What is method overriding in Java?

When a sub class (child class) overrides the method of super class(parent class) then it is called
overriding. To override a method, the signature of method in child class must match with the
method signature in parent class. Refer: Java – Method Overriding

1110.Can we override a static method?

No, we cannot override a static method in Java.

1111.What is method overloading?

When a class has more than one methods with the same name but different number, sequence or
types of arguments then it is known as method overloading. Refer: Java – Method Overloading

Page | 288
1112. Does Java support operator overloading?

Operator overloading is not supported in Java.

1113.Can we overload a method by just changing the return type and without changing the
signature of method?

No, We cannot do this. To overload a method, the method signature must be different, return
type doesn’t play any role in method overloading.Is it possible to overload main() method of a
class?Yes, we can overload main() method in Java.

1114.What is the difference between method overloading and method overriding?

Refer this guide: Overloading vs overriding in Java

1115.What is static and dynamic binding in Java?

Binding refers to the linking of method call to its body. A binding that happens at compile time
is known as static binding while binding at runtime is known as dynamic binding. Refer: Static
and Dynamic binding in Java.

1116. What is Encapsulation?

Wrapping of the data and code together is known as encapsulation. Refer: Java Encapsulation.

1117.What is an abstract class in Java?

An abstract class is a class which can’t be instantiated (we cannot create the object of abstract
class), we can only extend such classes. It provides the generalised form that will be shared by
all of its subclasses, leaving it to each subclass to fill in the details. We can achieve partial
abstraction using abstract classes, to achieve full abstraction we use interfaces.

1118.What is Interface in java?

An interface is used for achieving full abstraction. A class implements an interface, thereby
inheriting the abstract methods of the interface. Refer: Java Interface

1119.What is the difference between abstract class and interface?

1) abstract class can have abstract and non-abstract methods. An interface can only have abstract
methods.
2) An abstract class can have static methods but an interface cannot have static methods.
3) abstract class can have constructors but an interface cannot have constructors.

Page | 289
1120.Name the access modifiers that can be applied to the inner classes?

public ,private , abstract, final, protected.

1121.What is a constructor in Java?

Constructor is used for creating an instance of a class, they are invoked when an instance of class
gets created. Constructor name and class name should be same and it doesn’t have a return type.
Refer this guide: Java Constructor.

1122. Can we inherit the constructors?

No, we cannot inherit constructors.

1123.Can we mark constructors final?

No, Constructor cannot be declared final.

1124. What is default and parameterized constructors?

Default: Constructors with no arguments are known as default constructors, when you don’t
declare any constructor in a class, compiler creates a default one automatically.

Parameterized: Constructor with arguments are known as parameterized constructors.

1125. Can a constructor call another constructor?

Yes. A constructor can call the another constructor of same class using this keyword. For e.g.
this() calls the default constructor.
Note: this() must be the first statement in the calling constructor.

1126.Can a constructor call the constructor of parent class?

Yes. In fact it happens by default. A child class constructor always calls the parent class
constructor. However we can still call it using super keyword. For e.g. super() can be used for
calling super class default constructor.

Note: super() must be the first statement in a constructor.

1127.THIS keyword?

The this keyword is a reference to the current object.

Page | 290
1128.Can this keyword be assigned null value?

No, this keyword cannot have null values assigned to it.

1129.Explain ways to pass the arguments in Java?

In java, arguments can be passed as call by value – Java only supports call by value, there is no
concept of call by reference in Java.

1130.What is static variable in java?

Static variables are also known as class level variables. A static variable is same for all the
objects of that particular class in which it is declared.

1131. What is static block?

A static block gets executed at the time of class loading. They are used for initializing static
variables.

1132. What is a static method?

Static methods can be called directly without creating the instance (Object) of the class. A static
method can access all the static variables of a class directly but it cannot access non-static
variables without creating instance of class.

1133.Explain super keyword in Java?

super keyword references to the parent class. There are several uses of super keyword:

 It can be used to call the superclass(Parent class) constructor.


 It can be used to access a method of the superclass that has been hidden by subclass
(Calling parent class version, In case of method overriding).
 To call the constructor of parent class.

1134.Use of final keyword in Java?

Final methods – These methods cannot be overridden by any other method.


Final variable – Constants, the value of these variable can’t be changed, its fixed.
Final class – Such classes cannot be inherited by other classes. These type of classes will be
used when application required security or someone don’t want that particular class. Final
Keyword in Java.

Page | 291
1135. What is a Object class?

This is a special class defined by java; all other classes are subclasses of object class. Object
class is superclass of all other classes. Object class has the following methods

 objectClone () – to creates a new object that is same as the object being cloned.
 boolean equals(Object obj) – determines whether one object is equal to another.
 finalize() – Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object. A subclass overrides the finalize
method to dispose of system resources or to perform other cleanup.
 toString () – Returns a string representation of the object.

1136. What are Packages in Java?

A Package can be defined as a grouping of related types (classes, interfaces, enumerations and
annotations). Refer: Package in Java.

1137.What is the difference between import java.util.Date and java.util.* ?

The star form (java.util.* ) includes all the classes of that package and that may increase the
compilation time – especially if you import several packages. However it doesn’t have any effect
run-time performance.

1138. What is static import?

Static import is a feature introduced in the Java programming language that allows members
which have been scoped within their container class as public static, to be used in Java code
without specifying the class in which the field has been defined.

1139. Garbage collection in java?

Since objects are dynamically allocated by using the new operator, java handles the de-allocation
of the memory automatically, when no references to an object exist for a long time. This whole
process is called garbage collection. The whole purpose of Garbage collection is efficient
memory management.

1140.Use of finalize() method in java?

finalize() method is used to free the allocated resource.

1141.How many times does the garbage collector calls the finalize() method for an object?

The garbage collector calls the finalize() method only once for an object.

Page | 292
1142.What are two different ways to call garbage collector?

System.gc() OR Runtime.getRuntime().gc().

1143. Can the Garbage Collection be forced by any means?

No, its not possible. you cannot force garbage collection. you can call system.gc() methods for
garbage collection but it does not guarantee that garbage collection would be done.

Exception handling Interview Questions

1144.What is an exception?

Exceptions are abnormal conditions that arise during execution of the program. It may occur due
to wrong user input or wrong logic written by programmer.

1145.Exceptions are defined in which java package? OR which package has definitions for
all the exception classes?

Java.lang.Exception
This package contains definitions for Exceptions.

1146. What are the types of exceptions?

There are two types of exceptions: checked and unchecked exceptions.


Checked exceptions: These exceptions must be handled by programmer otherwise the program
would throw a compilation error.
Unchecked exceptions: It is up to the programmer to write the code in such a way to avoid
unchecked exceptions. You would not get a compilation error if you do not handle these
exceptions. These exceptions occur at runtime.

1147.What is the difference between Error and Exception?

Error: Mostly a system issue. It always occur at run time and must be resolved in order to
proceed further.
Exception: Mostly an input data issue or wrong logic in code. Can occur at compile time or run
time.

1148.What is throw keyword in exception handling?

The throw keyword is used for throwing user defined or pre-defined exception.

Page | 293
1149.What is throws keyword?

If a method does not handle a checked exception, the method must declare it using the
throwskeyword. The throws keyword appears at the end of a method’s signature.

1150.Difference between throw and throws in Java

Read the difference here: Java – throw vs throws.

1151.Can static block throw exception?

Yes, A static block can throw exceptions. It has its own limitations: It can throw only Runtime
exception (Unchecked exceptions), In order to throw checked exceptions you can use a try-catch
block inside it.

1152. What is finally block?

Finally block is a block of code that always executes, whether an exception occurs or not. Finally
block follows try block or try-catch block.

Q) ClassNotFoundException vs NoClassDefFoundError?
1) ClassNotFoundException occurs when loader could not find the required class in class path.
2) NoClassDefFoundError occurs when class is loaded in classpath, but one or more of the class
which are required by other class, are removed or failed to load by compiler.

1153. Can we have a try block without catch or finally block?

No, we cannot have a try block without catch or finally block. We must have either one of them
or both.

1154.Can we have multiple catch blocks following a single try block?

Yes we can have multiple catch blocks in order to handle more than one exception.

1155.Is it possible to have finally block without catch block?

Yes, we can have try block followed by finally block without even using catch blocks in
between.

1156.When a finally block does not get executed?

The only time finally won’t be called is if you call System.exit() or if the JVM crashes first.

Page | 294
1157.Can we handle more than one exception in a single catch block?

Yes we can do that using if-else statement but it is not considered as a good practice. We should
have one catch block for one exception.

1158. What is a Java Bean?

A JavaBean is a Java class that follows some simple conventions including conventions on the
names of certain methods to get and set state called Introspection. Because it follows
conventions, it can easily be processed by a software tool that connects Beans together at
runtime. JavaBeans are reusable software components.

Java Multithreading Interview Questions

1159. What is Multithreading?

It is a process of executing two or more part of a program simultaneously. Each of these parts is
known as threads. In short the process of executing multiple threads simultaneously is known as
multithreading.

1160. What is the main purpose of having multithread environment?

Maximizing CPU usage and reducing CPU idle time

1161. What are the main differences between Process and thread? Explain in brief.

1) One process can have multiple threads. A thread is a smaller part of a process.
2) Every process has its own memory space, executable code and a unique process identifier
(PID) while every thread has its own stack in Java but it uses process main memory and shares it
with other threads.
3) Threads of same process can communicate with each other using keyword like wait and notify
etc. This process is known as inter process communication.

1162.How can we create a thread in java?

There are following two ways of creating a thread:


1) By Implementing Runnable interface.
2) By Extending Thread class.

1163.Explain yield and sleep?

yield() – It causes the currently executing thread object to temporarily pause and allow other
threads to execute.

Page | 295
sleep() – It causes the current thread to suspend execution for a specified period. When a thread
goes into sleep state it doesn’t release the lock.

1164.What is the difference between sleep() and wait()?

sleep() – It causes the current thread to suspend execution for a specified period. When a thread
goes into sleep state it doesn’t release the lock

wait() – It causes current thread to wait until either another thread invokes the notify() method or
the notifyAll() method for this object, or a specified amount of time has elapsed.

1165.What is a daemon thread?

A daemon thread is a thread, that does not prevent the JVM from exiting when the program
finishes but the thread is still running. An example for a daemon thread is the garbage collection.

1166.What does join( ) method do?

if you use join() ,it makes sure that as soon as a thread calls join,the current thread(yes,currently
running thread) will not execute unless the thread you have called join is finished.

1167.Preemptive scheduling vs. time slicing?

1) The preemptive scheduling is prioritized. The highest priority process should always be the
process that is currently utilized.
2) Time slicing means task executes for a defined slice/ period of time and then enter in the pool
of ready state. The scheduler then determines which task execute next based on priority or other
factor.

1168.Can we call run() method of a Thread class?

Yes, we can call run() method of a Thread class but then it will behave like a normal method. To
actually execute it in a Thread, you should call Thread.start() method to start it.

1169. What is Starvation?

Starvation describes a situation where a thread is unable to gain regular access to shared
resources and is unable to make progress. This happens when shared resources are made
unavailable for long periods by “greedy” threads. For example, suppose an object provides a
synchronized method that often takes a long time to return. If one thread invokes this method
frequently, other threads that also need frequent synchronized access to the same object will
often be blocked.

Page | 296
1170.What is deadlock?

Deadlock describes a situation where two or more threads are blocked forever, waiting for each
other.

Serialization interview Questions

1171.What is Serialization and de-serialization?

Serialization is a process of converting an object and its attributes to the stream of bytes. De-
serialization is recreating the object from stream of bytes; it is just a reverse process of
serialization. To know more about serialization with example program, refer this article.

1172.Do we need to implement any method of Serializable interface to make an object


serializable?

No. In order to make an object serializable we just need to implement the interface Serializable.
We don’t need to implement any methods.

1173. What is a transient variable?

1) transient variables are not included in the process of serialization.


2) They are not the part of the object’s serialized state.
3) Variables which we don’t want to include in serialization are declared as transient.

String interview questions

1174.A string class is immutable or mutable?

String class is immutable that’s the reason once its object gets created, it cannot be changed
further.

1175.Difference between StringBuffer and StringBuilder class?

1) StringBuffer is thread-safe but StringBuilder is not thread safe.


2) StringBuilder is faster than StringBuffer.
3) StringBuffer is synchronized whereas StringBuilder is not synchronized.

1176.What is toString() method in Java?

The toString() method returns the string representation of any object.

Page | 297
Java collections interview questions

1177. What is List?

Elements can be inserted or accessed by their position in the list, using a zero-based index.
A list may contain duplicate elements.

1178 What is Map?

Map interface maps unique keys to values. A key is an object that we use to retrieve a value
later. A map cannot contain duplicate keys: Each key can map to at most one value.

1179.What is Set?

A Set is a Collection that cannot contain duplicate elements.

1180. Why ArrayList is better than Arrays?

Array can hold fixed number of elements. ArrayList can grow dynamically.

1181. What is the difference between ArrayList and LinkedList?

1) LinkedList store elements within a doubly-linked list data structure. ArrayList store elements
within a dynamically resizing array.
2) LinkedList is preferred for add and update operations while ArrayList is a good choice for
search operations. Read more here.

1182.For addition and deletion. Which one is most preferred: ArrayList or LinkedList?

LinkedList. Because deleting or adding a node in LinkedList is faster than ArrayList.

1183.For searches. Which one is most preferred: ArrayList or LinkedList?

ArrayList. Searching an element is faster in ArrayList compared to LinkedList.

1184. What is the difference between ArrayList and Vector?

1) Vector is synchronized while ArrayList is not synchronized.


2) By default, Vector doubles the size of its array when it is re-sized internally. ArrayList
increases by half of its size when it is re-sized. More details.

Page | 298
1185.What is the difference between Iterator and ListIterator?

Following are the major differences between them:


1) Iterator can be used for traversing Set, List and Map. ListIterator can only be used for
traversing a List.
2) We can traverse only in forward direction using Iterator. ListIterator can be used for traversing
in both the directions(forward and backward). Read more at: ListIterator vs Iterator.

1186.Difference between TreeSet and SortedSet?

TreeSet implements SortedSet interface.

1187.What is the difference between HashMap and Hashtable?

1) Hashtable is synchronized. HashMap is not synchronized.


2) Hashtable does not allow null keys or values. HashMap allows one null key and any number
of null values. Read more here.

1188.What is the difference between Iterator and Enumeration?

1) Iterator allows to remove elements from the underlying collection during the iteration using its
remove() method. We cannot add/remove elements from a collection when using enumerator.
2) Iterator has improved method names.
Enumeration.hasMoreElement() -> Iterator.hasNext()
Enumeration.nextElement() -> Iterator.next().

Applet Interview Questions

1189. How do you do file I/O from an applet?

Unsigned applets are simply not allowed to read or write files on the local file system .

Unsigned applets can, however, read (but not write) non-class files bundled with your applet on
the server, called resource files

1190.What is container ?

A component capable of holding another component is called as container.


Container
Panel
Applet
Window
Frame
Dialog

Page | 299
1191.On Windows, generally frames are invisible, how to make it visible?

Frame f = new Frame();


f.setSize(300,200); //height and width
f.setVisible(true) ; // Frames appears

1192. Listeners and corresponding Methods?

ActionListerner – actionPerformed();
ItemListerner – itemStateChanged();
TextListener – textValueChanged();
FocusListener – focusLost(); & FocusGained();
WindowListener – windowActified(); windowDEactified(); windowIconified();
windowDeiconified(); windowClosed(); windowClosing(); windowOpened();
MouseMotionListener – mouseDragged(); & mouseMoved();
MouseListener – mousePressed(); mouseReleased(); mouseEntered(); mouseExited();
mouseClicked();

1193.Applet Life cycle?

Following stage of any applets life cycle, starts with init(), start(), paint(), stop() and destroy().

1194.Use of showStatus() method in Java

To display the message at the bottom of the browser when applet is started.

1195.What is Event handling in Java?

Is irrespective of any component, if any action performed/done on Frame, Panel or on window,


handling those actions are called Event Handling.

1196.What is Adapter class?

Adapter class is an abstract class.


Advantage of adapter: To perform any window listener, we need to include all the methods used
by the window listener whether we use those methods are not in our class like Interfaces whereas
with adapter class, its sufficient to include only the methods required to override. Straight
opposite to Interface.

Page | 300
TESTNG
1197. What is TestNG?
Ans. TestNG(NG for Next Generation) is a testing framework that can be integrated with
selenium or any other automation tool to provide multiple capabilities like assertions, reporting,
parallel test execution, etc.

1198. What are some advantages of TestNG?


Ans. Following are the advantages of TestNG-
1. TestNG provides different assertions that help in checking the expected and actual
results.
2. It provides parallel execution of test methods.
3. We can define the dependency of one test method over others in TestNG.
4. We can assign priority to test methods in Selenium.
5. It allows the grouping of test methods into test groups.
6. It allows data-driven testing using @DataProvider annotation.
7. It has inherent support for reporting.
8. It has support for parameterizing test cases using @Parameters annotation.

1199. How is TestNG different from Selenium WebDriver?


Ans. Selenium is an automation tool using which we can automate web-based applications. In
order to add testing capabilities in the Test Automation suites – Selenium is clubbed with
TestNG. With TestNG, we can have different features in our automation suite like different types
of assertions, reporting, parallel execution, parameterization, etc.
In short, for doing Automation Testing, Selenium helps with ‘automation’ and TestNG helps
with ‘testing’ capabilities.

1200. What is the use of the testng.xml file?


Ans. The testng.xml file is used for configuring the whole test suite. In the testng.xml file, we
can create a test suite, create test groups, mark tests for parallel execution, add listeners, and pass
parameters to test scripts. We can also use this testng.xml file for triggering the test suite from
the command prompt/terminal or Jenkins.

1201. How can we group test cases like separate test cases for the Sanity suite, Regression
suite, etc?
Ans. Using the groups attribute in TestNG, we can assign the test methods to different groups.
//Test method belonging to sanity suite only

@Test(groups = {"sanitySuite"})

public void testMethod1() {

//Test logic

Page | 301
}

//Test method belonging to both sanity and regression suite

@Test(groups = {"sanitySuite", "regressionSuite"})

public void testMethod2() {

//Test logic

1202. How can we exclude a Test method from getting executed via the testng.xml file?
Ans. Using the exclude tag in the testng.xml file, we can exclude a particular test method from
getting executed.
<suite name="Test Suite" verbose="1">

<test name="TestName">

<classes>

<class name="TestClassName">

<methods>

<exclude name="testMethodToBeExcluded"/>

</methods>

</class>

</classes>

</test>

</suite>

Page | 302
1203. What are some commonly used TestNG annotations?
Ans. The commonly used TestNG annotations are-
 @Test – @Test annotation marks a method as a Test method.
 @BeforeSuite – The annotated method will run only once before all tests in this suite
have run.
 @AfterSuite – The annotated method will run only once after all tests in this suite have
run.
 @BeforeClass – The annotated method will run only once before the first test method in
the current class is invoked.
 @AfterClass – The annotated method will run only once after all the test methods in the
current class have been run.
 @BeforeTest – The annotated method will run before any test method belonging to the
classes inside the <test> tag is run.
 @AfterTest – The annotated method will run after all the test methods belonging to the
classes inside the <test> tag have run.
 @BeforeMethod – The annotated method will run before each test method marked by
@Test annotation.
 @AfterMethod – The annotated method will run after each test method marked by @Test
annotation.
 @DataProvider – The @DataProvider annotation is used to pass test data to the test
method. The test method will run as per the number of rows of data passed via the data
provider method.

1204. What is the order of execution of the test method based on the different annotations?
Ans. The test methods in TestNG follow the Suite->Test->Class->Method sequence combined
with the Before annotations->Test annotations->After annotations sequence. So, the order of
execution is-
@BeforeSuite
@BeforeTest
@BeforeClass
@BeforeMethod
@Test
@AfterMethod
@AfterClass
@AfterTest
@AfterSuite

1205. What are some common assertions provided by TestNG?


Ans. Some of the common assertions provided by testNG are-
1. assertEquals(String actual, String expected, String message) and other overloaded data
types in parameter
2. assertNotEquals(double data1, double data2, String message) and other overloaded data
types in parameter
3. assertFalse(boolean condition, String message)
4. assertTrue(boolean condition, String message)

Page | 303
5. assertNotNull(Object object)
6. fail(boolean condition, String message)
7. true(String message)

1206. How can we disable or prevent a test case from running?


Ans. By setting the “enabled” attribute as false, we can disable a test method from running.
//In case of a test method

@Test(enabled = false)

public void testMethod1() {

//Test logic

//In case of test method belonging to a group

@Test(groups = {"NegativeTests"}, enabled = false)

public void testMethod2() {

//Test logic

1207. How can we make one test method dependent on others using TestNG?
Ans. Using dependsOnMethods parameter inside @Test annotation in TestNG we can make one
test method run only after the successful execution of the dependent test method.
@Test(dependsOnMethods = { "preTests" })

1208. How can we set the priority of test cases in TestNG?


Ans. We can define the priority of test cases using the “priority” parameter in the @Test
annotation. The tests with lower priority values will get executed first. Example-
@Test(priority=1)

1209. What is the default priority of test cases in TestNG?


Ans. The default priority of a test when not specified is integer value 0. So, if we have one test
case with priority 1 and one without any priority then the test without any priority value will get
executed first (as the default value will be 0 and tests with lower priority are executed first).

Page | 304
1210. How can we run a Test method multiple times in a loop(without using any data
provider)?
Ans. Using invocationCount parameter and setting its value to an integer value, makes the test
method runs n number of times in a loop.
@Test(invocationCount = 10)

public void invocationCountTest(){

//Test logic

1211. What is threadPoolSize? How can we use it?


Ans. The threadPoolSize attribute specifies the number of threads to be assigned to the test
method. This is used in conjunction with invocationCount attribute. The number of threads will
get divided by the number of iterations of the test method specified in the invocationCount
attribute.
@Test(threadPoolSize = 5, invocationCount = 10)

public void threadPoolTest(){

//Test logic

1212. What is the difference between soft assertion and hard assertion in TestNG?
Ans. This is one of the most frequently asked TestNG interview questions. Soft assertions
(SoftAssert) allow us to have multiple assertions within a test method, even when an assertion
fails the test method continues with the remaining test execution. The result of all the assertions
can be collated at the end using softAssert.assertAll() method.
@Test

public void softAssertionTest(){

SoftAssert softAssert= new SoftAssert();

//Assertion failing

softAssert.fail();
Page | 305
System.out.println("Failing");

//Assertion passing

softAssert.assertEquals(1, 1);

System.out.println("Passing");

//Collates test results and marks them pass or fail

softAssert.assertAll();

Here, even though the first assertion fails still the test will continue with execution and print the
message below the second assertion.
Hard assertions on the other hand are the usual assertions provided by TestNG. In case of hard
assertion in case of any failure, the test execution stops, preventing the execution of any further
steps within the test method.

1213. How to fail a testNG test if it doesn’t get executed within a specified time?
Ans. We can use the timeOut attribute of @Test annotation. The value assigned to this timeOut
attribute will act as an upper bound. If the test doesn’t get executed within this time frame then it
will fail with timeout exception.
@Test(timeOut = 1000)

public void timeOutTest() throws InterruptedException {

//Sleep for 2sec so that test will fail

Thread.sleep(2000);

System.out.println("Will throw Timeout exception!");

1214. How can we skip a test case conditionally?


Ans. Using SkipException, we can conditionally skip a test case. On throwing the skipException,
the test method is marked as skipped in the test execution report and any statement after
throwing the exception will not get executed.
@Test
Page | 306
public void testMethod(){

if(conditionToCheckForSkippingTest)

throw new SkipException("Skipping the test");

//test logic

1215. How can we make sure a test method runs even if the test methods or groups on
which it depends fail or get skipped?
Ans. Using the “alwaysRun” attribute of @Test annotation, we can make sure the test method
will run even if the test methods or groups on which it depends fail or get skipped.
@Test

public void parentTest() {

Assert.fail("Failed test");

@Test(dependsOnMethods={"parentTest"}, alwaysRun=true)

public void dependentTest() {

System.out.println("Running even if parent test failed");

Here, even though the parentTest failed, the dependentTest will not get skipped instead it will
get executed because of “alwaysRun=true”. In case, we remove the “alwaysRun=true” attribute
from @Test then the report will show one failure and one skipped test, without trying to run
the dependentTest method.

1216. How can we pass the parameter to the test the script using TestNG?
Ans. Using @Parameter annotation and the ‘parameter’ tag in testng.xml we can pass parameters
to test scripts.
Sample testng.xml –
<suite name="sampleTestSuite">

Page | 307
<test name="sampleTest">

<parameter name="sampleParamName" value="sampleParamValue"/>

<classes>

<class name="TestFile" />

</classes>

</test>

</suite>

Sample test script-

public class TestFile {

@Test

@Parameters("sampleParamName")

public void parameterTest(String paramValue) {

System.out.println("Value of sampleParamName is - " + sampleParamName);

1217. How can we create data-driven framework using TestNG?


Ans. Using @DataProvider we can create a data-driven framework in which data is passed to the
associated test method and multiple iterations of the test run for the different test data values
passed from the @DataProvider method. The method annotated with @DataProvider annotation
return a 2D array of object.
//Data provider returning 2D array of 3*2 matrix

@DataProvider(name = "dataProvider1")

public Object[][] dataProviderMethod1() {

Page | 308
return new Object[][] {{"kuldeep","rana"}, {"k1","r1"},{"k2","r2"}};

//This method is bound to the above data provider returning 2D array of 3*2 matrix

//The test case will run 3 times with different set of values

@Test(dataProvider = "dataProvider1")

public void sampleTest(String s1, String s2) {

System.out.println(s1 + " " + s2);

1218. What is the use of @Listener annotation in TestNG?


Ans. TestNG provides us with different kinds of listeners using which we can perform some
action in case an event gets triggered. Usually, testNG listeners are used for configuring reports
and logging. One of the most widely used listeners in testNG is the ITestListener interface. It has
methods like onTestSuccess, onTestFailure, onTestSkipped, etc. We need to implement this
interface by creating a listener class of our own. After that using the @Listener annotation we
can use specify that for a particular test class, our customized listener class should be used.
@Listeners(PackageName.CustomizedListenerClassName.class)

public class TestClass {

WebDriver driver= new FirefoxDriver();@Test

public void testMethod(){

//test logic

Page | 309
1219. What is the use of @Factory annotation in TestNG?
Ans. @Factory annotation helps in the dynamic execution of test cases. Using @Factory
annotation we can pass parameters to the whole test class at run time. The parameters passed can
be used by one or more test methods of that class.
For example – there are two classes TestClass and the TestFactory class. Because of the
@Factory annotation, the test methods in class TestClass will run twice with the data “k1” and
“k2”
public class TestClass{

private String str;

//Constructor

public TestClass(String str) {

this.str = str;

@Test

public void TestMethod() {

System.out.println(str);

public class TestFactory{

//The test methods in class TestClass will run twice with data "k1" and "k2"

@Factory

Page | 310
public Object[] factoryMethod() {

return new Object[] { new TestClass("K1"), new TestClass("k2") };

1220. What is the difference between @Factory and @DataProvider annotation?


Ans. @Factory method creates instances of test class and runs all the test methods in that class
with a different set of data.
Whereas, @DataProvider is bound to individual test methods and runs the specific methods
multiple times.

1221. How can we run test cases in parallel using TestNG?


Ans. In order to run the tests in parallel just add these two key-value pairs inside the suite tag of
the testng.xml file-
 parallel=”{methods/tests/classes}”
 thread-count=”{number of threads you want to run simultaneously}”.
<suite name="ArtOfTestingTestSuite" parallel="methods" thread-count="5">

1222. What is timeOut in TestNG?


Answer: If any method in the script takes a long time to execute, then we can terminate
that method using “timeout” in TestNG.
@Test(timeout = 5000)

In this case, the method will get terminated in 5000 ms (5 seconds) and the test case is
marked as “Failed”.

Page | 311
SELENIUM

1223. What is Selenium?


Ans. Selenium is a robust test automation suite that is used for automating web-based
applications. It supports multiple browsers, programming languages, and platforms.

1224. What are the different forms of Selenium?


Ans. Selenium comes in four forms-

1. Selenium WebDriver – Selenium WebDriver is used to automate web applications by


directly calling the browser’s native methods.
2. The Selenium IDE Plugin – Selenium IDE is an open-source test automation tool that
works on record and playback principles.
3. Selenium RC component – Selenium Remote Control(RC) is officially deprecated by
Selenium and it used to work using javascript to automate web applications.
4. Selenium Grid – Allows Selenium tests to run in parallel across multiple machines.

1225. What are some advantages of Selenium?


Ans. Following are the advantages of Selenium-

1. Selenium is open source and free to use without any licensing cost.
2. It supports multiple languages like Java, Ruby, Python, etc.
3. Selenium supports multi-browser testing.
4. It has vast resources and helping-community over the internet.
5. Using the Selenium IDE component, non-programmers can also write automation scripts.
6. Using the Selenium Grid component, distributed testing can be carried out on remote
machines.

1226. What are some limitations of Selenium?


Ans. Following are the limitations of Selenium-

1. We cannot test desktop applications using Selenium.


2. We cannot test web services using Selenium.
3. Programming language knowledge is required for creating robust scripts in Selenium
Webdriver.
4. Also, we have to rely on external libraries and tools for performing tasks like –
logging(log4J), testing framework-(TestNG, JUnit), reading from external files (POI for
excels), etc.

Page | 312
1227. Which browsers/drivers are supported by Selenium Webdriver?
Ans. Some commonly used browsers supported by Selenium are-

1. Google Chrome – ChromeDriver


2. Firefox – FireFoxDriver
3. Internet Explorer – InternetExplorerDriver
4. Safari – SafariDriver
5. HtmlUnit (Headless browser) – HtmlUnitDriver
6. Android – Selendroid/Appium
7. IOS – ios-driver/Appium

1228. What is Selenium 4 and how is it different from other Selenium versions?
Ans. Selenium 4 is the latest version of Selenium that is W3C (World Wide Web
Consortium) compliant. In simple words, this makes the Selenium test suites more stable and
reduces compatibility issues across different Web browsers.

Those who have used Selenium 3 and lower version would know that a Selenium test uses JSON
wire protocol to communicate with web browsers. In the case of Selenium 4 there is no need for
encoding and decoding the API requests using the JSON wire protocol for communication
between browsers and test scripts. This allows the WebDriver to interact directly with the target
browser.

1229. What are some features of Selenium 4?


Ans. The different features of Selenium 4 are-

 It is W3C compliant. This makes the cross-browser tests more stable.


 A new Selenium 4 IDE for both Chrome and Firefox is introduced.
 The Selenium 4 IDE tests can be exported to desired programming languages – C#, Java,
Javascript, etc.
 The Selenium Grid feature is more user-friendly and comes with docker support (a set of
platform-as-a-service products that use OS-level virtualization to deliver software in
packages called containers).
 Documentation is more detailed and improved in Selenium 4.

1230. Can we test APIs or web services using Selenium Webdriver?


Ans. No. Selenium WebDriver uses the browser’s native method to automate web applications.
So, there is no support for testing web services using Selenium WebDriver.

1231. What are the various ways of locating an element in Selenium?


Ans. The different locators in Selenium are-

Page | 313
1. Id
2. XPath
3. CSS selector
4. className
5. tagName
6. name
7. link text
8. partialLinkText

1232. How can we inspect the web element attributes in order to use them in different
locators?
Ans. In order to locate web elements, we can use the Developer tool and plugins like Firebug.
We can launch the developer tool by pressing F12 on the browser. Users can easily hover over
any element and find its different HTML properties.

Firebug is a plugin of Firefox that provides various development tools for debugging
applications. From an automation perspective, we use Firebug specifically for inspecting web
elements in order to find their attributes like id, class, name, etc. in different locators.

1233. What is an XPath?


Ans. Xpath or XML path is a query language that is used for selecting nodes from XML
documents. Also, it is one of the locators supported by Selenium Webdriver.

1234. What is an absolute XPath?


Ans. An absolute XPath is a way of locating an element using an XML expression, beginning
from the root node i.e. HTML node in the case of web pages.

The main disadvantage of absolute XPath is that even if there is a slight change in the UI or any
element, the whole XPath will fail.
Example – html/body/div/div[2]/div/div/div/div[1]/div/input

1235.13. What is a relative XPath?


Ans. A relative XPath is a way of locating an element using an XML expression, starting from
anywhere in the HTML document.

In this way, there are different ways of creating robust relative XPaths that have minimal or no
change with the changes in other UI elements.
Example – //input[@id=’username’]

Page | 314
1236. What is the difference between a single slash(/) and a double slash(//) in XPath?
Ans. In XPath, a single slash is used for creating absolute XPaths, beginning from the root node.
Whereas double slash is used for creating relative XPaths.

1237. How can we locate an element by only partially matching the value of its attributes in
Xpath?
Ans. Using contains() method we can locate an element by partially matching its attribute’s
value. This is particularly helpful in scenarios where the attributes have dynamic values with a
certain constant part.

xPath expression = //*[contains(@name,'user')]

Basically, the above statement will match all the values of the name attribute containing the word
‘user’ in them.

1238. How can we locate elements using their text in XPath?


Ans. Using the text() method –

xPathExpression = //*[text()='username']

1239. How can we move to the parent of an element using XPath?


Ans. Using ‘/..’ after the XPath expression of the child element, we can move to the parent of an
element.
For example, the locator //div[@id=”childId”]/.. will move to the parent of the div element with
id value as ‘childId’.

1240. How can we move to the nth-child element using XPath?


Ans. Basically, there are two ways of navigating to the nth element using XPath-

 Using square brackets with index position-


Example – div[2] will find the second div element.
 Using position()-
Example – div[position()=3] will find the third div element.

1241. What is the syntax of finding elements by class using CSS Selector?
Ans. By using .className in the CSS locator, we can select all the elements belonging to a
particular class e.g. ‘.red’ will select all elements having class ‘red’.

Page | 315
1242. What is the syntax of finding elements by id using CSS Selector?
Ans. By using #idValue in the CSS locator, we can select all the elements belonging to a
particular class e.g. ‘#userId’ will select the element having an id – userId.

1243. How can we select elements by their attribute value using the CSS Selector?
Ans. Using [attribute=value] in the CSS locator, we can select all the elements belonging to a
particular class e.g. ‘[type=small]’ will select the element having attribute type of value ‘small’.

1244. How can we move to the nth-child element using the CSS selector?
Ans. Using :nth-child(n) in the CSS locator, we can move to the nth child element e.g. div:nth-
child(2) will locate the 2nd div element of its parent.

1245. What is the fundamental difference between XPath and CSS selectors?
Ans. The fundamental difference between XPath and CSS selector is – using XPaths we can
traverse up in the document i.e. we can move to parent elements. Whereas using the CSS
selector, we can only move downwards in the document.

Selenium Java Interview Questions


1246. How can we launch different browsers in Selenium WebDriver?
Ans. By creating an instance of the desired browser driver e.g. below command will initialize the
Firefox browser.

WebDriver driver = new FirefoxDriver();

1247. What is the use of driver.get(“URL”) and driver.navigate().to(“URL”) commands? Is


there any difference between the two?
Ans. Both driver.get(“URL”) and driver.navigate().to(“URL”) commands are used to navigate to
a URL passed as a parameter.
There is a minor difference between the two commands-

1. driver.navigate() allows moving back and forward in browser history with the help of
driver.navigate().forward() and driver.navigate().back() commands.
2. In the case of single-page applications (where the URL is appended by ‘#’ to navigate to
different sections of the page)-
driver.navigate().to() navigates to a particular section by changing the URL without
refreshing the page.
Whereas driver.get() refreshes the page.

This refreshing of the page is also the primary reason why history is not maintained in the
case of the driver.get() command.
Reference – Stack overflow

Page | 316
1248. How can we type text in a textbox element using Selenium?
Ans. With the help of the sendKeys() method, we can type text in a textbox-

WebElement searchTextBox = driver.findElement(By.id("srch"));

searchTextBox.sendKeys("searchTerm");

1249. How can we clear a text written in a textbox?


Ans. In order to delete the text written in a textbox, we can use the clear() method.

driver.findElement(By.id("elementLocator")).clear();

1250. How to check a checkbox in Selenium?


Ans. The same click() method that we use for clicking buttons or radio buttons can be used for
checking the checkbox as well.

1251. How can we submit a form in Selenium?


Ans. Using the submit() method we can submit a form in selenium.

driver.findElement(By.id("form1")).submit();

Also, we can use the click() method for the same purpose.

1251. Explain the difference between close and quit commands.


Ans. The difference between close and quit commands is-
driver.close() – Used to close the current browser having a focus.
driver.quit() – Used to close all the browser instances.

1252. How to switch between multiple windows in Selenium?


Ans. Selenium
has driver.getWindowHandles() and driver.switchTo().window(“{windowHandleName}”) c
ommands to work with multiple windows.

The getWindowHandles() command returns a list of ids corresponding to each window. If we


pass a particular window handle to
the driver.switchTo().window(“{windowHandleName}”) command then we can switch
control/focus to that particular window.
for (String windowHandle : driver.getWindowHandles()) {

driver.switchTo().window(handle);

Page | 317
}

1253. What is the difference between driver.getWindowHandle() and


driver.getWindowHandles() in Selenium?
Ans. The driver.getWindowHandle() returns a handle of the current window (a single unique
identifier).
Whereas driver.getWindowHandles() returns a set of handles of all the windows available.

1254. How can we move to a particular frame in Selenium?


Ans. The driver.switchTo() command is used for switching to a particular iframe.

driver.switchTo().frame("{frameIndex/frameId/frameName}");

For locating a frame, we can either use the index (starting from 0), its name, or its Id.

1255. Can we move back and forward in the browser using Selenium?
Ans. Yes, using driver.navigate().back() and driver.navigate().forward() commands, we can
move backward and forward in a browser.

1256. What are the different ways to refresh a browser?


Ans. There a multiple ways to refresh a page in Selenium-

 Using driver.navigate().refresh() command.


 Using sendKeys(Keys.F5) on any textbox on the webpage.
 By using driver.get(“URL”) on the current URL or using driver.getCurrentUrl().
 Using driver.navigate().to(“URL”) on the current URL
or driver.navigate().to(driver.getCurrentUrl());

1257. How can we maximize the browser window in Selenium?


Ans. We can maximize the browser window using the following command-

driver.manage().window().maximize();

1258. How can we fetch a text written over an element?


Ans. Using the getText() method we can fetch the text over an element.
String text = driver.findElement("elementLocator").getText();

Page | 318
1259. How can we find the value of different attributes like name, class, and value of an
element?
Ans. Using getAttribute(“{attributeName}”) method, we can find the value of different attributes
of an element e.g.-
String valueAttribute =

driver.findElement(By.id("locator")).getAttribute("value");

1260. How to delete cookies in Selenium?


Ans. Using deleteAllCookies() method.

driver.manage().deleteAllCookies();

1261. What is an implicit wait in Selenium?


Ans. An implicit wait is a type of wait that waits for a specified time while locating an element
before throwing NoSuchElementException. By default, Selenium tries to find web elements
immediately when required without any wait. So, it is good to use implicit wait. This wait is
applied to all the elements of the current driver instance.

driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);

1262. What is an explicit wait in Selenium?


Ans. An explicit wait is a type of wait that is applied to a particular web element until the
expected condition specified is met.

WebDriverWait wait = new WebDriverWait(driver, 10);

WebElement element =
wait.until(ExpectedConditions.elementToBeClickable(By.id("elementId")));

It is advisable to use explicit waits over implicit waits because a higher timeout value of implicit
wait (set for handling only some of the slow elements) gets applied to all the web elements. Thus
increasing the overall execution time of the script. On the other hand, we can apply different
timeouts to the different elements in case of explicit waits.

1263. What are some expected conditions in Explicit waits?


Ans. Some of the commonly used expected conditions of an element in explicit waits are-

 elementToBeClickable(WebElement element or By locator)


 stalenessOf(WebElement element)
 visibilityOf(WebElement element)
 visibilityOfElementLocated(By locator)
 invisibilityOfElementLocated(By locator)

Page | 319
 attributeContains(WebElement element, String attribute, String value)
 alertIsPresent()
 titleContains(String title)
 titleIs(String title)
 textToBePresentInElementLocated(By, String)

1264. What is a fluent wait?


Ans. A fluent wait is a type of wait in which we can also specify polling interval (the time
intervals after which driver will try to find the elements when not located) along with the
maximum timeout value.

Wait wait = new FluentWait(driver)

.withTimeout(20, SECONDS)

.pollingEvery(5, SECONDS)

.ignoring(NoSuchElementException.class);

WebElement textBox = wait.until(new Function<webdriver,webElement>() {

public WebElement apply(WebDriver driver) {

return driver.findElement(By.id("textBoxId"));

Page | 320
}

);

1265. What are the different keyboard operations that can be performed in Selenium?
Ans. The different keyboard operations that can be performed in Selenium are-

1. .sendKeys(“sequence of characters”) – Used for passing character sequence to an input


or textbox element.
2. .pressKey(“non-text keys”) – Used for keys like control, function keys etc that are non-
text.
3. .releaseKey(“non-text keys”) – Used in conjunction with the keypress event to simulate
releasing a key from the keyboard event.

1266. What are the different mouse actions that can be performed using Selenium?
Ans. The different mouse events supported in Selenium are-

1. click(WebElement element)
2. doubleClick(WebElement element)
3. contextClick(WebElement element)
4. mouseDown(WebElement element)
5. mouseUp(WebElement element)
6. mouseMove(WebElement element)
7. mouseMove(WebElement element, long xOffset, long yOffset)

1267. Write the code to double-click an element.


Ans. Code to double-click an element-

Actions action = new Actions(driver);

WebElement element=driver.findElement(By.id("elementId"));

action.doubleClick(element).perform();

1268. Write the code to right-click an element.


Ans. Code to right-click an element in selenium-

Actions action = new Actions(driver);

WebElement element=driver.findElement(By.id("elementId"));

Page | 321
action.contextClick(element).perform();

1269. How to mouse hover an element in Selenium?


Ans. Code to mouse hover over an element-

Actions action = new Actions(driver);

WebElement element=driver.findElement(By.id("elementId"));

action.moveToElement(element).perform();

1270. How to fetch the current page URL in Selenium?


Ans. In order to fetch the current page URL, we can use the getCurrentURL() command.

driver.getCurrentUrl();

1271. How can we fetch the title of the page in Selenium?


Ans. Using driver.getTitle() command, we can fetch the page title in Selenium. This method
returns a string containing the title of the webpage.

1272. How can we fetch the page source in Selenium?


Ans. Using the driver.getPageSource() command, we can fetch the page source in selenium.
This method returns a string containing the page source.

1273. How to verify tooltip text using Selenium?


Ans. Tooltips web elements have an attribute of type ‘title’. By fetching the value of the ‘title’
attribute, we can verify the tooltip text in selenium.

String toolTipText = element.getAttribute("title");

1274. How to locate a link using its text in Selenium?


Ans. Using linkText() and partialLinkText() methods, we can locate a link. The difference
between the two is – linkText() matches the complete string passed as a parameter to the link
texts. Whereas partialLinkText() only matches the string parameter partially.

WebElement link1 = driver.findElement(By.linkText("artOfTesting"));

WebElement link2 = driver.findElement(By.partialLinkText("artOf"));

Page | 322
1275. What are DesiredCapabilities in Selenium WebDriver?
Ans. Desired capabilities are a set of key-value pairs that are used for storing or configuring
browser-specific properties. For example – the browser’s version, platform, etc in the browser
instances.

1276. How can we find all the links on a web page?


Ans. All the links are of anchor tag ‘a’. So by locating elements of tagName ‘a’ we can find all
the links on a webpage.

List<WebElement> links = driver.findElements(By.tagName("a"));

1277. What are some commonly encountered exceptions in Selenium?


Ans. Some of the commonly seen exceptions in Selenium are-

 NoSuchElementException – When no element could be located by the locator provided.


 ElementNotVisibleException – When an element is present in the DOM but is not
visible.
 NoAlertPresentException – When we try to switch to an alert box but the targetted alert
is not present.
 NoSuchFrameException – When we try to switch to a frame but the targetted frame is not
present.
 NoSuchWindowException – When we try to switch to a window but the targetted
window is not present.
 UnexpectedAlertPresentException – When an unexpected alert blocks the normal
interaction of the driver.
 TimeoutException – When a command execution gets a timeout.
 InvalidElementStateException – When the state of an element is not appropriate for the
desired action.
 NoSuchAttributeException – When we are trying to fetch an attribute’s value but the
attribute is not correct.
 WebDriverException – When there is some issue with the driver instance preventing it
from getting launched.

1278. How can we capture screenshots using Selenium?


Ans. In order to take screenshots in Selenium, we can use the getScreenshotAs method of the
TakesScreenshot interface.

File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);

FileUtils.copyFile(scrFile, new File("D:\\testScreenShot.jpg"));

Page | 323
1279. How to handle dropdowns in Selenium?
Ans. Using Select class-

Select countriesDropDown = new Select(driver.findElement(By.id("countries")));

dropdown.selectByVisibleText("India");

//or using index of the option starting from 0

dropdown.selectByIndex(1);

//or using its value attribute

dropdown.selectByValue("Ind");

1280. How to check which option in the dropdown is selected?


Ans. Using is Selected() method, we can check the state of a dropdown’s option.

Select countriesDropDown = new Select(driver.findElement(By.id("countries")));

dropdown.selectByVisibleText("India");

//returns true or false value

System.out.println(driver.findElement(By.id("India")).isSelected());

1281. How can we check if an element is getting displayed on a web page?


Ans. Using the isDisplayed() method we can check if an element is getting displayed on a web
page.

driver.findElement(By locator).isDisplayed();

1282. How can we check if an element is enabled for interaction on a web page?
Ans. Using the isEnabled method, we can check if an element is enabled or not.

driver.findElement(By locator).isEnabled();

Page | 324
1283. What is the difference between driver.findElement() and driver.findElements()
commands?
Ans. The difference between driver.findElement() and driver.findElements() commands is-

 findElement() returns a single WebElement (found first) based on the locator passed as a
parameter. Whereas findElements() returns a list of WebElements, all satisfying the
locator value passed.

 Syntax of findElement()-
WebElement textbox = driver.findElement(By.id(“textBoxLocator”));

Whereas the syntax of findElements()-


List <WebElement> elements = driver.findElements(By.id(“value”));

 Another difference between the two is – if no element is found then findElement() throws
NoSuchElementException whereas findElements() returns a list of 0 elements.

1284. How can we handle window UI elements and window POP-ups using selenium?
Ans. Selenium is used for automating web-based applications only(or browsers only). If we want
to handle window GUI elements then we can use tools like AutoIT.

AutoIT is a freeware used for automating Windows GUI. The AutoIt scripts follow the simple
BASIC language-like syntax. Also, it can be easily integrated with Selenium tests.

1285. What is Robot API?


Ans. Robot API is used for handling Keyboard or mouse events.

Robot robot = new Robot();

//Simulate enter key action

robot.keyPress(KeyEvent.VK_ENTER);

1286. How to do file upload in Selenium?


Ans. File upload action can be performed in multiple ways-

1. Using element.sendKeys(“path of file”) on the web element of ‘input’ tag and type ‘file’
i.e. the elements should be like –
<input type=”file” name=”fileUpload”>
2. With the help of Robot API.
3. Using the AutoIT API.

Page | 325
1287. How to handle the HTTPS website in Selenium or how to accept the SSL untrusted
connection?
Ans. Using profiles, we can handle accepting the SSL untrusted connection certificate. Profiles
are basically a set of user preferences stored in a file.

FirefoxProfile profile = new FirefoxProfile();

profile.setAcceptUntrustedCertificates(true);

profile.setAssumeUntrustedCertificateIssuer(false);

WebDriver driver = new FirefoxDriver(profile);

1288. How to do drag and drop in Selenium?


Ans. Using the Action class, drag and drop can be performed in Selenium. Sample code-
Actions builder = new Actions(driver);

Action dragAndDrop = builder.clickAndHold(SourceElement)

.moveToElement(TargetElement)

.release(TargetElement)

.build();

dragAndDrop.perform();

1289. How to execute JavaScript code in Selenium?


Ans. JavaScript code can be executed in Selenium using JavaScriptExecuter. Sample code for
javascript execution-

WebDriver driver = new FireFoxDriver();

if (driver instanceof JavascriptExecutor) {

((JavascriptExecutor)driver).executeScript("{JavaScriptCode}");

Page | 326
1290. How to handle alerts in Selenium?
Ans. In order to accept or dismiss an alert box, the alert class is used. This requires first
switching to the alert box and then using accept() or dismiss() command as the case may be.

Alert alert = driver.switchTo().alert();

//To accept the alert

alert.accept();

Alert alert = driver.switchTo().alert();

//To cancel the alert box

alert.dismiss();

1291. What is HtmlUnitDriver?


Ans. HtmlUnitDriver is the fastest WebDriver. Unlike other drivers (FireFoxDriver,
ChromeDriver, etc), the HtmlUnitDriver is non-GUI. On executing test scripts, no browser gets
visible.

1292. How to handle hidden elements in Selenium WebDriver?


Ans. Using javaScript executor we can handle hidden elements-

(JavascriptExecutor(driver))

.executeScript("document.getElementsByClassName(locator).click();");

Selenium Framework Interview Questions


1293. What is Page Object Model or POM?
Ans. Page Object Model (POM) is a design pattern in Selenium. A design pattern is a solution or
a set of standards that are used for solving commonly occurring software problems.

Now coming to POM – POM helps to create a framework for maintaining selenium scripts. In
POM for each page of the application, a class is created having the web elements belonging to
the page and methods handling the events on that page. The test scripts are maintained in
separate files and the methods of the page object files are called from the test scripts file.

In this way, we can create a robust automation framework using POM.

Page | 327
1294. What are the advantages of POM?
Ans. The advantages are POM are-

1. Using POM, we can create an Object Repository i.e. a set of web elements in separate
files along with their associated functions. In this way, keeping the code clean.
2. For any change in UI(or web elements) only page object files are required to be updated
leaving test files unchanged.
3. It makes code reusable as well as maintainable.

1295. What is Page Factory?

Ans. Page factory is an implementation of the Page Object Model in Selenium. It provides
@FindBy annotation to find web elements. In addition, there is a PageFactory.initElements()
method to initialize all web elements defined with @FindBy annotation.
public class SamplePage {

WebDriver driver;

@FindBy(id="search")

WebElement searchTextBox;

@FindBy(name="searchBtn")

WebElement searchButton;

//Constructor

public samplePage(WebDriver driver){

this.driver = driver;

//initElements method to initialize all elements

PageFactory.initElements(driver, this);

Page | 328
//Sample method

public void search(String searchTerm){

searchTextBox.sendKeys(searchTerm);

searchButton.click();

1296. What is an Object repository?


Ans. An object repository is the centralized location of all the objects or WebElements of the test
scripts. In Selenium, we can implement an object repository using the Page Object Model as well
as Page Factory design patterns.

1297. What is a data-driven framework?


Ans. A data-driven framework is one in which the test data is put in external files like CSV,
Excel, etc. Basically, the test data is separated from the test logic that is written in test script
files. The test data drives the test cases, i.e. the test methods run for each set of test data values.

TestNG provides inherent support for data-driven testing using @dataProvider annotation.

1298. What is a keyword-driven framework?


Ans. A keyword-driven framework is one in which we associate the normal set of actions with
keywords and keep them in an external file usually in tabular form.

For example, we can use-

 launchBrowser() keyword, for the action of launching a browser.


 writeInTextBox(webElement, textToWrite) keyword, for the action to write in a
textbox with keyword, etc.
The framework contains the code to perform the action based on a keyword specified in the
external file.

In this way, a person of a non-programming background can also write the test steps in a file as
long as all the keywords are present in the framework along with the implementation.

Page | 329
1299. What is a hybrid framework?
Ans. A hybrid framework is a combination of two or more frameworks. For example, a
combination of data-driven and keyword-driven frameworks is also a hybrid framework.

1300. What is Selenium Grid?


Ans. Selenium Grid is a tool that helps in distributed testing. Using Grid, we can run test scripts
in different machines having different browsers, browser versions, platforms, etc in parallel. In
the Selenium grid, there is a hub that is a central server managing all the distributed machines
known as nodes.

1301. What are some advantages of the Selenium grid?


Ans. The advantages of the Selenium grid are-

1. It allows running test cases in parallel thereby saving test execution time.
2. Multi-browser testing is possible using the Selenium grid by running the test on machines
having different browsers.
3. Additionally, we can do multi-platform testing by configuring nodes having different
operating systems.

1302. What is a hub in the Selenium Grid?


Ans. A hub is a server or a central point in the Selenium grid that controls the test executions on
the different machines.

1303. What is a node in the Selenium Grid?


Ans. Nodes are the machines that are attached to the selenium grid hub and have selenium
instances running the test scripts. Unlike a hub, there can be multiple nodes in the selenium grid.

1304. Explain the line of code Webdriver driver = new FirefoxDriver();.


Ans. This is one of the most frequently asked Selenium interview questions. In the line of
code Webdriver driver = new FirefoxDriver(); ‘WebDriver’ is an interface and we are
creating an object of type WebDriver instantiating an object of FirefoxDriver class.

1305. What is the purpose of creating a reference variable- ‘driver’ of type WebDriver
instead of directly creating a FireFoxDriver object or any other driver’s reference in the
statement Webdriver driver = new FirefoxDriver();?
Ans. By creating a reference variable of type WebDriver, we can use the same variable to work
with multiple browsers like ChromeDriver, IEDriver, etc.

Page | 330
1306. Name an API used for reading and writing data to excel files.
Ans. Apache POI API and JXL(Java Excel API) can be used for reading, writing, and updating
excel files.

1307. Name an API used for logging in Java.


Ans. Log4j is an open-source API widely used for logging in Java. It supports multiple levels of
logging like – ALL, DEBUG, INFO, WARN, ERROR, TRACE, and FATAL.

1308. What is the use of logging in automation?


Ans. Logging helps in debugging the tests when required and also provides storage of the test’s
runtime behavior.

1309. List out the test types that are supported by Selenium?
For web based application testing selenium can be used

The test types can be supported are

a) Functional, Learn More about Functional Testing.

b) Regression

For post release validation with continuous integration automation tool could be used

a) Jenkins

b) Hudson

c) Quick Build

d) CruiseCont

1310.Explain what is assertion in Selenium and what are the types of assertion?
Assertion is used as a verification point. It verifies that the state of the application conforms to
what is expected. The types of assertion are “assert” , “verify” and “waitFor”.

1311. Explain the difference between single and double slash in X-path?
Single slash ‘/ ’

 Single slash ( / ) start selection from the document node


 It allows you to create ‘absolute’ path expressions

Page | 331
Double Slash ‘// ’

 Double slash ( // ) start selection matching anywhere in the document


 It enables to create ‘relative’ path expressions

1312.List out the technical challenges with Selenium?


Technical challenges with Selenium are

 Selenium supports only web based applications


 It does not support the Bitmap comparison
 For any reporting related capabilities have to depend on third party tools
 No vendor support for tool compared to commercial tools like HP UFT
 As there is no object repository concept in Selenium, maintainability of objects becomes
difficult

1313.What is the difference between type keys and type commands?


TypeKeys() will trigger JavaScript event in most of the cases whereas .type() won’t. Type key
populates the value attribute using JavaScript whereas .typekeys() emulates like actual user
typing

1314. What is the difference between verify and assert commands?


Assert: Assert allows to check whether an element is on the page or not. The test will stop on
the step failed, if the asserted element is not available. In other words, the test will terminated at
the point where check fails.

Verify: Verify command will check whether the element is on the page, if it is not then the test
will carry on executing. In verification, all the commands are going to run guaranteed even if
any of test fails.

1315. While using click command can you use screen coordinate?
To click on specific part of element, you would need to use clickAT command. ClickAt
command accepts element locator and x, y co-ordinates as arguments-

clickAt (locator, cordString)

1316. Why testers should opt for Selenium and not QTP?
Selenium is more popular than QTP as

 Selenium is an open source whereas QTP is a commercial tool

Page | 332
 Selenium is used specially for testing web based applications while QTP can be used for
testing client server application also
 Selenium supports Firefox, IE, Opera, Safari on operating systems like Windows, Mac,
Linux etc. however QTP is limited to Internet Explorer on Windows.
 Selenium supports many programming languages like Ruby, Perl, Python whereas QTP
supports only VB script

1317. What are the four parameter you have to pass in Selenium?
Four parameters that you have to pass in Selenium are

 Host
 Port Number
 Browser
 URL

1318. What is the difference between setSpeed() and sleep() methods?


Both will delay the speed of execution.

Thread.sleep () :
It will stop the current (java) thread for the specified period of time. Its done only once

 It takes a single argument in integer format

Ex: thread.sleep(2000)- It will wait for 2 seconds

 It waits only once at the command given at sleep

SetSpeed () :
For specific amount of time it will stop the execution for every selenium command.

 It takes a single argument in integer format

Ex: selenium.setSpeed(“2000”)- It will wait for 2 seconds

 Runs each command after setSpeed delay by the number of milliseconds mentioned in
set Speed

This command is useful for demonstration purpose or if you are using a slow web application

Page | 333
1319. What is same origin policy? How you can avoid same origin policy?
The “Same Origin Policy” is introduced for security reason, and it ensures that content of your
site will never be accessible by a script from another site. As per the policy, any code loaded
within the browser can only operate within that website’s domain.

To avoid “Same Origin Policy” proxy injection method is used, in proxy injection mode the
Selenium Server acts as a client configured HTTP proxy , which sits between the browser and
application under test and then masks the AUT under a fictional URL

1320. What is heightened privileges browsers?


The purpose of heightened privileges is similar to Proxy Injection, allows websites to do
something that are not commonly permitted. The key difference is that the browsers are launced
in a special mode called heightened privileges. By using these browser mode, Selenium core can
open the AUT directly and also read/write its content without passing the whole AUT through
the Selenium RC server.

1321 Mention what is the difference between Implicit wait and Explicit wait?
Implicit Wait: Sets a timeout for all successive Web Element searches. For the specified amount
of time it will try looking for element again and again before throwing a
NoSuchElementException. It waits for elements to show up.

Explicit Wait : It is a one-timer, used for a particular search.

1322.Which attribute you should consider throughout the script in frame for “if no frame
Id as well as no frame name”?
You can use…..driver.findElements(By.xpath(“//iframe”))….

This will return list of frames.

You will need to switch to each and every frame and search for locator which we want.

Then break the loop

1323.List the advantages of Webdriver over Selenium Server?

 If you are using Selenium-WebDriver, you don’t need the Selenium Server as it is using
totally different technology
 Selenium Server provides Selenium RC functionality which is used for Selenium 1.0
backwards compatibility

Page | 334
 Selenium Web driver makes direct calls to browser using each browsers native support
for automation, while Selenium RC requires selenium server to inject Javascript into the
browser

1324. Mention what are the capabilities of Selenium WebDriver or Selenium 2.0?
WebDriver should be used when requiring improvement support for

 Handling multiple frames, pop ups , multiple browser windows and alerts
 Page navigation and drag & drop
 Ajax based UI elements
 Multi browser testing including improved functionality for browser not well supported by
Selenium 1.0

1325. While injecting capabilities in webdriver to perform tests on a browser which is not
supported by a webdriver what is the limitation that one can come across?
Major limitation of injecting capabilities is that “findElement” command may not work as
expected.

1326. Explain how you can find broken images in a page using Selenium Web driver?
To find the broken images in a page using Selenium web driver is

 Get XPath and get all the links in the page using tag name
 In the page click on each and every link
 Look for 404/500 in the target page title

1327.Explain how you can handle colors in web driver?


To handle colors in web driver you can use

Use getCssValue(arg0) function to get the colors by sending ‘color’ string as an argument

1328. Explain how you can switch between frames?


To switch between frames webdrivers [ driver.switchTo().frame() ] method takes one of the
three possible arguments

 A number: It selects the number by its (zero-based) index


 A name or ID: Select a frame by its name or ID
 Previously found WebElement: Using its previously located WebElement select a frame

Page | 335
1329.Mention 5 different exceptions you had in Selenium web driver?
The 5 different exceptions you had in Selenium web drivers are

 WebDriverException
 NoAlertPresentException
 NoSuchWindowException
 NoSuchElementException
 TimeoutException

1330. Explain using Webdriver how you can perform double click?
You can perform double click by using

 Syntax- Actions act = new Actions (driver);


 act.doubleClick(webelement);

1331. How will you use Selenium to upload a file?


You can use “type”command to type in a file input box of upload file. Then, you have to use
“Robot” class in JAVA to make file upload work.

1332.Which web driver implementation is fastest?


HTMLUnit Driver implementation is fastest, HTMLUnitDriver does not execute tests on
browser but plain http request, which is far quick than launching a browser and executing tests

1333. What is the difference between getWindowhandles() and getwindowhandle()?


getwindowhandles(): It is used to get the address of all the open browser and its return type is Set
<String>

getwindowhandle(): It is used to get the address of the current browser where the control is and
return type is string

1334.Explain how you can switch back from a frame?


To switch back from a frame use method defaultContent()

Syntax-driver.switchTo().defaultContent();

Page | 336
1335. What is the command that is used in order to display the values of a variable into the
output console or log?

 In order to display a constant string, command can be used is echo <constant string>
 If order to display the value of a variable you can use command like echo ${variable
name>>

Above is using PHP. If you are using Java, replace echo with System.out.println

1336.Explain how you can use recovery scenario with Selenium?


Recovery scenarios depends upon the programming language you use. If you are using Java then
you can use exception handling to overcome same. By using “Try Catch Block” within your
Selenium WebDriver Java tests

1337.Explain how to iterate through options in test script?


To iterate through options in test script you can loop features of the programming language, for
example to type different test data in a text box you can use “for” loop in Java

// test data collection in an array

String[ ] testData = { “test1” , “test2” , “test3” } ;


// iterate through each test data

For (string s: test data) { selenium.type ( “elementLocator”, testData) ; }

1338. How can you prepare customized html report using TestNG in hybrid framework?
There are three ways

 Junit: With the help of ANT


 TestNG: Using inbuilt default.html to get the HTML report. Also XST reports from
ANT, Selenium, Testng combinations
 Using our own customized reports using XSL jar for converting XML content to HTML

Page | 337
1339.From your test script how you can create html test report?
To create html test report there are three ways

 TestNG: Using inbuilt default.html to get the HTML report. Also XLST reports from
ANT, Selenium, TestNG combination
 JUnit: With the help of ANT
 Using our own customized reports using XSL jar for converting XML content to HTML

1340. Explain how you can insert a break point in Selenium IDE?
In Selenium IDE to insert a break point

 Select “Toggle break point” by right click on the command in Selenium IDE
 Press “B” on the keyboard and select the command in Selenium IDE
 Multiple break points can be set in Selenium IDE

1341.Explain in Selenium IDE how can you debug the tests?

 Insert a break point from the location from where you want to execute test step by step
 Run the test case
 At the given break point execution will be paused
 To continue with the next statement click on the blue button
 Click on the “Run” button to continue executing all the commands at a time

1342.What is Selenese and what are the types of Selenese?


Selenese is a selenium set of command which are used for running the test

There are three types of Selenese

 Actions: It is used for performing the operations and interactions with the target elements
 Assertions: It is used as a check points
 Accessors: It is used for storing the values in a variable

1343.Explain what are the limitations of Selenium IDE?


The limitations of Selenium IDE

Page | 338
 Exceptional handling is not present
 Selenium IDE uses only HTML languages
 External databases reading is not possible with IDE
 Reading from the external files like .txt, .xls is not possible
 Conditional or branching statements execution like if,else, select statements is not
possible

1344.What are the two modes of views in Selenium IDE?


Either Selenium IDE can be opened as a pop up window or in side bar

1345.In selenium IDE what are the element locators that can be used to locate elements on
web page?
In selenium there are mainly 4 locators that are used

 X-path locators
 Css locators
 Html id
 Html name

1346.In Selenium IDE how you can generate random numbers and dates for test data?
In Selenium IDE you can generate random numbers by using Java Script

type
css=input#s
javascript{Math.random()}
And for

type
css=input#s
javascript{new Date()}

1347.How you can convert any Selenium IDE tests from Selenese to another language?
You can use the format option of Selenium IDE to convert tests into another programming
language

Page | 339
1348.Using Selenium IDE is it possible to get data from a particular html table cell?
You can use the “storeTable” command

Example store text from cell 0,2 from an html table

storeTable
Css=#table 0.2
textFromCell

1349.Explain what can cause a Selenium IDE test to fail?

 When a locator has changed and Selenium IDE cannot locate the element
 When element Selenium IDE waiting to access did not appear on the web page and the
operation timed out
 When element Selenium IDE was trying to access was not created

1350.Explain how you can debug the tests in Selenium IDE?

 Insert a break point from the location where you want to execute step by step
 Run the test case
 At the given break point execution will be paused
 To continues with the next step click on the Blue button
 To run commands at a time click on run button

1351.From Selenium IDE how you can execute a single line?


From Selenium IDE single line command can be executed in two ways

 Select “Execute this command” by right clicking on the command in Selenium IDE
 Press “X” key on the keyboard after selecting the command in Selenium IDE

1352. In which format does source view shows your script in Selenium IDE?
In Selenium IDE source view shows your script in XML format

Page | 340
1353 . Explain how you can insert a start point in Selenium IDE?
In two ways selenium IDE can be set

 Press “S” key on the keyboard and select the command in Selenium IDE

 In Seleniun IDE right click on the command and the select “Set / Clear Start Point”

1354.What if you have written your own element locator and how would you test it?
To test the locator one can use “Find Button” of Selenium IDE, as you click on it, you would see
on screen an element being highlighted provided your element locator is right or or else an error
message will be displayed

1355. What is regular expressions? How you can use regular expressions in Selenium?
A regular expression is a special text string used for describing a search pattern. In Selenium IDE
regular expression can be used with the keyword- regexp: as a prefix to the value and patterns
needs to be included for the expected values.

1356. What are core extension?


If you want to “extend” the defualt functionality provided by Selenium Function Library , you
can create a Core Extension. They are also called “User Extension”. You can even download
ready-made Core Extension created by other Selenium enthusiats.

1357 How will you handle working with multiple windows in Selenium?
We can use the command selectWindow to switch between windows. This command uses the
title of Windows to identify which window to switch to.

1358.How will you verify the specific position of an web element


You can use verifyElementPositionLeft & verifyElementPositionTop. It does a pixel comparison
of the position of the element from the Left and Top of page respectively

1359. How can you retrive the message in an alert box?


You can use the storeAlert command which will fetch the message of the alert pop up and store it
in a variable.

Page | 341
1360. What is selenium RC (Remote Control)?
Selenium IDE have limitations in terms of browser support and language support. By using
Selenium RC limitation can be diminished.

 On different platforms and different web browser for automating web


application selenium RC is used with languages like Java, C#, Perl, Python
 Selenium RC is a java based and using any language it can interact with the web
application
 Using server you can bypass the restriction and run your automation script running
against any web application

1361. Why Selenium RC is used?


Selenium IDE does not directly support many functions like condition statements, Iteration,
logging and reporting of test results, unexpected error handling and so on as IDE supports only
HTML language. To handle such issues Selenium RC is used it supports the language like Perl,
Ruby, Python, PHP using these languages we can write the program to achieve the IDE issues.

1362. Explain what is the main difference between web-driver and RC?
The main difference between Selenium RC and Webdriver is that, selenium RC injects javascript
function into browsers when the page is loaded. On the other hand, Selenium Webdriver drives
the browser using browsers built in support

1363. What are the advantages of RC?


Advantages of RC are

 Can read or write data from/ to .xls, .txt, etc


 It can handle dynamic objects and Ajax based UI elements
 Loops and conditions can be used for better performance and flexibility
 Support many Programming languages and Operating Systems
 For any JAVA script enabled browser Selenium RC can be used

Page | 342
1364. Explain what is framework and what are the frameworks available in RC?
A collection of libraries and classes is known as Framework and they are helpful when testers
has to automate test cases. NUnit, JUnit, TestNG, Bromine, RSpec, unittest are some of the
frameworks available in RC .

1365.How can we handle pop-ups in RC?


To handle pop-ups in RC , using selectWindow method, pop-up window will be selected and
windowFocus method will let the control from current window to pop-up windows and perform
actions according to script

1366. What are the technical limitations while using Selenium RC?
Apart from “same origin policy” restriction from js, Selenium is also restricted from exercising
anything that is outside browser.

1367.Can we use Selenium RC to drive tests on two different browsers on one operating
system without Selenium Grid?
Yes, it is possible when you are not using JAVA testing framework. Instead of using Java
testing framework if you are using java client driver of selenium then TestNG allows you to do
this. By using “parallel=test” attribute you can set tests to be executed in parallel and can define
two different tests, each using different browser.

1368. Why to use TestNG with Selenium RC?


If you want full automation against different server and client platforms, You need a way to
invoke the tests from a command line process, reports that tells you what happened and
flexibility in how you create your test suites. TestNG gives that flexibility.

1370. Explain how you can capture server side log Selenium Server?
To capture server side log in Selenium Server, you can use command

java –jar .jar –log selenium.log

Page | 343
1371. Other than the default port 4444 how you can run Selenium Server?
You can run Selenium server on java-jar selenium-server.jar-port other than its default port

1372. How Selenium grid hub keeps in touch with RC slave machine?
At predefined time selenium grid hub keeps polling all RC slaves to make sure it is available for
testing. The deciding parameter is called “remoteControlPollingIntervalSeconds” and is defined
in “grid_configuration.yml”file

1373. Using Selenium how can you handle network latency?


To handle network latency you can use driver.manage.pageloadingtime for network latency

1374.To enter values onto text boxes what is the command that can be used?
To enter values onto text boxes we can use command sendkeys()

1375. How do you identify an object using selenium?


To identify an object using Selenium you can use

isElementPresent(String locator)

isElementPresent takes a locator as the argument and if found returns a Boolean

1376.In Selenium what are Breakpoints and Startpoints?

 Breakpoints: When you implement a breakpoint in your code, the execution will stop
right there. This helps you to verify that your code is working as expected.
 StartpointsStartpoint indicates the point from where the execution should begin.
Startpoint can be used when you want to run the testscript from the middle of the code or
a breakpoint.

Page | 344
1377. Mention why to choose Python over Java in Selenium?
Few points that favor Python over Java to use with Selenium is,

 Java programs tend to run slower compared to Python programs.


 Java uses traditional braces to start and ends blocks, while Python uses indentation.
 Java employs static typing, while Python is dynamically typed.
 Python is simpler and more compact compared to Java.

1378 Mention what are the challenges in Handling Ajax Call in Selenium Webdriver?

The challenges faced in Handling Ajax Call in Selenium Webdriver are

 Using “pause” command for handling Ajax call is not completely reliable. Long pause
time makes the test unacceptably slow and increases the testing time. Instead,
“waitforcondition” will be more helpful in testing Ajax applications.
 It is difficult to assess the risk associated with particular Ajax applications
 Given full freedom to developers to modify Ajax application makes the testing process
challenging
 Creating automated test request may be difficult for testing tools as such AJAX
application often use different encoding or serialization technique to submit POST data.

1379 Mention what is IntelliJ?


Intellij is an IDE that helps you to write better and faster code for Selenium. Intellij can be used
in the option to Java bean and Eclipse.

1380.Mention in what ways you can customize TestNG report?


You can customize TestNG report in two ways,

 Using ITestListener Interface


 Using IReporter Interface

1381.To generate pdf reports mention what Java API is required?


To generate pdf reports, you need Java API IText.

Page | 345
1382.Mention what is Listeners in Selenium WebDriver?
In Selenium WebDriver, Listeners “listen” to the event defined in the selenium script and behave
accordingly. It allows customizing TestNG reports or logs. There are two main listeners i.e.
WebDriver Listeners and TestNG Listeners.

1383. Mention what are the types of Listeners in TestNG?


The types of Listeners in TestNG are,

 IAnnotationTransformer
 IAnnotationTransformer2
 IConfigurable
 IConfigurationListener
 IExecutionListener
 IHookable
 IInvokedMethodListener
 IInvokedMethodListener2
 IMethodInterceptor
 IReporter
 ISuiteListener
 ITestListener

1384. Mention what is desired capability? How is it useful in terms of Selenium?


The desired capability is a series of key/value pairs that stores the browser properties like
browser name, browser version, the path of the browser driver in the system, etc. to determine
the behavior of the browser at run time.

For Selenium,

 It can be used to configure the driver instance of Selenium WebDriver.


 When you want to run the test cases on a different browser with different operating
systems and versions.

1385. For Database Testing in Selenium Webdriver what API is required?


For Database Testing in Selenium Webdriver, you need JDBC (Java Database Connectivity)
API. It allows you to execute SQL statements.

Page | 346
1386.Mention when to use AutoIT?

Selenium is designed to automate web-based applications on different browsers. But to handle


window GUI and non-HTML popups in the application you need AutoIT. know more about How
to use AutoIT with Selenium

1387. Mention why do you need Session Handling while working with Selenium?
While working with Selenium, you need Session Handling. This is because, during test
execution, the Selenium WebDriver has to interact with the browser all the time to execute given
commands. At the time of execution, it is also possible that, before current execution completes,
someone else starts execution of another script, in the same machine and in the same type of
browser. So to avoid such situation you need Session Handling.

1388.Mention what are the advantages of Using Git Hub For Selenium?
The advantages of Using Git Hub for Selenium are

 Multiple people when they work on the same project they can update project details and
inform other team members simultaneously.
 Jenkins can help you to build the project from the remote repository regularly. This helps
you to keep track of failed builds.

Page | 347
APPIUM

Appium Interview Questions for Freshers

1389. What are the features of Appium?

Following are the features of Appium:-

 Appium does not necessitate the use of an application's source code or a library.
 Appium has a vibrant and engaged community of developers and so help is easily available
from the community.
 Appium supports multi-platform testing, which means it can execute the same test cases on
several platforms like iOS mobile, Android mobile, and Windows desktop applications.
 Appium allows test scripts to run in parallel with other test scripts.
 A minor modification in Appium does not necessitate reinstalling the application.
 Appium supports a wide range of languages that use the Selenium client library, including C#,
Python, Java, Ruby, PHP, JavaScript with node.js, and many others.

Page | 348
1390. Mention the advantages and disadvantages of Appium.

Following are the advantages of Appium:-

 Appium is an open-source application, implying that it can be downloaded for free and it is
simple to set up.
 It can be used to run automated tests on hybrid, native as well as web applications.
 To make Appium compatible with automation, you don't need to integrate any new agents in
your application, unlike other testing solutions. It tests on the very application that will be
uploaded to the App Store.
 Appium now has a new feature. Along with mobile application testing, it now supports desktop
application testing for Windows.
 Appium is a cross-platform, open-source mobile testing solution that allows us to conduct
cross-platform testing. As a result, you'll be able to test across a variety of platforms (single
API for both Android and IOS platforms).

Following are the disadvantages of Appium:-

 There is no support for generating detailed reports of the tests executed.


 The tests are a little slow because they rely on the remote web driver.
 The fact that Appium uses UIAutomator for Android, which only supports Android SDK, API
16, or higher, is not a limitation, but rather an overhead. Appium, on the other hand, does not
natively support earlier APIs. To support older APIs, it makes use of an open-source library
called Selendroid.
 On a Mac OS device, only one iOS Script can run at a time, which implies only one test can be
run at a time. We will need the same number of Mac machines if we wish to run our tests on
numerous iOS devices at the same time. Organizing many Mac machines, on the other hand,
would be costly.

1391. Difference between Emulator and Simulator.

Simulator: A simulator is used to simulate an environment with all of the software variables
and configurations that will be present in the actual production environment of an application.
Simulators do not try to replicate the actual hardware that will run the application in
production. Simulators can be written in high-level programming languages because they
merely construct software environments. For example, a car racing game application can be
thought of as a simulator as it simulates a real car race.

Emulator: An emulator does try to replicate all of the hardware and software aspects of a real-
world environment. In most cases, you'll need to develop an emulator in assembly language to
accomplish this. Emulators might thus be thought of as occupying a midway ground between
simulators and real-world gadgets. For example, a car simulator racing game can be thought of
as an emulator. It provides the hardware aspects of car racing as well with the help of
emulators.

Page | 349
 Emulators replicate both hardware and software features, whereas simulators solely simulate
environment features that may be adjusted or created using the software. Emulators aren't a
replacement for real-device testing since they don't always do a good job of simulating the
hardware and software of a production system. They simply allow you to create an
environment that is more similar to that of a real device.
 Emulators are somewhat slower as compared to simulators as emulators need to sense the
movement of hardware devices, convert it into a digital signal, and then process them.

1392. When should you use a simulator and when should you use an emulator?

 Case when we should use a Simulator: Simulators are typically used in software testing
situations where the goal is to ensure that the application functions as intended when
interacting with external applications or environments.
For example, you could wish to see if an application can communicate data to another
application. Because the actual hardware configuration is unlikely to have much of an impact
on data transfers for your program, a simulated environment will usually suffice. Simulated
testing environments are also useful for ensuring that an application's interface shows properly
across a range of screen resolutions.
 Case when we should use an Emulator: When you need to test how software interacts with
underlying hardware or a combination of hardware and software, emulators come in handy.
For example, if we want to discover if a firmware update will cause issues with our software or
not, we can find out with the help of an emulator. Alternatively, we could want to know how
our program performs when run on multiple CPUs or with varying memory allocations.
Emulators come in handy in these situations as well.

1393. What are the different types of mobile applications?

Following are the different types of mobile applications:

 Native Applications: A native application is a program written in a specific programming


language (such as Objective C for iOS or Java for Android) and installed directly on the
device, allowing it to take full advantage of all of the device's characteristics. Native
applications can work offline and utilise the device's notification system. App stores (such as
Google Play or Apple's App Store) are used to install native applications. Native mobile
applications have a high level of performance and dependability. Temple Run, Candy Crush,
and other native apps are examples.
 Web Applications: Web applications are mobile web portals that have been specifically
created, adapted, and hosted for mobile devices. They are accessed using a URL on the mobile
device's web browser. When HTML5 was released, people learned that they could have native-
like functionality in the browser, and web applications became extremely popular. Device
capability is not available in mobile web applications. Google.com, m.snapdeal.com,
m.yahoo.com, and more websites are examples of web applications.
 Hybrid Applications: Web applications embedded in native applications that operate on the
device and are created using web technologies are known as hybrid applications (HTML5,

Page | 350
CSS, and JavaScript). Hybrid applications run inside a native container and render HTML and
handle JavaScript locally using the device's browser engine (not the browser). A web-to-native
abstraction layer gives you access to the device features like the accelerometer, camera, and
local storage that aren't available in mobile web applications. A hybrid application is not
limited to a single platform or mobile device. As a result, once constructed, it can run on any
device. Flipkart, Facebook, Twitter, and other hybrid applications are examples.

1394. What are some of the important mobile application testings?

Following are some of the important mobile application testings:

 Usability Testing: Usability testing is one of the sorts of web application testing that is perfect
for assessing how the application makes it easier for users to achieve their goals. During this
test, participants are given particular, realistic circumstances to use the application in. On the
basis of gathering direct input from the end-user, usability testing is also reliable.
As a result, the testing procedure is free of prejudice while simultaneously guaranteeing that
highlighted areas improve. Usability testing also ensures that the design is intuitive and
prioritises usability and customer experience.
 Performance Testing: Performance testing is a critical subset of mobile application testing
that examines an application's performance, stability, and responsiveness under various
workload situations. A performance test's main goal is to ensure that an application is
completely aligned with the performance objectives.
Additionally, it addresses performance constraints prior to launching an application.
Bottlenecks are processes inside a system's overall functions that cause the system's overall
performance to slow or stall. Load testing, volume testing, soak testing, spike testing, and
stress testing are all popular forms of performance assessments.
 Security Testing: In today's world, security is a major worry for practically every mobile
application developer. According to reports, 80% of users are more likely to delete an
application because of security concerns. As a result, it is critical to concentrate on mobile
application security testing.
Users' personal information is required by certain programs, such as travel applications, for
various transactions. If your application requires something similar, it's critical that you
provide assurances about the application's confidentiality, integrity, and authenticity. You
should have strong tests run on your application that assure that no one can break into someone
else's account by unfair means.
 Interruption Testing: Interruption testing is important for determining how an application
behaves when it is interrupted before returning to its former state. Incoming phone calls or
SMS, alarms, push notifications from mobile applications, battery low or full, network
connection loss and recovery, and plugged in or out while charging are all examples of
interruptions. In the event of an interruption, an application should normally run in the
background and return to its prior state.
 Manual Testing: Manual testing is a tried and true method for thoroughly traversing the
complexity of mobile application testing. Manual testing ensures that the finished product
performs optimally in accordance with the planned expectations. It's especially useful in
situations where the use case isn't immediately evident. Professional QA testers could work in
short bursts to assess an application and ensure that it produces accurate results.

Page | 351
 Compatibility Testing: Compatibility testing is one of the most important types of mobile
application testing. It's a form of non-functional testing that ensures a mobile application's
functionality across a variety of operating systems, applications, devices, internal hardware
specs, and network conditions. Compatibility testing determines whether a mobile application
is compatible with various operating systems and versions.
It also tests a mobile application's compatibility with various devices, browsers, networks, and
other characteristics. Backward compatibility testing and forward compatibility testing are the
two types of compatibility testing.
 Localisation Testing: Localization testing is a must for mobile applications that are targeted at
a certain geographic location. It's crucial to test the mobile application's responsiveness to the
region's distinct language and cultural aspects. Local currency, use of suitable time zone date
and time formats, numerous local legislation needs, and the text and user interface are only a
few of the important areas that localization testing evaluates.
 Functional Testing: Functional mobile application testing ensures that the application's
functionalities meet the specified requirements. This form of testing focuses mostly on the
mobile application's main goal and flow. Functionality testing determines if an application can
properly launch and install. It also tests the simplicity of sign-up and login, as well as the
presentation of push notifications and the proper operation of text boxes and buttons.
 Installation Testing: Installation testing, also known as implementation testing, is a good way
to ensure that a mobile application is installed and removed correctly. Furthermore, installation
testing is necessary to ensure that updates are seamless and error-free. Installation testing also
examines what happens if users fail to update a mobile application.
 Automated Testing: Certain mobile application quality assessments are overly complicated
and time-consuming. In such instances, Mobile application Test Automation Services come
into play, providing optimally prepared and effectively conducted automated testing as well as
manual testing, which can aid in assuring quality while also allowing for the speedier release
of superior goods. As a result, automated testing is a solid source of time and cost savings
when it comes to mobile application testing. There are various tools to perform automated
testing. Appium is one of them.

1395. Do you need a server machine to run tests on Appium?

No, we do not need a server machine to run tests on Appium. Appium encourages a two-tier
architecture, in which a test machine connects to a test server that runs Appium, automating the
entire process. This setting is optional; you can run Appium on the same system as your tests.
Instead of connecting to a remote host, your test will use the loopback address to connect to
Appium.

1396. What types of tests are suitable for Appium?

There are many scenarios that can be tested when it comes to testing, especially for web
applications, depending on the feature coverage you want to assure. Appium comes in helpful
when it comes to testing scenarios that users will encounter when using your app.

Appium, on the other hand, becomes a restriction if you need to test more than UX simple
interactions. Consider features such as keyboarding. When sophisticated touch/keyboard mixed

Page | 352
circumstances are involved, the likelihood of a false failure is significant. Exchanging data is
another minor pain with Appium. You'll need to use various strategies when your test needs to
exchange data with your app. So keep in mind that sending and receiving information isn't
always simple. It's not Appium's fault; the WebDriver specification was created to automate
processes, not data exchange.

1397. What are the major advantages of using Appium on Sauce Labs rather than using
Appium locally?

Following are the advantages of using Appium on Sauce Labs rather than using Appium
locally:

 It saves us the time that it takes to set up the Appium server locally.
 We do not need to install the mobile emulators and simulators offline in our system. We can
directly use it on Sauce Labs (an American cloud-hosted web and mobile application
automated testing platform company based in San Francisco, California).
 It lets us scale our application instantly.
 We do not need to make any modifications to the source code of our application as is the case
while using Appium locally.

1398. Explain the general responsibilities of a mobile application testing framework. Also
explain the general structure of a mobile application testing framework.

Following are the general responsibilities of a mobile application testing framework:

 Choosing a format for expressing expectations


 Developing a means to connect to or control the test applicat ion
 Performing the tests and reporting the results

The general structure of a mobile application testing framework consists of the following
segments :

 Application Package: This refers to the target application which needs to be run and tested.
 Instrumentation TestRunner: A test case runner that executes test cases against the target
application. It includes an SDK tool for creating tests as well as an API tool, such as
MonkeyRunner, that gives APIs for designing a program that controls an Android device.
 Test Package: Two classes, Test case classes, and Mock objects are included in the Test
Package. The mock object contains mock data that will be used as sample input for test cases,
while the test case classes contain test methods to run on the target application.

Page | 353
Page | 354
In the above figure, we can see that a mobile application testing framework consists of three
segments: Application package, InstrumentationTestRunner, and Test package. The test
package consists of mock objects, test case classes, and Instrumentation and JUnit classes.

1399. List out the prerequisites required to run tests on an android application in
Appium locally.

Following prerequisites must be installed so as to successfully run tests on an android


application in Appium locally :

 Java Development Kit (JDK).


 Android Studio.
 Android SDK Tools.
 Eclipse IDE.
 Appium Desktop Client.
 TestNG.
 Selenium Server JAR.
 Webdriver Language Binding Library.

1400. What do you mean by Appium Inspector?

Appium offers an "Inspector" to record and playback, similar to Selenium IDE's record and
playback tool. It inspects the Document Object Model to record and play native application
behaviour and provides test scripts in any preferred language. You can use the Inspector in
Appium Desktop to look up or locate elements of an application.

To locate an element, the Appium inspector provides four options:

 To find elements by id
 To find elements by class name
 To find elements by accessibility id
 To find elements by xpath.

Appium Inspector does not support Windows and instead uses the UIAutomator viewer as an
option.

1401. Explain the architecture of Appium.

Appium is an HTTP server implemented in the node.js programming language. It creates a


server on the device and waits for proxied commands from the main Appium server. The test
scripts are written by the tester and run on the device or emulator. Appium creates and
manages many webdriver sessions for various platforms such as Android and iOS.

Page | 355
Test scripts produced by the tester are sent to the Appium server as requests, which are then
executed on the emulator or device. Each vendor has its own technique and methodology for
executing test cases on the device, such as IOS or Android. As a result, the test case runs after
the Appium server receives commands. To transmit command requests to the Appium server,
Appium uses JSON (Javascript Object Notation) wire protocol. Here, JSON is used to transmit
data between the server and the client.

Page | 356
1402. What do you understand about end-to-end mobile testing automation? What things
should be kept in mind while performing end-to-end mobile testing automation?

End-to-end mobile application test automation is a method of testing a software product from
beginning to end to ensure that the application flow is as planned. It establishes the product's
system mandates and ensures that all integrated components perform as expected.

The goal of end-to-end (E2E) mobile application test automation is to test from the perspective
of the end-user by replicating a real-world situation, in which a user uses the application, and
confirming the system under test and its components for data integrity and integration.

These days, software systems are sophisticated and integrated with numerous subsystems. The
entire software system could fail if one of the subsystem fails. We employ end-to-end mobile
application test automation to eliminate this big risk.

Following things should be kept in mind while performing end-to-end mobile testing
automation :

Page | 357
 The installation of the application
 Launching the application for the first time without having network access.
 The uninstallation of the application.
 If the application is supported in horizontal mode, the orientation of the application.
 Testing the performance of an application on a variety of devices and network conditions.
 Testing the application's response and how it reacts when a user credential is provided that is
invalid.

1403.What is mobile application testing and how does it differ from mobile testing?

The practice of testing application software produced for handheld mobile devices for
functionality, usability, and consistency is known as mobile application testing. Mobile
application testing can be done in two ways: automated or manually.

It differs from Mobile Testing, Mobile Testing focuses on native application functionalities of
mobile devices such as call, SMS, and media player, among others. Meanwhile, in Mobile
Application Testing, we concentrate solely on a specific application's operation and end-to-end
features.

1404. Explain the JSON Wire protocol used by Appium.

The JSON Wire Protocol is the method by which client and server data are exchanged. It was
created by WebDriver's developers. The protocol, according to them, consists of a set of
standardised endpoints that are offered to clients via a RESTful API. This enables the
webdriver to communicate with a server and a client in order to automate tasks. In this
protocol, JSON is used to transmit data between the server and the client. Before delivering an
object to a server, a client (or the computer running the WebDriver API) turns it into a JSON
object. The JSON object is parsed by the server and converted back to a JavaScript object. The
response object is converted to a JSON string by the server and returned to the client. For use,
the client transforms the JSON string to a JavaScript object.

Page | 358
In the above image, we can see the client and the server communicates with each other via
JSON wire protocol. The server sends a request to the appium server for running tests and the
appium server sends back the response to the main server.

The mobile JSON Wire Protocol, which is an extension of the Selenium JSON Wire Protocol,
is used by Appium. Other than establishing up a communication stream, it's used to regulate
other mobile phone behaviours.

1405. Explain Appium Session in the context of Appium.

Appium session is a medium to send commands to a specific test application. Commands are
always executed within the context of a session. Before performing any command, a client
utilizes the session identifier as the sessionId parameter. A session is requested by the client
library from the server. After that, the server will return a sessionId endpoint, which can be
used to submit additional commands to interact with the application(s) being tested.

Every 'testing' is included within a session. Given that Appium is a simple client and server-
based method, this is self-evident. Post requests, also known as session requests, are sent by
the client to the server. These queries use the JSON Wire Protocol to communicate and convey
information in JSON Object format.
Page | 359
1406. Explain Desired Capabilities in the context of Appium.

On iOS and Android, Appium behaves differently. Because it is a "cross-platform" tool, a


method must be in place to distinguish between the session requests of the two operating
systems. JSON objects, referred to as Desired Capabilities, were introduced to address this
specific problem statement.

Page | 360
Desired Capabilities are key-value pairs of data that separate the establishment of an Android
app testing session from that of an iOS app testing session. With arguments such as
platformName, deviceName, appPackage, and appActivity, the server will be able to tell the
difference between the two operating systems very quickly.

Page | 361
1407. Can a tester run tests in a multi-threaded environment while using Appium?

Yes, Appium allows testers to execute tests in a multithreaded environment. The only thing
they have to worry about is that no more than one test runs against the same Appium server at
the same time.

1408. Is it possible to use JavaScript to interact with applications while running Appium
tests?

Yes, we can use javascript to interact with applications while running Appium tests. When we
perform the instructions on Appium, the server transmits the script wrapped in an anonymous
function to our app, which is then executed.

1409. What do you mean by Appium Package master? How would you create a package?

Appium Package master refers to a set of tools that are used to create and manage Appium
packages.

To create a new Appium package, we can use the following lines of code:

//For es7/ babel


Gulp create-package -n <package-name>

In the above code, we use Gulp (a streaming build system) and the command “create-package”
to create a new package. -n signifies a new package has to be created and <package-name>
signifies the name of the package to be created.

// For regular es5


Gulp create-package ---nobabe1 -n <package-name>

In the above code, we mention --nobabel so as to specify that the command is for regular es5.

Appium Interview Questions for Experienced

1410. Explain how Appium works.

When we install Appium on our PC, it also installs a server that exposes the REST API. It
accepts commands and connection requests from the client and executes them on iOS or
Android devices. It responds to HTTP requests with HTTP responses. It runs the user interface
of the app using a mobile test automation framework to perform requests. As an example -

UIAutomator is used for Android API 16 or higher, while Selendroid is used for Android API
15 or below. Apple Instruments is used for iOS.

Page | 362
Working of Appium on Android:

Appium sends the command to a UIAutomator script running on the device on Android.
UIAutomator is an Android native UI automation framework that allows you to run Junit test
cases straight from the command line on the device. Despite the fact that it is written in Java,
Appium can be run from any WebDriver enabled language.

Android makes use of bootstrap.jar, a TCP server. It's used to deliver test commands to an
Android device, which UIAutomator then executes.

In the above image, we can clearly see the architecture of Appium used for running on Android
devices.

Working of Appium on iOS:

As Android uses UIAutomator, iOS uses UIAutomation. Similar to the Android, Appium
proxies the command to a UIAutomation test case running on the Mac instruments
environment. Apple provides this application "instrument" that performs various activities
like building, profiling, and controlling iOS apps. On the other hand, it also has an automation
component where you can write commands in JavaScript. It uses UIAutomation API to interact
with Application UI. Appium uses the same libraries to automate iOS Apps.

Page | 363
In the above image, we can clearly see the architecture of Appium used for running on iOS
devices.

1411. Differentiate between Appium and Selendroid.

Selendroid: Selendroid is a cutting-edge test automation framework for testing native and
hybrid Android mobile apps. The test is created using the Selenium 2 client API and is driven
by the user interface of a mobile or web app. Selendroid is a dynamic mobile testing
framework that can be used on emulators as well as real Android smartphones, with the option
of integrating as a node in Selenium Grip for parallel testing and scaling.

Following are the differences between Appium and Selendroid:

Page | 364
 Appium is an open-source automation solution that works on both iOS and Android, whereas
Selendroid is an Android-only test automation framework.
 A minor modification in Appium does not necessitate reinstalling the application. However,
Selendroid requires the application to be reinstalled even after a minor modification..
 Appium has a large and active community of active developers, whereas Selendroid does not
have one.
 Appium is compatible with a wide range of frameworks and languages. Selendroid, on the
other hand, works with Jenkin and Selenium.
 Appium does not necessitate the use of application source code or libraries, unlike Selendroid
does.
 Appium supports all Android APIs. Appium uses UIAutomator for tests that run on APIs
greater than or equal to 17, and Selendroid for tests that run on older APIs. Selendroid, on the
other hand, has different versions corresponding to the different versions of the Android APIs.

Page | 365
1412. Differentiate between Appium and Robotium.

Robotium: Robotium is a testing framework for Android that automates test cases for native
and hybrid apps. The developer can use Robotium to construct robust automatic Graphical
User Interface (GUI) testing cases for Android applications. A developer might also design a
functional, system, and acceptability test scenario, which would cover a wide range of Android
activities.

Following are the differences between Appium and Robotium:-

 Appium is a cross-platform testing tool that works on both iOS and Android devices.
Robotium, on the other hand, is limited to Android.
 Robotium only supports the Java programming language, but Appium supports a variety of
languages.
 The Appium tool does not require any application source code or libraries, whereas the
Robotium tool does.

Page | 366
 Appium can test native, web, and hybrid mobile apps, whereas Robotium can only test native
and hybrid mobile apps.
 Many frameworks, such as Selenium, are supported by Appium. Robotium, on the other hand,
is incompatible with Selenium and many other frameworks.
 You don't have to reinstall Appium every time you make a little modification. However, a
simple change in Robotium code necessitates a complete rebuild.

1413. Differentiate between open source tools, vendor tools and in house tools.

 Open Source Tools: Open source tools are frameworks and apps that are free to use.
Engineers construct this tool and give it free on the internet for other engineers, developers, or
enthusiasts to develop and use, which is incredibly beneficial for aspiring developers.
 Vendor Tools: Vendor tools are created by companies that have a license to utilize their tools
and codes. Technical support is accessible via the internet for these tools.
 In House Tools: In-house tools are the tools that a corporation develops for its own usage and
self-development. They are never made available to the general population.

1414. Differentiate between Appium and Calabash.

Calabash : Calabash is an automation framework for automating user interface acceptance


tests. It works with a variety of mobile systems, including iOS and Android. This can be used
to automate a variety of mobile applications, including native, mobile web, and hybrid.

Following are the differences between Appium and Calabash:-

Basic Appium Calabash

Programming Java, Python, JavaScript,.Net, Ruby, and The Ruby programming


Languages all other major programming languages language is the only one
Supported are supported by Appium. supported by Calabash.

iOS mobile web It necessitates the creation of a custom


Calabash does not support it yet.
page safari application for automation.

Native iOS It requires iOS instrumentation


It requires only the iOS UI Automator.
application for this.

Hybrid iOS It necessitates the use of custom


It necessitates the use of custom UI
application UI commands as well as an iOS
commands and the iOS UI Automator.
framework.

Hybrid Android Only the Selendroid application is Android instrumentation is


application required. required - calabash android.

Page | 367
Basic Appium Calabash

Android mobile It can be used to automate only the


It is not supported by Calabash.
web application chrome browser.

Native Android Both Android UI Autometer and Android instrumentation is


application Selendroid are required by Appium. required - calabash android.

1415. Differentiate between Appium and Selenium.

Selenium: Selenium is an open-source (free) automated testing framework for validating web
applications across multiple browsers and platforms. Selenium Test Scripts can be written in a
variety of programming languages, including Java, C#, Python, and others.

Following are the differences between Appium and Selenium:-

Based on Usage:

 Appium - Appium is a popular open-source for automation testing, notably in native


applications such as Android and iOS apps. It can also be used in hybrid applications that run
in both Android and iOS environments. This type of automation testing assures that no
systemic issues arise as a result of any specific patch installation once the app has gone live in
production. It assures complete integration testing and avoids a significant amount of manual
labour on the tester's part. By using Appium, users can easily avoid manually testing each and
every feature of the entire application every time.
 Selenium - Selenium is a common automated testing tool that is built for any type of web
application. It is compatible with all current popular browsers and operating systems such as
Windows, Linux, and MACOS.

Based on Design:

 Appium - Appium is primarily intended as an HTTP server because it will handle any type of
mobile app. However, it is primarily following or developing the same in node JS, rather than
utilising standard Java or JS code. As a result, developers who want to utilise Appium for
automated testing in any type of mobile app must first install Node JS on their system before
using the Appium tool.
 Selenium - Selenium is primarily used for maintaining automation logic on web applications
or webpages. It is created in such a way that it may interact with the application quickly and
easily by using browser activities.

Page | 368
1416. Do you think that automation testing can be a complete replacement for manual
software testing?

No, automation testing cannot be a complete replacement for manual software testing. This is
because the tools used are meant to execute tests once they are set up and proper automation
requires as little human participation as feasible. As convenient as it is, it should not be used to
replace manual testing; rather, it should be used for repetitive activities such as load testing,
which requires thousands of virtual users. Engineers should not automate test scripts if they are
only intended to run on a periodic basis, nor should they automate code reviews or bug testing
for new software builds that may require human engagement to detect errors. To sum up, we
can say that large-scale, repetitive jobs are better suited to automation.

1417. Mention the tests which you cannot do with an emulator but can do it with a real
device.

Following are a list of tests that we may conduct on a real device but is not possible in an
emulator:-

 Testing for interruptions during phone calls and messages.


 Performance of the application when the battery is low.
 Effect of the application on battery usage.
 A scenario where the memory card is mounted or unmounted from the device.
 Testing involves the use of Bluetooth.

1418. What are the basic requirements for writing Appium tests?

Following are the basic requirements for writing Appium tests:-

 Driver Client: Appium's driver client simulates the behaviour of a user in mobile applications.
Appium tests can be built with the aid of a client library, which wraps the stages of a test and
sends it to Appium over HTTP.
 Appium Session: Because appium tests are run within a session, it's crucial to set up an
appium session first. Once the automation of a session has come to an end, it will be
terminated and the user will have to wait for the next session.
 Desired Capabilities: In order to start an appium session, it's critical to design some
parameters known as desired parameters. Platform version, platform name, device name, and
many others are among these parameters. This also aids in defining the type of automation that
the Appium server is expected to provide.
 Driver Commands: Appium provides the ability to build tests using a large and expressive set
of commands.

Page | 369
1419. What are the tools used in Appium for debugging?

We generally use log data ( a log file is maintained wherein whenever an error occurs, it is
logged into this file) to see the cause of the issue, where the failure is occurring. So for iOS –
iPhone configuration utility & for Android Monitor.bat, etc can be used. If you give the
developer the logs from these tools, they'll be able to figure out what's causing the problem
quickly.

1420. What is Appium? Why is it used?

Appium is an open-source, freely distributed mobile application UI Testing framework or


automation mobile testing tool used to test mobile applications. It is developed and supported by
Sauce Labs to automate native and hybrid mobile apps. Appium is a cross-platform mobile
automation tool. It means you can run the same test on multiple platforms. You can also quickly
test multiple devices parallel by using Appium.

1421 What are the crucial features of Appium?

Following is the list of crucial features of Appium:

o There is a strong and active community available for Appium.


o Appium does not require application source code or library.
o It is open-source, freely distributed, and cross-platform support.
o Due to its multi-platform support, you can run the same test cases on multiple platforms.
o Appium allows the parallel execution of test scripts.
o Appium is time-efficient because a small change does not require re-installation of the
application.
o Appium supports various languages like Java, Python, C#, Ruby, PHP, JavaScript with
Node.js, and many others that have Selenium client library.
o It supports JSON wire protocol.
o It does not require recompilation of App.
o Appium has no dependency on mobile devices.

Page | 370
1422. What are the similarities between Appium and Selenium Webdriver?

There are a lot of similarities between Appium and Selenium Webdriver testing tools. So, if you
already know Selenium Webdriver, you can quickly learn Appium.

Appium doesn't have any dependency on mobile devices OS because its framework converts the
Selenium Webdriver commands to UIAutomator, and UIAutomation commands for Android and
iOS, respectively, according to the device type rather than the OS type.

1423.What are the advantages and disadvantages of Appium?

Following are the list of advantages and disadvantages of Appium:

Advantages of Appium

o Appium is an open-source tool, which means it is freely available. So, we don't have to
pay for installing it.
o If you are aware of Selenium Webdriver, you can quickly learn Appium because there are
many similarities between them. So, it is easy to install.
o It allows the automated testing of hybrid, native, and web applications.
o Appium is fully compatible with automation. We don't need to include any additional
agents in our App like other testing tools to make it compatible with automation. It tests
the same App, which is going to upload to App Store.
o Along with the mobile application testing, it would also support desktop application
testing for windows.
o This is a cross-platform, freely available mobile testing tool. We can test it on multiple
platforms (single API for both Android and IOS platforms).

Disadvantages of Appium

Appium has some great features and advantages, but it has some drawbacks too, which are as
follows:

o It doesn't provide detailed reports.


o It uses the remote web driver for testing, so it is a bit slow.

Page | 371
o It is not a limitation, but an overhead that Appium uses UIAutomator for Android
supports Android SDK, API 16, or higher. However, Appium supports older APIs, but
not directly. It uses another open-source library Selendroid to support older APIs.
o In iOS, it supports only one instance (iOS Script) to run on one Mac OS device. It means
one test can be executed at a time per Mac. If you want to run your tests on multiple iOS
devices simultaneously, you need to arrange the same number of Mac machines. But it
would be costly to set various Mac machines.

1424. Which types of applications can be tested using Appium?

Appium can test all types of applications, i.e., native, hybrid, and web. Let's see them in detail:

Native Applications: The native applications are software programs that are developed using a
specific software development kit. Native apps are designed for use on a particular device and
installed from the App Store, such as Google Play Store or Apple's App Store. These
applications can work offline and can also use the device notification system.

Examples of native applications are Pinterest, Skype, Snapchat, etc.

Web Applications: Web applications are websites that run on browsers. These applications are
developed using HTML, CSS, and JavaScript, unlike Android and iOS apps. They do not require
a Software Development Kit (SDK) for developers to work with. Web applications run on web
browsers so, they don't need any installation.

Examples of some web applications are Flipkart, Facebook, Twitter, etc.

Hybrid Applications: Hybrid applications are a combination of native and web applications.
Like native applications, you can download them from the App Store, but actually, they are web
applications inside. These applications are developed using web development languages such as
HTML, CSS, JavaScript, etc., which allows them to run on any platform.

Examples of some hybrid applications are OLA, Instagram, Basecamp, etc.

1425.What are the main prerequisites to use Appium?

You must have the following things on your system to use Appium. You must have installed the
following software:

o Java (JDK) on your system.

Page | 372
o Android Studio
o js
o Additional Android SDK tools
o Appium jar file
o Appium Desktop Client
o Eclipse IDE for Java
o TestNG
o Eclipse
o Selenium Server JAR
o Webdriver Language Binding Library
o APPIUM for Windows
o APK App Info On Google Play
o js

Note: The js by default comes with "node.js" and "NPM" whenever you install the Appium
server. So, you don't need to install node.js and NPM separately. It is already included in the
current version of Appium.

1426. Explain the working principle of Appium as how it works on your system.

Appium is an "HTTP Server" written using Node.js platform and drives iOS and Android
sessions using Webdriver JSON wire protocol. So, before initializing the Appium Server, you
must have preinstalled Node.js on your system.

When we download and install Appium on our system, it installs a server and it on the machine
that exposes the REST API. When the clients send the command and connection requests, it
executes that command on devices like iOS or Android and replies with the HTTP responses. To
execute the requests, it uses a mobile test automation framework to run the app's user interface.

For Example, it uses Apple instruments for iOS, Selendroid for Android API 15 or lesser
version, and Google UIAutomator for Android API 16 or higher versions.

Note: Appium uses the open-source library Selendroid to support older APIs because
UIAutomator only supports API 16 or higher.

Page | 373
1427.What do you understand by Appium Inspector?

Appium Inspector is similar to Selenium IDE record and Playback tool. It is also is used for
record and playback tasks. It is used to record and play the native application behavior by
inspecting DOM and generate the test scripts in any desired language.

Appium Inspector does not support Windows and uses UIAutomator viewer as its option.

1428. What is the difference between Appium and Selendroid?

A list of differences between Appium and Selendroid:

Appium Selendroid

Appium is an open-source automation tool that supports Selendroid is a test automation framework that only
both iOS and Android. supports Android.

Appium is easy to use as a small change does not On the other hand, In Selendroid, when you do
require reinstallation of the application. changes, it requires reinstallation of the application.

Appium has a strong and active community. Selendroid does not have a strong community like
Appium.

Appium supports many frameworks and languages such On the other hand, Selendroid is compatible with
as Java, Python, C#, Ruby, JavaScript, PHP, etc. Jenkins and Selenium only.

It doesn't require application source code or library in In Selendroid, The application source code or library
Appium. is required.

Page | 374
1429. What are the basic requirements for writing Appium tests?

We need the following things for writing Appium tests:

o Driver Client: Appium drives mobile applications such as a user. It needs a Driver
Client library to write your Appium tests, which wraps test steps and sends them to the
Appium server over HTTP.
o Appium Session: We have first to initialize a session so that the Appium test can take
place in the session. Once the Automation is done for one session, it can be ended and
wait for another session.
o Desired Capabilities: Desired Capabilities are certain parameters such as PlatformName,
PlatformVersion, and Device Name, etc., which are required to initialize an Appium
session. It specifies the kind of automation one requires from the Appium server.
o Driver Commands: Driver Commands are used to write test steps using a large and
expressive vocabulary of commands.

1430. What is the difference between Appium and Robotium?

A list of differences between Appium and Robotium:

Appium Robotium

Appium is an open-source, cross-platform testing tool that is Robotium is only used with Android.
used with both iOS and Android.

Appium supports many frameworks and languages such as Robotium only supports Java programming
Java, Python, C#, Ruby, JavaScript, PHP, etc. language.

Appium does not need application source code or library. Robotium tool requires application source code

Page | 375
or library.

We can use Appium to test native, web, and hybrid mobile Robotium is only used to test native and hybrid
applications. applications.

Appium supports many frameworks, such as Selenium. Robotium is not compatible with Selenium at
all.

In Appium, a small change does not require reinstallation of In Robotium, you have to completely rebuild
the application. the code, even for a small change.

1431. What are some possible errors that a developer can face while using Appium?

Following is the list of some possible errors a developer can face using Appium:

o Error 1: The following desired capabilities are needed but not provided: Device Name,
platformName
o Error 2: Could not find adb. Please set the ANDROID_HOME environment variable
with the Android SDK root directory path.
o Error 3:selenium.SessionNotCreatedException: A new session could not be created
o Error 4: How to find DOM element or XPath in a mobile application?

1432. What are the main types of mobile app testing?

Following is the list of some types of mobile app testing:

o Usability testing
o Compatibility testing
o Performance testing
o Interface testing
o Services testing
o Low-level resource testing

Page | 376
o Operational testing
o Installation testing
o Security testing etc.

1433. What is Mobile Application Testing (MAT), and how is it different from Mobile Testing
(MT)?

Mobile Application Testing is the testing of an application on mobile devices. It is entirely


different from Mobile Testing. In Mobile Testing, the main focus is on the native application
features of Mobile devices such as Calls, SMS, Media Player, etc. On the other hand, in Mobile
Application Testing, the main focus is only on the application's functionality and features we
want to test.

1434. What is the most challenging scenario to test with Appium?

The data exchange is the most challenging scenario to test with Appium.

1435. What is the difference between simulator and emulator?

A simulator creates an environment that mimics the behavior and configurations of an actual
device. On the other hand, an emulator is used to duplicate all the device's hardware and software
features. Emulation and simulation processes are both used in mobile app testing in addition to
real devices.

1436.Is a server machine required to run tests on Appium?

No. There is no need for a server machine to run tests on Appium. Appium provides a 2-tier
architecture where a test machine connects to a test server running Appium and automating the
whole thing. We can run Appium on the same machine where we run our test.

1437. What is the general structure of mobile application testing frameworks?

There are mainly three segments used in Mobile Application Testing frameworks:

Page | 377
o Application Package: the Application Package is the target application that we have to
test.
o Instrumentation TestRunner: The Instrumentation TestRunner can be defined as a test
case runner that runs test cases on the target application. It consists of an SDK tool for
building tests and a tool that provides APIs for writing a program that controls an
Android device, for example, MonkeyRunner.
o Test Package: The Test Package contains two classes, Test case classes and Mock
objects. The Test case classes include test methods to perform on the target application,
while the mock object has mock data that will be used as sample input for test cases.

1438.Is it possible to interact with apps using JavaScript while testing with Appium?

Yes. We can easily interact with Apps while using JavaScript. When we run the commands on
Appium, the server sends the script to our app wrapped into an anonymous function to be
executed.

1439. What is the full form of iPA, APK, .exe, jad, and prc?

The full form of these terms is as follows:

o iPA: iOS APP Store Package


o APK: Android Application Package file
o .exe: Executable File
o jad: Java Application Descriptor
o prc: Palm Resource Compiler

1440. What are the desired capabilities in testing?

The desired capabilities are keys and values such as a map or hash sent by the client to the
server. The client sends these to tell the server what kind of automation session they want.

Page | 378
1441.Can a tester run the tests in a multithreaded environment while using Appium?

Yes, testers can run the tests in a multithreaded environment while using Appium. The only thing
that they have to care about is to ensure that no more than one test runs at the same time against
the same Appium server.

1442. How can you inspect elements of the Native Android App?

It is easy to inspect the elements of the Native Android App using the UIAutomator tool in
Android SDK. You can also get access to the object locators of the Android Native Apps.

1443. What do you understand by Appium package master? How would you create a package?

Appium package master is a set of tools used to manage and create Appium packages. We can
use the following code to create a package:

# using es7/babe1:

Gulp create-package -n <package-name>

#regular es5:

Gulp create-package ---nobabe1 -n <package-name>

The package will be generated in the out/<package-name>

1444.What are some critical issues you faced with cross-platform testing?

Generally, cross-platform testing is compatible with multiple platforms, but one can face cross-
platform testing issues. The issues depend upon the different OS/device versions. You can see
that the same application works on one OS while it might not work on another version.

For example, we have faced an issue that our application was working fine on iOS 6.x version
devices but on tapping a few modules on iOS 5.x devices, the application crashes. The same
thing happened with 2.3.5 Vs.

Page | 379
1445. What do you need to automate using Appium in Android? An app's .apk or you also need
the app in my workspace?

In Android, we only need a .apk file to automate using Appium.

1446.Does Appium support test frameworks?

Appium does not support test frameworks because there is no need to keep them. We can use
Appium with any frameworks that we want.

1447. What is the difference between Appium and Calabash?


Feature Comparison Appium Calabash

Supporting Languages Appium supports Java, Python, JavaScript, Calabash only supports the
.Net, Ruby, and all major available Ruby programming language.
programming languages.

iOS mobile web page It requires a custom safari app for automation. This is not well supported.

Hybrid iOS app It requires custom UI commands & iOS UI It requires custom UI
Automator. commands & an iOS
framework.

Native iOS app Only the iOS UI Automator iOS instrumentation - calabash
iOS

Android Mobile web app It only automates chrome browser. It is not well supported.

Hybrid Android app It It requires Android instrumentation - calabash


requires only the Selendroid android.
app.

Native Android app It requires.s both android UI Autometer & It requires Android
instrumentation - calabash

Page | 380
Selendroid android.

Internal tools It requires Android, iOS UI Autometer & It requires an Android & iOS
Selendroid. instrumentation framework.

1448.What do you understand by native Apps?

Those Apps which are written by using Android SDKs and iOS are known as Native Apps.

1449. What do you understand by Mobile Web Apps?

The mobile web pages that can be accessed with mobile browsers are known as Mobile Web
Apps. In the case of the iOS platform, Appium supports the Safari browser, and for the Android
platform, it uses Chrome or any other built-in browser.

1450. What do you understand by hybrid apps?

The apps equipped with a wrapper around the web view are known as Hybrid apps.

1451. How much time is required to write a test in Appium?

The time to write a test in Appium depends on the test. If your test runs a scenario, it will take as
many commands as the number of interactions needed to be performed (thus very few lines),
then it will take less time. If you are trying to exchange data, your test will take more time for
sure, and the test will also become challenging to read.

1452. How is the data exchanged between your test and the app while testing the app?

In Appium, the Web driver doesn't require to exchange data with the app. But it is not impossible
to exchange data. You can quickly achieve this by building more layers of testability.

Page | 381
1453.Is debugging a problematic task in Appium?

No, debugging is not much tricky in Appium. Appium is a Node.js application; thus, the code is
written in JavaScript. You can find the code on GitHub and downloaded it in a few seconds as it
is small and not so complex. The complexity also depends on what you have to debug.

1454. How can you inspect elements on the iOS apps?

We can quickly inspect elements on the iOS apps by using an Appium inspector. It is a GUI-
based tool used to identify elements on iOS apps. This is quite similar to that of selenium IDE.

List out the Appium abilities?


Appium abilities are

 Test Web
 Provides cross-platform for Native and Hybrid mobile automation
 Support JSON wire protocol
 It does not require recompilation of App
 Support automation test on physical device as well as similar or emulator both
 It has no dependency on mobile device

1455.List out the pre-requisite to use APPIUM?


Pre-requisite to use APPIUM is

 ANDROID SDK
 JDK
 TestNG
 Eclipse
 Selenium Server JAR
 Webdriver Language Binding Library
 APPIUM for Windows
 APK App Info On Google Play
 js

1456. List out the limitations of using Appium?

 Appium does not support testing of Android Version lower than 4.2
 Limited support for hybrid app testing. E.g., not possible to test the switching action of
application from the web app to native and vice-versa

Page | 382
 No support to run Appium Inspector on Microsoft Windows

1457. Explain how to find DOM element or xPath in a mobile application?


To find the DOM element use “UIAutomateviewer” to find DOM element for Android
application.

1458. Explain the design concept of Appium?

 Appium is an “HTTP Server” written using Node.js platform and drives iOS and Android
session using Webdriver JSON wire protocol. Hence, before initializing the Appium
Server, Node.js must be pre-installed on the system
 When Appium is downloaded and installed, then a server is setup on our machine that
exposes a REST API
 It receives connection and command request from the client and execute that command
on mobile devices (Android / iOS)
 It responds back with HTTP responses. Again, to execute this request, it uses the mobile
test automation frameworks to drive the user interface of the apps. Framework like
 Apple Instruments for iOS (Instruments are available only in Xcode 3.0 or later with OS
X v10.5 and later)
 Google UIAutomator for Android API level 16 or higher
 Selendroid for Android API level 15 or less

1459. What language does Appium support?


Appium support any language that support HTTP request like Java, JavaScript with Node.js,
Python, Ruby, PHP, Perl, etc.

1460. Explain the pros and cons of Appium?


Pros:

 For programmer irrespective of the platform, he is automating ( Android or iOS) all the
complexities will remain under single Appium server
 It opens the door to cross-platform mobile testing which means the same test would work
on multiple platforms
 Appium does not require extra components in your App to make it automation friendly
 It can automate Hybrid, Web and Native mobile applications

Cons:

 Running scripts on multiple iOS simulators at the same time is possible with Appium

Page | 383
 It uses UIAutomator for Android Automation which supports only Android SDK
platform, API 16 or higher and to support the older API’s they have used another open
source library called Selendroid

1461. Explain what is APPIUM INSPECTOR?


Similar to Selenium IDE record and Playback tool, Appium has an “Inspector” to record and
playback. It records and plays native application behavior by inspecting DOM and generates the
test scripts in any desired language. However, Appium Inspector does not support Windows and
use UIAutomator viewer in its option.

1462. Mention what are the basic requirement for writing Appium tests?
For writing Appium tests you require,

 Driver Client: Appium drives mobile applications as though it were a user. Using a
client library you write your Appium tests which wrap your test steps and sends to the
Appium server over HTTP.
 Appium Session: You have to first initialize a session, as such Appium test takes place in
the session. Once the Automation is done for one session, it can be ended and wait for
another session
 Desired Capabilities: To initialize an Appium session you need to define certain
parameters known as “desired capabilities” like PlatformName, PlatformVersion, Device
Name and so on. It specifies the kind of automation one requires from the Appium server.
 Driver Commands: You can write your test steps using a large and expressive
vocabulary of commands.

1463. Mention what are the possible errors one might encounter using Appium?
The possible errors one might face in Appium includes

 Error 1: The following desired capabilities are needed but not provided: Device Name,
platformName
 Error 2: Could not find adb. Please set the ANDROID_HOME environment variable
with the Android SDK root directory path
 Error 3: openqa.selenium.SessionNotCreatedException: A new session could not be
created
 Error 4: How to find DOM element or XPath in a mobile application?

Page | 384
1464. Do you need a server machine to run tests on Appium?
No, you don’t need server machine to run tests on Appium. Appium facilitates a 2-tier
architecture where a test machine connects to a test server running Appium and automating the
whole thing. You can have Appium running on the same machine where your test runs.

1465.Is it possible to interact with my apps using Javascript while I am testing with
Appium?
Yes, it is possible to interact with App while using Javascript. When the commands run on
Appium, the server will send the script to your app wrapped into an anonymous function to be
executed.

1466. Mention what are the most difficult scenarios to test with Appium?
The most difficult scenario to test with Appium is data exchange.

1467. While using Appium can I run my tests in a multithreaded environment?


Yes, you can run the test in a multithreaded environment but you have to ensure that no more
than one test runs at the same time against the same Appium server.

1468.In Android, do you need an app’s .apk to automate using Appium or you also need
app in my workspace?
In Android, you only need .apk file to automate using Appium.

1469. Explain what is Appium package master? How to create package?


Appium package master is a set of tools manage and create appium packages. For example to
create package you can use the code

# using es7/babe1

Gulp create-package –n <package-name>

#regular es5

Page | 385
Gulp create-package ---nobabe1 –n <package-name>

The package will be generated in the out/<package-name>

1470.Explain how test frameworks are supported by Appium?


Appium does not support test framework as such there is no need to support them. Appium can
be used with any frameworks you want.

These interview questions will also help in your viva(orals)

Page | 386
Siku li Inte rvi ew Que stion s And An sw e rs
1471. Explain What Is Sikuli?
Answer :
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.

1472. Mention What Sikuli Is Comprised Of?


Answer :
Sikuli is comprised of:
o Sikuli Script
o Visual Scripting API for Jython
o Sikuli IDE
o

1473.List Out What Are The Practical Uses Of Sikuli?


Answer :
Practical uses of Sikuli:
o It can be used to automate flash websites or objects
o It can automate window based application and anything you see on screen without
using internal API support
o It provides simple API
o It can be easily linked with tools like Selenium
o Desktop application can be automated
o Sikuli offers extensive support to automate flash objects
o To automate desktop it uses powerful “Visual Match” and Flash objects
o It can work on any technology-.NET, Java.

1474. Mention What Is The Difference Between Selenium And Sikuli?


Answer :
Sikuli Selenium:
o It provides extensive support to automate flash objects
o It has simple API
o It uses visual match to find elements on the screen. So we can automate anything we
see on the screen
o It can automate web as well as windows application
o It cannot automate flash objects like video player, audio player,
o It has got complicated API
o It does not have visual match
o It can automate only web applications
o

Page | 387
1475.Explain What Exactly Does Sikuli Script Consist Of?
Answer :
Sikuli Script is a combination of Jython and Java library that automates GUI interaction using
image pattern to direct mouse or keyboard events.
The main segment of Sikuli Script is a Java library which contains two parts:
o awt.Robot: It delivers mouse and keyboard events to appropriate locations
o C++ engine based on OpenCV: It searches given pattern on the screen sikuli-logo
o
1476. Explain How Sikuli Script Works?
Answer :
To run a Sikuli Script, Sikuli IDE creates an org.python.util.PythonInterpreter and passes a
few lines of headers to the interpreter automatically. Once these headers are defined or set, the
.py script is simply executed by PythonIntepreter.execfile().

1477. Explain How You Can Retrieve The Name Of The Image On Pop-up?
Answer :
You can retrieve the name of the image on pop-up in two ways
Method: 1
query = capture()
gotit = Filename [query] [0]
popup(gotit)
Method: 2
popup(“select a icon in the”)
query = capture()
Result = Filename [query]
If result:
Popup(Result[0])
else:
popup (“unknown image”)

1478. Explain How You Can Create An Object For Screen Class And Why Screen Class
Is Important?
Answer :
In Sikuli, screen is a base class, for this screen class we have to create an object first only then
we can access all the methods provided by Sikuli. Syntax for sikuli includes
Syntax for creating an object in Sikuli: Screen s=new Screen()

147 9. Mention What Is The Short-cut To Kill The Sikuli Script?


Answer :
To kill the Sikuli Script, you have to use the short cut Alt+Shift+C.

Page | 388
1480. Mention What Is The Command That Is Used To Find Whether A Particular
Element Present On The Screen?
Answer :
To find a specific element on the screen you use the syntax
s.find(“<<image name>>”);

1481. Explain What Is Region In Sikuli?


Answer :
In Sikuli, Region class provides an abstraction for the screen regions returned by the find()
function matching a given visual pattern. Its attributes include X and Y co-ordinates, height,
width, and similarity score.

1482. Explain What Is Sikuli Slides?


Answer :
Sikuli slides can be used to test and automate anything you see on the screen using your
presentation slides. For automating repetitive tasks and to crate PowerPoint presentation.

1483. How Sikuli Looks For A Location For Search Images?


Answer :
For Sikuli, it maintains a list of location to locate images when they are not found in the
Sikuli folder. Sikuli will use following the command to look, add or remove images from the
folder.
getImagePath(): # getImagePath() returns a Java array of Unicode strings
addImagePath: It adds a new path to the list of image search path
removeImagePath : It removes a path from the list of image search paths

1484. What Is The Command Setautowaittimeout And Getautowaittimeout() Command


Is Used For?
Answer :
The setAutoWaitTimeout command is used to determine the maximum waiting time for all
subsequent find operations. While the getAutoWaitTimeout is used to determine the current
value of the maximum waiting time for find operations.

1485. Explain What Is Match In Sikuli?


Answer :
In Sikuli, Match is a class available in Sikuli Package. Class match extends class Region, all
methods of class region can be availed with a match object. An object of class Match
displays the result of a successful find operation.

1486. Mention What Is The File Extension-name.py Is Used For?


Answer :
The file extension-name.py contains the classes and methods, which represents the API; that
might be used in a Sikuli Script.

Page | 389
1487. Mention What Is The Command Used To Type A String On A Text Box?
Answer :
To enter particular text on the text box this method is used and command is
s.type(“<<image name>>” , “String to be typed”);

1488. Is It Possible To Work In A Particular Region In Sikuli?


Answer :
Yes, it is possible to work with a particular region in Sikuli. Based on the location of a
unique pattern (image) on your display, you can also increase the size of the region.

1489.What a re the B ene fit s o f Si ku li ?


A n s w e r: Open-source Tool.
One of the biggest advantages of Sikuli is that it can easily automate Flash objects.
It makes easy to automate windows application.
When you’re testing an application under development and you don’t know the ID/name
of the elements, then you can go with Sikuli. It will check the appearance of the image
and if the match found, it will interact with the image accordingly.

1490. Steps To Create The Sikuli Java Project?


Step #1: Sikuli Download – Download Sikuli from here.
Step #2: Extract the zip file which you’ve downloaded. It will contain the Sikuli-script.jar file.
Save this extracted file in your local file system.
Step #3: Open Eclipse.
Step #4: Create a java project File -> New -> Java Project
Step #5:
1. Right Click on the project
2. Go to Build Path-> Configure Build Path
3. Switch to Libraries tab
4. Click the “Add External Jars” button and Add Sikuli-Script.jar in the Build Path.
5. Click “Ok”

1491. Some Sikuli Methods?


#1) Creating Object for Screen Class
The screen is a base class provided by Sikuli. We need to create an object for this screen class
first, then only we can access all the methods provided by Sikuli.

Syntax:
Screen s=new Screen();
#2) Click On An Element
This method used to Click on the specific image present on the screen.

Page | 390
Syntax:
s.click(“<<image name>>”);
For Example,
s.click(“test.png”);
#3) Right Click On An Element
This method used to right-click on the specific image present on the screen.

Syntax:
s.rightClick(“<<image name>>”);
For Example,
s.rightClick(“test.png”);
#4) Find An Element
This method used to find a specific element present on the screen.

Syntax:
s.find(“<<image name>>”);
For Example,
s.find(“test.png”);
#5) Double Click on An Element
This method used to trigger a double click event on a specific image present on the screen.

Syntax:
s.doubleClick(“<<image name>>”);
For Example,
s.doubleClick(“test.png”);
#6) Check whether an Element present on the Screen
This method is used to check whether the specified element is present on the screen.

Syntax:
s.exists(“<<image name>>”);
For Example,
s.exists(“test.png”);
#7) Type a string on a Textbox
This method is used to enter the specified text on the Text box.

Syntax:
s.type(“<<image name>>”,”String to be typed”);
For Example,
s.type(“test.png”,”HI!!”);
#8) Wheeling on a particular image
This method is used to perform wheeling action on the element image.

Syntax:
s.wheel(“<<image name>>”,<<int position>>,<<int direction>>);

Page | 391
For Example,
s.wheel(“test.png”,25,0);
#9) Drag and Drop a Image/Element
This method is used to drag and drop a specified image from source position to target position.

Syntax:
s.dragDrop(“<<source image name>>”,”<<target image name>>”);
For Example,
s.dragDrop(“test.png”,”test1.png”);
#10) Roll Hover on a particular image
This method is used to perform roll hover event on the specified image.

Syntax:
s.hover(“<<image name>>”);
For Example,
s.hover(“test.png”);
#11) Paste Copied String
This method used to paste text on the specified textbox.

Syntax:
s.paste(“<<image name>>”,”test”);
For Example,
s.paste(“test.png”,”test”);

1492.What a re D rawba c ks o f Si ku li?


Answer:
We cannot assure you that the image match will be always accurate. Sometimes, if
two or more similar images are available on the screen, Sikuli will attempt to select
the wrong image.
And if image appearance varies in pixel size, it will also result in the “Find Failed ”
exception.
Overhead of taking too many screenshots.
If anyone of the screenshot is missing, it will affect the execution of the program.

1493.WHAT IS SIKULI?
Sikuli is an open source automation testing tool which is used for test automation of web
application as well as a desktop application.

1494.HOW DOES SIKULI WORK?


Skiuli works in a different and easy way. You don’t need to bother about locators, XPath or any
other techniques. Here you just need to capture the image of the element at which you are going
to perform UI action. But, you must sure that you don’t change the resolution of the
environment. Hence, automation testing with Sikuli is only feasible on static UI objects.

Page | 392
1495. Mechanism of Sikuli with Selenium?
The object, if we want to automate, should be captured and placed in a specific folder and pass
the path of the appropriate image into our Selenium script. At the time of execution, if the image
which we passed is matched with the image on the screen then the desired action will be
performed on that object.

Page | 393

You might also like