Testing Interview Questions and Answers
Testing Interview Questions and Answers
Contents
Testing Techniques....................................................................................................................................36
METRICS....................................................................................................................................................39
SOFTWARE TESTING BASICS......................................................................................................................44
Automation testing....................................................................................................................................71
V&V...........................................................................................................................................................74
What is Verification?.............................................................................................................................74
What is Validation?................................................................................................................................74
Difference between Verification and Validation....................................................................................75
Difference between Regression and Retesting..........................................................................................76
What is software testing?..........................................................................................................................76
What is Functional testing ?......................................................................................................................77
STLC ?........................................................................................................................................................77
Defect Life cycle.........................................................................................................................................78
Priority and severity..................................................................................................................................79
AGILE.........................................................................................................................................................81
What is Agile Testing?...........................................................................................................................81
Advantages of Agile Testing...................................................................................................................81
Principles of Agile Testing......................................................................................................................81
What is Agile Methodology?..................................................................................................................82
Agile Vs Waterfall Method.................................................................................................................82
Scrum.................................................................................................................................................84
Product Backlog.................................................................................................................................85
Process flow of Scrum Methodologies:.............................................................................................85
eXtreme Programming (XP)...............................................................................................................86
Software Development Life Cycle – SDLC Phases..................................................................................93
Software Testing Challenges in the Iterative Models.............................................................................93
Iterative Model......................................................................................................................................93
Incremental Model................................................................................................................................93
Rapid Application Development (RAD)..................................................................................................93
Spiral Model..........................................................................................................................................93
Prototyping............................................................................................................................................94
2
V Model.................................................................................................................................................94
Waterfall Model in Software Testing.....................................................................................................94
End to end testing.....................................................................................................................................94
Endurance testing ?...................................................................................................................................94
What is Endurance Testing?..................................................................................................................94
Issues found - Endurance Testing..........................................................................................................95
Entry exit criteria.......................................................................................................................................95
What is an Entry Criterion?....................................................................................................................95
Examples for Entry Criterion:.................................................................................................................95
What is an Exit Criterion?......................................................................................................................95
Examples of Exit Criteria:.......................................................................................................................95
What is an Exploratory Testing?............................................................................................................96
Benefits:................................................................................................................................................96
Drawbacks:............................................................................................................................................96
What is Failover Testing?.......................................................................................................................96
Example:................................................................................................................................................96
Factors to be Considered:......................................................................................................................97
What is Functional Testing?...................................................................................................................97
Functional Testing Techniques:.............................................................................................................97
DOMAIN....................................................................................................................................................98
Selenium....................................................................................................................................................98
Selenium Interview Questions...............................................................................................................98
Q. What is the most challenging situation you ever had during Testing?
Q. How to perform testing when there are no documents?
Ans. Click here for the detailed post on how to answer these QA interview questions.
Q. What is the difference between Performance Testing, Load Testing, and Stress Testing?
Explain with examples?
Ans. Many people are confused with these testing terminologies. Click here for the detailed
explanation of Performance, Load and Stress Testing with examples.
Q. ISTQB questions and answers (more questions here and also here)
Ans. Click the above links to read about ISTQB paper pattern and tips on how to solve these
questions quickly. ISTQB ‘Foundation level’ sample questions with answers are found here.
Ans. Click the above link for questions and answers about CSTE.
Q. What is Process?
Ans. A process is a set of practices performed to achieve a given purpose; it may include tools,
methods, materials or people.
Q. What is a Defect?
Ans. Any flaw or imperfection in a software work product is termed as a Defect.
(or)
When the expected result does not match with the application actual result, it is termed so.
Q. What is Severity?
Ans. It defines the importance of the defect from the functional point of view i.e. how critical is
a defect with respect to the application.
Q. What is Priority?
Ans. It indicates the importance or urgency of fixing a defect
Q. What is Re-Testing?
Ans. Re-testing the application means verifying whether the defects have been fixed or not.
QC?
QC is product oriented and it is a Set of activities used to evaluate a developed work product
Testing?
Executing and verifying an application with the intention of finding defects.
I hope that the above given Manual and Automation Software Testing Interview Questions and
Answers would have been too beneficial to each of you. And I’m sure that with a thorough
knowledge of these Questions and Answers, you can appear for any Interview confidently and
get through very successfully.
1. What is the MAIN benefit of designing tests early in the life cycle?
It helps prevent defects from being introduced into the code.
Risk-based Testing is the term used for an approach to creating a Test Strategy that is based on
prioritizing tests by risk. The basis of the approach is a detailed risk analysis and prioritizing of
risks by risk level. Tests to address each risk are then specified, starting with the highest risk
first.
3. What is the KEY difference between preventative and reactive approaches to testing?
Preventative tests are designed early; reactive tests are designed after the software has been
produced.
The likelihood of an adverse event and the impact of the event determine the level of risk.
11
Decision table testing is used for testing systems for which the specification takes the form of
rules or cause-effect combinations. In a decision table the inputs are listed in a column, with the
outputs in the same column but below the inputs. The remainder of the table explores
combinations of inputs to define the outputs produced.
Learn More About Decision Table Testing Technique in the Video Tutorial here
8. Which of the following defines the expected results of a test? Test case specification or
test design specification.
10. As part of which test process do you determine the exit criteria?
12. Given the following fragment of code, how many tests are required for 100% decision
coverage?
thenbiggest_dimension = width
thenbiggest_dimension = height
end_if
elsebiggest_dimension = length
thenbiggest_dimension = height
end_if
end_if
13. You have designed test cases to provide 100% statement and 100% decision coverage
for the following fragment of code. if width > length then biggest_dimension = width else
biggest_dimension = length end_if The following has been added to the bottom of the code
fragment above. print "Biggest dimension is " &biggest_dimensionprint "Width: " &
width print "Length: " & length How many more test cases are required?
15. What is the difference between Testing Techniques and Testing Tools?
Testing technique: – Is a process for ensuring that some aspects of the application system or unit
functions properly there may be few techniques but many tools.
Testing Tools: – Is a vehicle for performing a test process. The tool is a resource to the tester, but
itself is insufficient to conduct testing
16. We use the output of the requirement analysis, the requirement specification as the
input for writing …
17. Repeated Testing of an already tested program, after modification, to discover any
defects introduced or uncovered as a result of the changes in the software being tested or in
another related or unrelated software component:
13
Regression Testing
18. A wholesaler sells printer cartridges. The minimum order quantity is 5. There is a 20%
discount for orders of 100 or more printer cartridges. You have been asked to prepare test
cases using various values for the number of printer cartridges ordered. Which of the
following groups contain three test inputs that would be generated using Boundary Value
Analysis?
4, 5, 99
Component testing, also known as unit, module and program testing, searches for defects in, and
verifies the functioning of software (e.g. modules, programs, objects, classes, etc.) that are
separately testable. Component testing may be done in isolation from the rest of the system
depending on the context of the development life cycle and the system. Most often stubs and
drivers are used to replace the missing software and simulate the interface between the software
components in a simple manner. A stub is called from the software component to be tested; a
driver calls a component to be tested.
Testing the end to end functionality of the system as a whole is defined as a functional system
testing.
Independent testers are unbiased and identify different defects at the same time.
22. In a REACTIVE approach to testing when would you expect the bulk of the test design
work to be begun?
The bulk of the test design work begun after the software or system has been produced.
There are currently seven different agile methodologies that I am aware of:
24. Which activity in the fundamental test process includes evaluation of the testability of
the requirements and system?
A 'Test Analysis' and 'Design' includes evaluation of the testability of the requirements and
system.
25. What is typically the MOST important reason to use risk to drive testing efforts?
Random testing often known as monkey testing. In such type of testing data is generated
randomly often using a tool or automated mechanism. With this randomly generated input the
system is tested and results are analysed accordingly. These testing are less reliable; hence it is
normally used by the beginners and to see whether the system will hold up under adverse effects.
27. Which of the following are valid objectives for incident reports?
1. Provide developers and other parties with feedback about the problem to enable
identification, isolation and correction as necessary.
2. Provide ideas for test process improvement.
3. Provide a vehicle for assessing tester competence.
4. Provide testers with a means of tracking the quality of the system under test.
28. Consider the following techniques. Which are static and which are dynamic
techniques?
1. Equivalence Partitioning.
2. Use Case Testing.
3. Data Flow Analysis.
4. Exploratory Testing.
5. Decision Testing.
6. Inspections.
Data Flow Analysis and Inspections are static; Equivalence Partitioning, Use Case Testing,
Exploratory Testing and Decision Testing are dynamic.
29. Why are static testing and dynamic testing described as complementary?
Because they share the aim of identifying defects but differ in the types of defect they find.
In contrast to informal reviews, formal reviews follow a formal process. A typical formal review
process consists of six main steps:
1. Planning
2. Kick-off
3. Preparation
4. Review meeting
5. Rework
6. Follow-up.
The moderator (or review leader) leads the review process. He or she determines, in co-operation
with the author, the type of review, approach and the composition of the review team. The
moderator performs the entry check and the follow-up on the rework, in order to control the
quality of the input and output of the review process. The moderator also schedules the meeting,
disseminates documents before the meeting, coaches other team members, paces the meeting,
leads possible discussions and stores the data that is collected.
An input or output ranges of values such that only one value in the range becomes a test case.
34. A Type of functional Testing, which investigates the functions relating to detection of
threats, such as virus from malicious outsiders?
Security Testing
35. Testing where in we subject the target of the test , to varying workloads to measure and
evaluate the performance behaviours and ability of the target and of the test to continue to
function properly under these different workloads?
Load Testing
36. Testing activity which is performed to expose defects in the interfaces and in the
interaction between integrated components is?
Structure-based testing techniques (which are also dynamic rather than static) use the internal
structure of the software to derive test cases. They are commonly called 'white-box' or 'glass-box'
techniques (implying you can see into the system) since they require knowledge of how the
software is implemented, that is, how it works. For example, a structural technique may be
concerned with exercising loops in the software. Different test cases may be derived to exercise
the loop once, twice, and many times. This may be done regardless of the functionality of the
software.
After the software has changed or when the environment has changed Regression testing should
be performed.
A negative test is when you put in an invalid input and receives errors. While a positive testing,
is when you put in a valid input and expect some action to be completed in accordance with the
specification.
Re-testing ensures the original fault has been removed; regression testing looks for unexpected
side effects.
44. What type of review requires formal entry and exit criteria, including metrics?
Inspection
46. An input field takes the year of birth between 1900 and 2004 what are the boundary
values for testing this field?
1899,1900,2004,2005
47. Which of the following tools would be involved in the automation of regression test? a.
Data tester b. Boundary tester c. Capture/Playback d. Output comparator.
d. Output comparator
48. To test a function, what has to write a programmer, which calls the function to be tested
and passes it test data.
Driver
49. What is the one Key reason why developers have difficulty testing their own work?
Lack of Objectivity
The answer depends on the risk for your industry, contract and special requirements.
It depends on the risks for the system being tested. There are some criteria bases on which you
can stop testing.
52. Which of the following is the main purpose of the integration strategy for integration
testing in the small?
The main purpose of the integration strategy is to specify which modules to combine when and
how many at once.
Semi-random test cases are nothing but when we perform random test cases and do equivalence
partitioning to those test cases, it removes redundant test cases, thus giving us semi-random test
cases.
54. Given the following code, which statement is true about the minimum number of test
cases required for full statement and branch coverage?
Read p
Read q
IF p+q> 100
ENDIF
IF p > 50
ENDIF
55. What is black box testing? What are the different black box testing techniques?
Black box testing is the software testing method which is used to test the software without
knowing the internal structure of code or program. This testing is usually done to check the
functionality of an application. The different black box testing techniques are
1. Equivalence Partitioning
2. Boundary value analysis
3. Cause effect graphing
56. Which review is normally used to evaluate a product to determine its suitability for
intended use and to identify discrepancies?
Technical Review.
The techniques of equivalence partitioning and boundary value analysis are often applied to
specific situations or inputs. However, if different combinations of inputs result in different
19
actions being taken, this can be more difficult to show using equivalence partitioning and
boundary value analysis, which tend to be more focused on the user interface. The other two
specification-based techniques, decision tables and state transition testing are more focused on
business logic or business rules. A decision table is a good way to deal with combinations of
things (e.g. inputs). This technique is sometimes also referred to as a 'cause-effect' table. The
reason for this is that there is an associated logic diagramming technique called 'cause-effect
graphing' which was sometimes used to help derive the decision table
By testers.
60. Which of the following is the review participant who has created the item to be
reviewed?
Author
61. A number of critical bugs are fixed in software. All the bugs are in one module, related
to reports. The test manager decides to do regression testing only on the reports module.
Regression testing should be done on other modules as well because fixing one module may
affect other modules.
62. Why does the boundary value analysis provide good test cases?
Because errors are frequently made during programming of the different cases near the 'edges' of
the range of values.
It is led by a trained leader, uses formal entry and exit criteria and checklists.
Because configuration management assures that we know the exact version of the testware and
the test object.
A software development model that illustrates how testing activities integrate with software
development phases
20
Test coverage measures in some specific way the amount of testing performed by a set of tests
(derived in some other way, e.g. using specification-based techniques). Wherever we can count
things and can tell whether or not each of those things has been tested by some test, then we can
measure coverage.
Because incremental integration has better early defects screening and isolation ability
69. When do we prepare RTM (Requirement traceability matrix), is it before test case
designing or after test case designing?
It would be before test case designing. Requirements should already be traceable from Review
activities since you should have traceability in the Test Plan already. This question also would
depend on the organisation. If the organisations do test after development started then
requirements must be already traceable to their source. To make life simpler use a tool to manage
requirements.
70. What is called the process starting with the terminal modules?
Bottom-up integration
71. During which test activity could faults be found most cost effectively?
To measure test effectiveness a powerful metric is used to measure test effectiveness known as
DRE (Defect Removal Efficiency) From this metric we would know how many bugs we have
found from the set of test cases. Formula for calculating DRE is
DRE=Number of bugs while testing / number of bugs while testing + number of bugs found by
user
75. Which of the following is likely to benefit most from the use of test tools providing test
capture and replay facilities? a) Regression testing b) Integration testing c) System testing
d) User acceptance testing
Regression testing
76. How would you estimate the amount of re-testing likely to be required?
Metrics from previous similar projects and discussions with the development team
Is it really a test if you put some inputs into some software, but never look to see whether the
software produces the correct result? The essence of testing is to check whether the software
produces the correct result, and to do that, we must compare what the software produces to what
it should produce. A test comparator helps to automate aspects of that comparison.
81. Who is responsible for document all the issues, problems and open point that were
identified during the review meeting
Scribe
84. When testing a grade calculation system, a tester determines that all scores from 90 to
100 will yield a grade of A, but scores below 90 will not. This analysis is known as:
Equivalence partitioning
85. A test manager wants to use the resources available for the automated testing of a web
application. The best choice is Tester, test automater, web specialist, DBA
86. During the testing of a module tester 'X' finds a bug and assigned it to developer. But
developer rejects the same, saying that it's not a bug. What 'X' should do?
Send to the detailed information of the bug encountered and check the reproducibility
87. A type of integration testing in which software elements, hardware elements, or both
are combined all at once into a component or an overall system, rather than in stages.
Big-Bang Testing
88. In practice, which Life Cycle model may have more, fewer or different levels of
development and testing, depending on the project and the software product. For example,
there may be component integration testing after component testing, and system
integration testing after system testing.
V-Model
89. Which technique can be used to achieve input and output coverage? It can be applied to
human input, input via interfaces to a system, or interface parameters in integration
testing.
Equivalence partitioning
90. "This life cycle model is basically driven by schedule and budget risks" This statement
is best suited for…
V-Model
92. The later in the development life cycle a fault is discovered, the more expensive it is to
fix. Why?
The fault has been built into more documentation, code, tests, etc
23
Test boundary conditions on, below and above the edges of input and output equivalence classes.
For instance, let say a bank application where you can withdraw maximum Rs.20,000 and a
minimum of Rs.100, so in boundary value testing we test only the exact boundaries, rather than
hitting in the middle. That means we test above the maximum limit and below the minimum
limit.
[Link] purpose of which is allow specific tests to be carried out on a system or network that
resembles as closely as possible the environment where the item under test will be used
upon release?
Test Environment
98. What can be thought of as being based on the project plan, but with greater amounts of
detail?
Exploratory testing is a hands-on approach in which testers are involved in minimum planning
and maximum test execution. The planning involves the creation of a test charter, a short
declaration of the scope of a short (1 to 2 hour) time-boxed test effort, the objectives and possible
approaches to be used. The test design and test execution activities are performed in parallel
typically without formally documenting the test conditions, test cases or test scripts. This does
not mean that other, more formal testing techniques will not be used. For example, the tester may
decide to use boundary value analysis but will think through and test the most important
boundary values without necessarily writing them down. Some notes will be written during the
exploratory-testing session, so that a report can be produced afterwards.
In order to identify and execute the functional requirement of an application from start to finish
"use case" is used and the techniques used to do this is known as "Use Case Testing"
Bonus!
101. What is the difference between STLC (Software Testing Life Cycle) and SDLC
(Software Development Life Cycle) ?
SDLC deals with developement/coding of the software while STLC deales with validation and
verification of the software
The relationship between test cases and requirements is shown with the help of a document. This
document is known as traceability matrix.
Equivalence partitioning testing is a software testing technique which divides the application
input test data into each partition at least once of equivalent data from which test cases can be
derived. By this testing method it reduces the time required for software testing.
104. What is white box testing and list the types of white box testing?
White box testing technique involves selection of test cases based on an analysis of the internal
structure (Code coverage, branches coverage, paths coverage, condition coverage etc.) of a
component or system. It is also known as Code-Based testing or Structural testing. Different
types of white box testing are
1. Statement Coverage
2. Decision Coverage
Static testing: During Static testing method, the code is not executed and it is performed using
the software documentation.
Dynamic testing: To perform this testing the code is required to be in an executable form.
Verification is a process of evaluating software at development phase and to decide whether the
product of a given application satisfies the specified requirements. Validation is the process of
evaluating software at the end of the development process and to check whether it meets the
customer requirements.
1. Unit/component/program/module testing
2. Integration testing
3. System testing
4. Acceptance testing
Integration testing is a level of software testing process, where individual units of an application
are combined and tested. It is usually performed after unit and functional testing.
Test design, scope, test strategies , approach are various details that Test plan document consists
of.
111. What is the difference between UAT (User Acceptance Testing) and System testing?
System Testing: System testing is finding defects when the system under goes testing as a whole,
it is also known as end to end testing. In such type of testing, the application undergoes from
beginning till the end.
26
UAT: User Acceptance Testing (UAT) involves running a product through a series of specific
tests which determines whether the product will meet the needs of its users.
112. Mention the difference between Data Driven Testing and Retesting?
Retesting: It is a process of checking bugs that are actioned by development team to verify that
they are actually fixed.
Data Driven Testing (DDT): In data driven testing process, application is tested with multiple
test data. Application is tested with different set of values.
113. What are the valuable steps to resolve issues while testing?
114. What is the difference between test scenarios, test cases and test script?
Test Scenarios: Test scenario is prepared before the actual testing starts, it includes plans for
testing product, number of team members, environmental condition, making test cases, making
test plans and all the features that are to be tested for the product.
Test Cases: It is a document that contains the steps that has to be executed, it has been planned
earlier.
Test Script: It is written in a programming language and it's a short program used to test part of
functionality of the software system. In other words a written set of steps that should be
performed manually.
Latent defect: This defect is an existing defect in the system which does not cause any failure as
the exact set of conditions has never been met
116. What are the two parameters which can be useful to know the quality of test
execution?
Phantom is a freeware, and is used for windows GUI automation scripting language. It allows to
take control of windows and functions automatically. It can simulate any combination of key
strokes and mouse clicks as well as menus, lists and more.
Test Deliverables are set of documents, tools and other components that has to be developed and
maintained in support of testing.
There are different test deliverables at every phase of the software development lifecycle
Before Testing
During Testing
After the Testing
Mutation testing is a technique to identify if a set of test data or test case is useful by
intentionally introducing various code changes (bugs) and retesting with original test data/ cases
to determine if the bugs are detected.
120. What all things you should consider before selecting automation tools for the AUT?
Technical Feasibility
Complexity level
28
Application stability
Test data
Application size
Re-usability of automated scripts
Execution across environment
b) Backtracking
c) Cause elimination
d) Program slicing
When presence of one defect hides the presence of another defect in the system is known as fault
masking.
Example : If the "Negative Value" cause a firing of unhandled system exception, the developer
will prevent the negative values inpu. This will resolve the issue and hide the defect of
unhandled exception firing.
124. Explain what is Test Plan ? What are the information that should be covered in Test
Plan ?
29
A test plan can be defined as a document describing the scope, approach, resources and schedule
of testing activities and a test plan should cover the following details.
Test Strategy
Test Objective
Exit/Suspension Criteria
Resource Planning
Test Deliverables
125. How you can eliminate the product risk in your project ?
To eliminate product risk in your project, there is simple yet crucial step that can reduce the
product risk in your project.
126. What are the common risk that leads to the project failure?
127. On what basis you can arrive to an estimation for your project?
Task Member
Analyze software requirement specification All the members
129. Explain what is testing type and what are the commonly used testing type ?
To get an expected test outcome a standard procedure is followed which is referred as Testing
Type.
130. While monitoring your project what all things you have to consider ?
132. What does a typical test report contains? What are the benefits of test reports?
Project Information
Test Objective
31
Test Summary
Defect
Management review is also referred as Software Quality Assurance or SQA. SQA focusses more
on the software process rather than the software work products. It is a set of activities designed
to make sure that the project manager follows the standard process. SQA helps test manager to
benchmark the project against the set standards.
134. What are the best practices for software quality assurance?
Continuous Improvement
Documentation
Tool Usage
Metrics
Responsibility by team members
Experienced SQA auditors
RTM is prepared before test case designing. Requirements should be traceable from review
activities.
Test Matrix: Test matrix is used to capture actual quality, effort, the plan, resources and time
required to capture all phases of software testing
Both stubs and drivers are part of incremental testing. In incremental testing there are two
approaches namely bottom up and top down approach. Drivers are used in bottom up testing and
stub is used for top down approach. In order to test the main module, stub is used, whuich is a
dummy code or program .
32
138. What are the step you would follow once you find the defect?
139. Explain what is "Test Plan Driven" or "Key Word Driven" method of testing?
This technique uses the actual test case document developed by testers using a spread sheet
containing special "key Words". The key words control the processing.
When a "flow of data" through an information system is graphically represented then it is known
as Data Flow Diagram. It is also used for the visualization of data processing.
LCSAJ stands for 'linear code sequence and jump'. It consists of the following three items
c) The target line to which control flow is transferred at the end of the linear sequence
The variation of regression testing is represented as N+1. In this technique the testing is
performed in multiple cycles in which errors found in test cycle 'N' are resolved and re-tested in
test cycle N+1. The cycle is repeated unless there are no errors found.
Fuzz testing is used to detect security loopholes and coding errors in software. In this technique
random data is added to the system in attempt to crash the system. If vulnerability persists, a tool
called fuzz tester is used to determine potential causes. This technique is more useful for bigger
projects but only detects major fault.
144. Mention what are the main advantages of statement coverage metric of software
testing?
33
a) It does not require processing source code and can be applied directly to object code
b) Bugs are distributed evenly through code, due to which percentage of executable
statements covered reflects the percentage of faults discovered
a) If characters in new string > characters in previous string. None of the characters should
get truncated
b) If characters in new string< characters in previous string. Junk characters should not be
added
d) String should be replaced only for the first occurrence of the string
146. How will you handle a conflict amogst your team members ?
The code coverage testing tool runs parallel while performing testing on the actual product. The
code coverage tool monitors the executed statements of the source code. When the final testing is
done we get a complete report of the pending statements and also get the coverage percentage.
149. Mention what is the difference between a "defect" and a "failure" in software testing?
In simple terms when a defect reaches the end customer it is called a failure while the defect is
identified internally and resolved then it is referred as defect.
34
150. Explain how to test documents in a project that span across the software development
lifecycle?
The project span across the software development lifecycle in following manner
Central/Project test plan: It is the main test plan that outlines the complete test strategy of
the project. This plan is used till the end of the software development lifecycle
Acceptance test plan: This document begins during the requirement phase and is
completed at final delivery
System test plan: This plan starts during the design plan and proceeds until the end of the
project
Integration and Unit test plan: Both these test plans start during the execution phase and
last until the final delivery
151. Explain which test cases are written first black boxes or white boxes?
Black box test cases are written first as to write black box test cases; it requires project plan and
requirement document all these documents are easily available at the beginning of the project.
While writing white box test cases requires more architectural understanding and is not available
at the start of the project.
152. Explain what is the difference between latent and masked defects?
Latent defect: A latent defect is an existing defect that has not caused a failure because
the sets of conditions were never met
Masked defect: It is an existing defect that has not caused a failure because another
defect has prevented that part of the code from being executed
Bottom up testing is an approach to integration testing, where the lowest level components are
tested first, then used to facilitate the testing of higher level components. The process is repeated
until the component at the top of the hierarchy is tested.
154. Mention what are the different types of test coverage techniques?
Statement Coverage: It verifies that each line of source code has been executed and
tested
Decision Coverage: It ensures that every decision in the source code is executed and
tested
Path Coverage: It ensures that every possible route through a given part of code is
executed and tested
Breadth testing is a test suite that exercises the full functionality of a product but does not test
features in detail
156. Mention what is the difference between Pilot and Beta testing?
The difference between pilot and beta testing is that pilot testing is actually done using the
product by the group of user before the final deployment and in beta testing we do not input real
data, but it is installed at the end customer to validate if the product can be used in production.
Code Walk Through is the informal analysis of the program source code to find defects and
verify coding techniques
158. Mention what are the basic components of defect report format?
Project Name
Module Name
Defect detected on
Defect detected by
Defect ID and Name
Snapshot of the defect
Priority and Severity status
Defect resolved by
Defect resolved on
End-to end testing is done after functional testing. The purpose behind doing end-to-end testing
is that
A test harness is configuring a set of tools and test data to test an application in various
conditions, it involves monitoring the output with expected output for correctness.
161. Explain in a testing project what testing activities would you automate?
Testing Techniques
1. Can you explain boundary value analysis?
In some projects there are scenarios where we need to do boundary value testing. For
instance, let's say for a bank application you can withdraw a maximum of 25000 and a
minimum of 100. So in boundary value testing we only test the exact boundaries rather
than hitting in the middle. That means we only test above the max and below the max.
This covers all scenarios. The following figure shows the boundary value testing for the
bank application which we just described. TC1 and TC2 are sufficient to test all
conditions for the bank. TC3 and TC4 are just duplicate/redundant test cases which really
do not add any value to the testing. So by applying proper boundary value fundamentals
we can avoid duplicate test cases, which do not add value to the testing.
In equivalence partitioning we identify inputs which are treated by the system in the same
way and produce the same results. You can see from the following figure applications
TC1 and TC2 give the same results (i.e., TC3 and TC4 both give the same result,
Result2). In short, we have two redundant test cases. By applying equivalence
partitioning we minimize the redundant test cases.
37
Random testing is sometimes called monkey testing. In Random testing, data is generated
randomly often using a tool. For instance, the following figure shows how randomly-
generated data is sent to the system. This data is generated either using a tool or some
automated mechanism. With this randomly generated input the system is then tested and
results are observed accordingly.
This kind of testing is really of no use and is normally performed by newcomers. Its best
use is to see if the system will hold up under adverse effects.
As the name specifies semi-random testing is nothing but controlling random testing and
removing redundant test cases. So what we do is perform random test cases and
equivalence partitioning to those test cases, which in turn removes redundant test cases,
thus giving us semi-random test cases.
A negative test is when you put in an invalid input and receive errors.
A positive test is when you put in a valid input and expect some action to be completed in
accordance with the specification.
METRICS
1. What is meant by measures and metrics?
Measures are quantitatively unit defined elements, for instance, hours, km, etc. Metrics
are basically comprised of more than one measure. For instance, we can have metrics
such as km/hr, m/s etc.
The number of defects is one of the measures used to measure test effectiveness. One of
the side effects of the number of defects is that all bugs are not equal. So it becomes
40
necessary to weight bugs according to their criticality level. If we are using the number of
defects as the metric measurement the following are the issues:
o The number of bugs that originally existed significantly impacts the number of
bugs discovered, which in turns gives a wrong measure of the software quality.
o All defects are not equal so defects should be numbered with a criticality level to
get the right software quality measure.
3. Can you explain unit and system test DRE?
DRE is also useful to measure the effectiveness of a particular test such as acceptance,
unit, or system testing. The following figure shows defect numbers at various software
cycle levels. The 1 indicates that defects are input at the phase and2indicates that these
many defects were removed from that particular phase. For instance, in the requirement
phase 100 defects were present, but 20 defects are removed from the requirement phase
due to a code review. So if 20 defects are removed then 80 defects get carried to the new
phase (design) and so on.
But the success of DRE depends on several factors. The following are some of them:
Defect age is also called a phase age or phage. One of the most important things to
remember in testing is that the later we find a defect the more it costs to fix it. Defect age
and defect spoilage metrics work with the same fundamental, i.e., how late you found the
defect. So the first thing we need to define is what is the scale of the defect age according
to phases. For instance, the following table defines the scale according to phases. So, for
instance, requirement defects, if found in the design phase, have a scale of 1, and the
same defect, if propagated until the production phase, goes up to a scale of 4.
Once the scale is decided now we can find the defect spoilage. Defect spoilage is defects
from the previous phase multiplied by the scale. For instance, in the following figure we
have found 8 defects in the design phase from which 4 defects are propagated from the
42
requirement phase. So we multiply the 4 defects with the scale defined in the previous
table, so we get the value of 4. In the same fashion we calculate for all the phases. The
following is the spoilage formula.
This is one of the most effective measures. The number of defects found in a production
is recorded. The only issue with this measure is it can have latent and masked defects
which can give us the wrong value regarding software quality.
Defect seeding is a technique that was developed to estimate the number of defects
resident in a piece of software. It's an offline technique and should not be used by
everyone. The process is the following: we inject the application with defects and then
see if the defect is found or not. So, for instance, if we have injected 100 defects we try to
get three values. First how many seeded defects were discovered, how many were not
discovered, and how many new defects (unseeded) are discovered. By using defect
seeding we can predict the number of defects remaining in the system.
43
Test effectiveness is the measure of the bug-finding ability of our tests. In short, it
measures how good the tests were. So effectiveness is the ratio of the measure of bugs
found during testing to the total bugs found. Total bugs are the sum of new defects found
by the user plus the bugs found in the test. The following figure explains the calculations
in a pictorial format.
44
1. Plan: Define the goal and the plan for achieving that goal.
45
2. Do/Execute: Depending on the plan strategy decided during the plan stage we do
execution accordingly in this phase.
3. Check: Check/Test to ensure that we are moving according to plan and are
getting the desired results.
4. Act: During the check cycle, if any issues are there, then we take appropriate
action accordingly and revise our plan again.
So developers and other stakeholders of the project do the "planning and building," while
testers do the check part of the cycle. Therefore, software testing is done in check part of
the PDCA cyle.
2. What is the difference between white box, black box, and gray box testing?
Black box testing is a testing strategy based solely on requirements and specifications.
Black box testing requires no knowledge of internal paths, structures, or implementation
of the software being tested.
White box testing is a testing strategy based on internal paths, code structures, and
implementation of the software being tested. White box testing generally requires
detailed programming skills.
There is one more type of testing called gray box testing. In this we look into the "box"
being tested just long enough to understand how it has been implemented. Then we close
up the box and use our knowledge to choose more effective black box tests.
The above figure shows how both types of testers view an accounting application during
testing. Black box testers view the basic accounting application. While during white box
testing the tester knows the internal structure of the application. In most scenarios white
box testing is done by developers as they know the internals of the application. In black
box testing we check the overall functionality of the application while in white box
46
testing we do code reviews, view the architecture, remove bad code practices, and do
component level testing.
Usability testing is a testing methodology where the end customer is asked to use the
software to see if the product is easy to use, to see the customer's perception and task
time. The best way to finalize the customer point of view for usability is by using
prototype or mock-up software during the initial stages. By giving the customer the
prototype before the development start-up we confirm that we are not missing anything
from the user point of view.
The following are the important steps used to define a testing policy in general. But it can
change according to your organization. Let's discuss in detail the steps of implementing a
testing policy in an organization.
47
o Definition: The first step any organization needs to do is define one unique
definition for testing within the organization so that everyone is of the same
mindset.
o How to achieve: How are we going to achieve our objective? Is there going to be
a testing committee, will there be compulsory test plans which need to be
executed, etc?.
o Evaluate: After testing is implemented in a project how do we evaluate it? Are
we going to derive metrics of defects per phase, per programmer, etc. Finally, it's
important to let everyone know how testing has added value to the project?.
o Standards: Finally, what are the standards we want to achieve by testing? For
instance, we can say that more than 20 defects per KLOC will be considered
below standard and code review should be done for it.
6. On what basis is the acceptance plan prepared?
In any project the acceptance document is normally prepared using the following inputs.
This can vary from company to company and from project to project.
The following diagram shows the most common inputs used to prepare acceptance test
plans.
48
When changes are done in adhoc and in an uncontrolled manner chaotic situations can
arise and more defects injected. So whenever changes are done it should be done in a
controlled fashion and with proper versioning. At any moment of time we should be able
to revert back to the old version. The main intention of configuration management is to
track our changes if we have issues with the current system. Configuration management
is done using baselines.
While doing testing on the actual product, the code coverage testing tool is run
simultaneously. While the testing is going on, the code coverage tool monitors the
executed statements of the source code. When the final testing is completed we get a
complete report of the pending statements and also get the coverage percentage.
In real projects, tailored models are proven to be the best, because they share features
from The Waterfall, Iterative, Evolutionary models, etc., and can fit into real life time
projects. Tailored models are most productive and beneficial for many organizations. If
it's a pure testing project, then the V model is the best.
When a defect reaches the end customer it is called a failure and if the defect is detected
internally and resolved it's called a defect.
11. Should testing be done only after the build and execution phases are complete?
In traditional testing methodology testing is always done after the build and execution
phases.
But that's a wrong way of thinking because the earlier we catch a defect, the more cost
effective it is. For instance, fixing a defect in maintenance is ten times more costly than
fixing it during execution.
In the requirement phase we can verify if the requirements are met according to the
customer needs. During design we can check whether the design document covers all the
requirements. In this stage we can also generate rough functional data. We can also
review the design document from the architecture and the correctness perspectives. In the
build and execution phase we can execute unit test cases and generate structural and
functional data. And finally comes the testing phase done in the traditional way. i.e., run
the system test cases and see if the system works according to the requirements. During
installation we need to see if the system is compatible with the software. Finally, during
the maintenance phase when any fixes are made we can retest the fixes and follow the
regression testing.
50
Therefore, Testing should occur in conjunction with each phase of the software
development.
12. Are there more defects in the design phase or in the coding phase?
The design phase is more error prone than the execution phase. One of the most frequent
defects which occur during design is that the product does not cover the complete
requirements of the customer. Second is wrong or bad architecture and technical
decisions make the next phase, execution, more prone to defects. Because the design
phase drives the execution phase it's the most critical phase to test. The testing of the
design phase can be done by good review. On average, 60% of defects occur during
design and 40% during the execution phase.
When it comes to testing everyone in the world can be involved right from the developer
to the project manager to the customer. But below are different types of team groups
which can be present in a project.
Normally, the impact ratings for defects are classified into three types:
o Minor: Very low impact but does not affect operations on a large scale.
o Major: Affects operations on a very large scale.
o Critical: Brings the system to a halt and stops the show.
15. Does an increase in testing always improve the project?
No an increase in testing does not always mean improvement of the product, company, or
project. In real test scenarios only 20% of test plans are critical from a business angle.
Running those critical test plans will assure that the testing is properly done. The
following graph explains the impact of under testing and over testing. If you under test a
system the number of defects will increase, but if you over test a system your cost of
testing will increase. Even if your defects come down your cost of testing has gone up.
16. What's the relationship between environment reality and test phases?
Environment reality becomes more important as test phases start moving ahead. For
instance, during unit testing you need the environment to be partly real, but at the
acceptance phase you should have a 100% real environment, or we can say it should be
the actual real environment. The following graph shows how with every phase the
environment reality should also increase and finally during acceptance it should be 100%
real.
52
Verification is static type of s/w testing. It means code is not executed. The product is
evaluated by going through the code. Types of verification are:
The following figure shows pictorially how test documents span across the software
development lifecycle. The following discusses the specific testing documents in the
lifecycle:
53
o Central/Project test plan: This is the main test plan which outlines the complete
test strategy of the software project. This document should be prepared before the
start of the project and is used until the end of the software development lifecycle.
o Acceptance test plan: This test plan is normally prepared with the end customer.
This document commences during the requirement phase and is completed at final
delivery.
o System test plan: This test plan starts during the design phase and proceeds until
the end of the project.
o Integration and unit test plan: Both of these test plans start during the execution
phase and continue until the final delivery.
19. Which test cases are written first: white boxes or black boxes?
Normally black box test cases are written first and white box test cases later. In order to
write black box test cases we need the requirement document and, design or project plan.
All these documents are easily available at the initial start of the project. White box test
cases cannot be started in the initial phase of the project because they need more
architecture clarity which is not available at the start of the project. So normally white
box test cases are written after black box test cases are written.
Black box test cases do not require system understanding but white box testing needs
more structural understanding. And structural understanding is clearer i00n the later part
of project, i.e., while executing or designing. For black box testing you need to only
analyze from the functional perspective which is easily available from a simple
requirement document.
54
20. Explain Unit Testing, Integration Tests, System Testing and Acceptance Testing?
Integration Tests - Testing performed on groups of modules to ensure that data and
control are passed properly between modules.
Acceptance testing - Testing to ensure that the system meets the needs of the organization
and the end user or customer (i.e., validates that the right system was built).
The IEEE Std. 829-1998 defines a test log as a chronological record of relevant details
about the execution of test cases. It's a detailed view of activity and events given in
chronological manner.
The following figure shows a test log and is followed by a sample test log.
In most organizations testing only starts after the execution/coding phase of the project.
But if the organization wants to really benefit from testing, then testers should get
involved right from the requirement phase.
If the tester gets involved right from the requirement phase then requirement traceability
is one of the important reports that can detail what kind of test coverage the test cases
have.
Entry and exit criteria are a must for the success of any project. If you do not know where
to start and where to finish then your goals are not clear. By defining exit and entry
criteria you define your boundaries.
For instance, you can define entry criteria that the customer should provide the
requirement document or acceptance plan. If this entry criteria is not met then you will
not start the project. On the other end, you can also define exit criteria for your project.
For instance, one of the common exit criteria in projects is that the customer has
successfully executed the acceptance test plan.
A latent defect is an existing defect that has not yet caused a failure because the sets of
conditions were never met.
A masked defect is an existing defect that hasn't yet caused a failure just because another
defect has prevented that part of the code from being executed.
It includes tracing the accuracy of the devices used in the production, development and
testing. Devices used must be maintained and calibrated to ensure that it is working in
good order.
56
Alpha and beta testing has different meanings to different people. Alpha testing is the
acceptance testing done at the development site. Some organizations have a different
visualization of alpha testing. They consider alpha testing as testing which is conducted
on early, unstable versions of software. On the contrary beta testing is acceptance testing
conducted at the customer end.
In short, the difference between beta testing and alpha testing is the location where the
tests are done.
A risk is a condition that can result in a loss. Risk can only be controlled in different
scenarios but not eliminated completely. A defect normally converts to a risk.
29. What is coverage and what are the different types of coverage techniques?
Coverage is a measurement used in software testing to describe the degree to which the
source code is tested. There are three basic types of coverage techniques as shown in the
following figure:
57
o Statement coverage: This coverage ensures that each line of source code has
been executed and tested.
o Decision coverage: This coverage ensures that every decision (true/false) in the
source code has been executed and tested.
o Path coverage: In this coverage we ensure that every possible route through a
given part of code is executed and tested.
30. A defect which could have been removed during the initial stage is removed in a later
stage. How does this affect cost?
If a defect is known at the initial stage then it should be removed during that stage/phase
itself rather than at some later stage. It's a recorded fact that if a defect is delayed for later
phases it proves more costly. The following figure shows how a defect is costly as the
phases move forward. A defect if identified and removed during the requirement and
design phase is the most cost effective, while a defect removed during maintenance is 20
times costlier than during the requirement and design phases.
For instance, if a defect is identified during requirement and design we only need to
58
change the documentation, but if identified during the maintenance phase we not only
need to fix the defect, but also change our test plans, do regression testing, and change all
documentation. This is why a defect should be identified/removed in earlier phases and
the testing department should be involved right from the requirement phase and not after
the execution phase.
31. What kind of input do we need from the end user to begin proper testing?
The product has to be used by the user. He is the most important person as he has more
interest than anyone else in the project.
o The first thing we need is the acceptance test plan from the end user. The
acceptance test defines the entire test which the product has to pass so that it can
go into production.
o We also need the requirement document from the customer. In normal scenarios
the customer never writes a formal document until he is really sure of his
requirements. But at some point the customer should sign saying yes this is what
he wants.
o The customer should also define the risky sections of the project. For instance, in
a normal accounting project if a voucher entry screen does not work that will stop
the accounting functionality completely. But if reports are not derived the
accounting department can use it for some time. The customer is the right person
to say which section will affect him the most. With this feedback the testers can
prepare a proper test plan for those areas and test it thoroughly.
o The customer should also provide proper data for testing. Feeding proper data
during testing is very important. In many scenarios testers key in wrong data and
expect results which are of no interest to the customer.
32. Can you explain the workbench concept?
59
o Input: Every task needs some defined input and entrance criteria. So for every
workbench we need defined inputs. Input forms the first steps of the workbench.
o Execute: This is the main task of the workbench which will transform the input
into the expected output.
o Check: Check steps assure that the output after execution meets the desired
result.
o Production output: If the check is right the production output forms the exit
criteria of the workbench.
o Rework: During the check step if the output is not as desired then we need to
again start from the execute step.
60
Defect cascading is a defect which is caused by another defect. One defect triggers the
other defect. For instance, in the accounting application shown here there is a defect
which leads to negative taxation. So the negative taxation defect affects the ledger which
in turn affects four other modules.
61
When we install the application at the end client it is very possible that on the same PC
other applications also exist. It is also very possible that those applications share common
DLLs, resources etc., with your application. There is a huge chance in such situations that
your changes can affect the cohabiting software. So the best practice is after you install
your application or after any changes, tell other application owners to run a test cycle on
their application.
The difference between pilot and beta testing is that pilot testing is nothing but actually
using the product (limited to some users) and in beta testing we do not input real data, but
it's installed at the end customer to validate if the product can be used in production.
62
36. What are the different strategies for rollout to end users?
37. What's the difference between System testing and Acceptance testing?
Acceptance testing checks the system against the "Requirements." It is similar to System
testing in that the whole system is checked but the important difference is the change in
focus:
System testing checks that the system that was specified has been delivered. Acceptance
testing checks that the system will deliver what was requested. The customer should
always do Acceptance testing and not the developer.
The customer knows what is required from the system to achieve value in the business
and is the only person qualified to make that judgement. This testing is more about
ensuring that the software is delivered as defined by the customer. It's like getting a green
light from the customer that the software meets expectations and is ready to be used.
Regression testing is used for regression defects. Regression defects are defects occur
when the functionality which was once working normally has stopped working. This is
probably because of changes made in the program or the environment. To uncover such
kind of defect regression testing is conducted.
The following figure shows the difference between regression and confirmation testing.
or division.
CMMI was formed by using multiple previous CMM processes.
Integrated Product and Process Development (IPPD): Integrated Product and Process
Development (IPPD) is a systematic approach that achieves a timely collaboration of
relevant stakeholders throughout the life of the product to better satisfy customer needs,
expectations, and requirements. This section mostly concentrates on the integration part
of the project for different processes. For instance, it's possible that your project is using
services of some other third party component. In such situations the integration is a big
task itself, and if approached in a systematic manner, can be handled with ease.
Software acquisition: Many times an organization has to acquire products from other
organizations. Acquisition is itself a big step for any organization and if not handled in a
proper manner means a disaster is sure to happen.
Both of these concepts are important while implementing a process in any organization.
Any new process implemented has to go through these two phases.
65
There are five maturity levels in a staged representation as shown in the following figure.
Maturity Level 3 (Defined): To reach this level the organization should have already
achieved level 2. In the previous level the good practices and process were only done at
the project level. But in this level all these good practices and processes are brought to
the organization level. There are set and standard practices defined at the organization
level which every project should follow. Maturity Level 3 moves ahead with defining a
strong, meaningful, organizational approach to developing products. An important
distinction between Maturity Levels 2 and 3 is that at Level 3, processes are described in
more detail and more rigorously than at Level 2 and are at an organization level.
the picture. Organization controls the project by statistical and other quantitative
techniques. Product quality, process performance, and service quality are understood in
statistical terms and are managed throughout the life of the processes. Maturity Level 4
concentrates on using metrics to make decisions and to truly measure whether progress is
happening and the product is becoming better. The main difference between Levels 3 and
4 are that at Level 3, processes are qualitatively predictable. At Level 4, processes are
quantitatively predictable. Level 4 addresses causes of process variation and takes
corrective action.
Maturity Level 5 (Optimized): The organization has achieved goals of maturity levels
2, 3, and 4. In this level, processes are continually improved based on an understanding
of common causes of variation within the processes. This is like the final level; everyone
on the team is a productive member, defects are minimized, and products are delivered on
time and within the budget boundary.
The following figure shows, in detail, all the maturity levels in a pictorial fashion.
There are two models in CMMI. The first is "staged" in which the maturity level
organizes the process areas.
67
The second is "continuous" in which the capability level organizes the process area.
SCAMPI stands for Standard CMMI Appraisal Method for Process Improvement.
SCAMPI is an assessment process used to get CMMI certified for an organization.
There are three classes of CMMI appraisal methods: Class A, Class B, and Class C. Class
A is the most aggressive, while Class B is less aggressive, and Class C is the least
aggressive.
Class A: This is the only method that can provide a rating and get you a CMMI
certificate. It requires all three sources of data instruments, interviews, and documents.
Class B: This class requires only two sources of data (interviews and either documents or
instruments). But please note you do not get rated with Class B appraisals. Class B is just
a warm-up to see if an organization is ready for Class A. With less verification the
appraisal takes less time. In this class data sufficiency and draft presentations are
optional.
Class C: This class requires only one source of data (interviews, instruments, or
documents). Team consensus, validation, observation, data sufficiency, and draft
presentation are optional.
Normally, organizations use a mix of the classes to achieve process improvement. The
following are some of the strategies which an organization uses:
First Strategy: Use Class B to initiate a process improvement plan, after that apply Class
C to check readiness for Class B or Class A. The following diagram shows this strategy.
Third Strategy: Class A is used to initiate an organization level process. The process
improvement plan is based on an identified weakness. Class B appraisal should be
69
performed after six months to see the readiness for the second Class A appraisal rating.
The following diagram shows this strategy.
7. What different sources are needed to verify authenticity for CMMI implementation?
There are three different sources from which an appraiser can verify that an organization
followed the process or not.
The following figure is the pictorial view of the sources used to verify how compliant the
organization is with CMMI.
So when your organization should only concentrate on specific process areas you will
likely go for the continuous model. But if you want your organization to have a specific
plan and to achieve not only the specific process but also any interlinked process within
that process area you should go for the continuous model.
The continuous model is the same as the staged model only that the arrangement is a bit
different. The continuous representation/model concentrates on the action or task to be
completed within a process area. It focuses on maturing the organizations ability to
perform, control, and improve the performance in that specific performance area.
Capability Level 0 Incomplete: This level means that any generic or specific practice of
capability level 1 is not performed.
all capability level 1 specific and generic practices for that process area. In this level
performance may not be stable and probably does not meet objectives such as quality,
cost, and schedule, but still the task can be done.
Capability Level 3: Defined: The defined process is a managed process that is tailored
from an organization standard. Tailoring is done by justification and documentation
guidelines. For instance your organization may have a standard that we should get an
invoice from every supplier. But if the supplier is not able to supply the invoice then he
should sign an agreement in place of the invoice. So here the invoice standard is not
followed but the deviation is under control.
Automation testing
1. Does automation replace manual testing?
Automation is the integration of testing tools into the test environment in such a manner
that the test execution, logging, and comparison of results are done with little human
intervention. A testing tool is a software application which helps automate the testing
process. But the testing tool is not the complete answer for automation. One of the huge
mistakes done in testing automation is automating the wrong things during development.
Many testers learn the hard way that everything cannot be automated. The best
components to automate are repetitive tasks. So some companies first start with manual
testing and then see which tests are the most repetitive ones and only those are then
automated.
All repetitive tasks which are frequently used should be automated. For instance,
regression tests are prime candidates for automation because they're typically executed
many times. Smoke, load, and performance tests are other examples of repetitive tasks
that are suitable for automation. White box testing can also be automated using various
unit testing tools. Code coverage can also be a good candidate for automation.
Websites have software called a web server installed on the server. The user sends a
request to the web server and receives a response. So, for instance, when you type
[Link] the web server senses it and sends you the home page as a response.
This happens each time you click on a link, do a submit, etc. So if we want to do load
testing you need to just multiply these requests and responses "N" times. This is what an
automation tool does. It first captures the request and response and then just multiplies it
by "N" times and sends it to the web server, which results in load simulation.
73
So once the tool captures the request and response, we just need to multiply the request
and response with the virtual user. Virtual users are logical users which actually simulate
the actual physical user by sending in the same request and response. If you want to do
load testing with 10,000 users on an application it's practically impossible. But by using
the load testing tool you only need to create 1000 virtual users.
Normally an application has to be tested with multiple sets of data. For instance, a simple
login screen, depending on the user type, will give different rights. For example, if the
user is an admin he will have full rights, while a user will have limited rights and support
if he only has read-only support rights. In this scenario the testing steps are the same but
with different user ids and passwords. In data-driven testing, inputs to the system are read
from data files such as Excel, CSV (comma separated values), ODBC, etc. So the values
are read from these sources and then test steps are executed by automated testing.
74
V&V
What is Verification?
Definition : The process of evaluating software to determine whether the products of a given
development phase satisfy the conditions imposed at the start of that phase.
Verification is a static practice of verifying documents, design, code and program. It includes all
the activities associated with producing high quality software: inspection, design analysis and
specification analysis. It is a relatively objective process.
Verification will help to determine whether the software is of high quality, but it will not ensure
that the system is useful. Verification is concerned with whether the system is well-engineered
and error-free.
Walkthrough
Inspection
Review
What is Validation?
Definition: The process of evaluating software during or at the end of the development process
to determine whether it satisfies specified requirements.
75
Validation is the process of evaluating the final product to check whether the software meets the
customer expectations and requirements. It is a dynamic mechanism of validating and testing the
actual product.
Testing
End Users
The distinction between the two terms is largely to do with the role of specifications.
Validation
is the process of checking whether the specification captures the customer’s needs. “Did I build
what I said I would?”
Verification is the process of checking that the software meets the specification. “Did I build
what I need?”
Verification Validation
2. It does not involve executing the code. 2. It always involves executing the code.
5. Verification is to check whether the software 5. Validation is to check whether software meets
conforms to specifications. the customer expectations and requirements.
6. It can catch errors that validation cannot catch. 6. It can catch errors that verification cannot catch.
It is low level exercise. It is High Level Exercise.
3- Retesting is only done for failed Test cases while Regression is done for passed test cases.
4- We should always keep this in mind, Re-testing has higher priority than the regression
testing.
Functional testing is done to find certain issues (Bugs) that developer normally misses during
writing code and some times they miss certain scenarios. So we can say that functional testing is
needed for
– Most of the time initialization errors are found during functional testing.
STLC ?
very generic idea about this STLC
1) Risk Analysis: Risk Analysis is really a very crucial and much-needed step that really deal
with the probability of undesirable events that leads to a loss to organization i.e is either
financial or client loss. In this phase we identify all the major and potential risk in all SDLC
process and document all the risk with the reason and all the prospective measure to reduce
harm.
2) Planning Process: We can say that actual testing life cycle starts from this phase and . this
phase involves documentation of test specification, creating test plan, estimating resources
needed, setting testing framework, ,setting milestones for the testing, and dealing with all
testing management along with the per-requisite things for Testing of product.
3) Test Design: preparation of test environment and designing of test cases comes in this phase
4) Performing Tests or executing Test: Executing test cases on the basis of milestone set in
Test Plan comes in this phase and this is part that should really be known as TESTING
5) Defect Tracking : During execution of test cases we uncover many defect that is really know
as BUGs in the diary of tester should be tracked so that developer can get the information all
about the severity and location of defect in product.
78
6) Test Reporting and Quantitative measurement: In this phase we gather all the execution
result and makes test report while in Quantitative measurement we measure the quality of
product and for this purpose tester use a very mathematical algorithm that is known as Software
quality metric
After a defect has been found out, it goes with various stages during its lifetime which is
commonly known as Defect Life Cycle .It starts when defect is found and ends when a defect is
closed, after ensuring it’s not reproduced again.
Here in this picture we can easily understand the end to end workflow of the defect stages:-
Now, Lets walk through the different stages of the defect life cycle one by one:-
1. New :- When a defect has been found out and tester has logged the defect in the defect
management tool for the first time, then the state of the defect would be “New”.It is set by
testing team.
2. Open :- When a new logged defect has been reviewed by QA lead and if the defect is valid, the
state of the bug would be “Open” and it is ready to be assigned to development team and if the
bug is invalid QA lead would mark it as “Closed”.
79
3. Assigned:- When QA lead assigns the defect to the corresponding developer, the state of the
defect would be marked as “Assigned”. Developer should start analyzing and fixing the bug at
this state.
4. Rejected / Invalid :– When the developer feels that the bug is not genuine/valid, he rejects the
bug. Then the state of the bug is marked as “rejected”.Also, in some defect management
tools ,it is stated as “Not a Bug”.
5. Could not reproduce:- When developer is not able to reproduce the bug by the steps mentioned
in Steps to Reproduce by QA then developer can mark the bug as ‘CNR’ (Could Not
Reproduced”). In this stage QA should provide detailed reproducing steps to developer.
6. Need More information:- If developer is not clear about the steps to reproduce provided by QA
to reproduce the bug, then he/she can mark it as “Need more information’. In this case QA
needs to add detailed reproducing steps.
7. Ready to test / Fixed:- When developer makes the necessary code changes , the defect has
marked as “Fixed”. The developer now passes the defect to the testing team to verify so he
changes the state as “Ready to Test”.
8. Verified:- When tester retest the bug and found it fixed/non-reproducible, he/she marks it as
“Verified”.
9. Reopened:- If the tester while verifying the defect found that, the defect is still reproducible or
partially fixed then the defect would be marked as “Reopened”.Now the developer has to look
again into this defect.
10. Duplicates:- If the defect logged is repeated twice or the two defects reported has alike results
and steps to reproduce, then one defect status is changed to “DUPLICATE” and it should be
linked to the another similar defect.
11. Deferred:- If there are some issues or hurdles in the current sprint, then the defect would be
taken in upcoming releases instead of the current release then it is marked as “DEFERRED”.
12. Closed:- If the defect has no issues further and it is properly verified, then the tester or test lead
would mark the defect as “Closed”.
We must make sure that the entire team understands what each defect status exactly means.
Also,the defect life cycle should be properly documented.
We must ensure that each individual in the team clearly understands his/her responsibility in
regarding of each defect.
We must ensure that enough detail should be entered in each status change.
Priority: Priority is related to business and revenue so here i will say ” Priority of a bug is
defined by its impact on business. If any thing is related to business then priority of a bug
80
should be defined by Manager and Some higher entity in business( It includes Manager,
Architect, team lead).
Type of Severity
1- Blocker: If application is not being started on clicking on its icon, screen of application is
freezing and crashes are coming or UI rendering of application or some data corruption.
2- Critical: When main functionality is not working or there is some logical error in calculation
andr tester is getting wrong result on every input in application
3- Major : If performance of main functionality is not good and secondary functionality is not
working and giving wrong result
5- Minor: When minor functionality is being impacted due to some intermittent errors and some
spelling mistakes
Types of Priority
Immediate(P1): Must be fixed on immeditate effect. All critical and major severity based bug
normally fall in this catagory
High: Highly desirable and schedules, Bug with major and normal severity fall in this category
Medium: This is desirable to be fixed but not schedule or we can say if time permits then bug
will be fixed .Few normal severity bugs fall in this category
Low: Not likely to be fixed and bug with minor severity fall in this category
1- High Priority and High Severity: Suppose someday, not a single person able to login in to
his/her g gmail account then this gonna jolt the business of google and it also seems a big jolt to
its mailing application. So this will be of high priority and high severity
2- High Priority and low severity : Suppose one day we all people wake up in the morning and
just open our laptop and entered url [Link] and as soon home page of google opens
and spelling of colored google looks like FFFFOOOGHEL. Then this will be enough for a
person pron to google search to throw him in sock. This will give big blow to google search, but
search is still working so this bug will be of high priority and low severity
81
3- Low priority and high severity : Suppose any calculator start giving wrong calculation when
calculation takes input more than 18 digit. Since common use don’t go to this extent so this can
be fixed in next release but this is calculation mistake so it should be taken on high priority
4- Low priority and Low severity: Suppose there is spelling mistake in Advertisiing Programs
since user normally don’t see such spelling mistakes so its low priority and low severity bug
AGILE
What is Agile Testing?
A software testing practice that follows the principles of agile software development is called
Agile Testing. Agile is an iterative development methodology, where requirements evolve
through collaboration between the customer and self-organizing teams and agile aligns
development with customer needs.
Testing is NOT a Phase: Agile team tests continuously and continuous testing is the
only way to ensure continuous progress.
Testing Moves the project Forward: When following conventional methods, testing is
considered as quality gate but agile testing provide feedback on an ongoing basis and the
product meets the business demands.
Everyone Tests: In conventional SDLC, only test team tests while in agile including
developers and BA's test the application.
Shortening Feedback Response Time: In conventional SDLC, only during the
acceptance testing, the Business team will get to know the product development, while in
agile for each and every iteration, they are involved and continuous feedback shortens the
feedback response time and cost involved in fixing is also less.
Clean Code: Raised defects are fixed within the same iteration and thereby keeping the
code clean.
Reduce Test Documentation: Instead of very lengthy documentation, agile testers use
reusable checklist, focus on the essence of the test rather than the incidental details.
Test Driven: In conventional methods, testing is performed after implementation while
in agile testing, testing is done while implementation.
82
Agile and Waterfall model are two different methods for software development process. Though
they are different in their approach, both methods are useful at times, depending on the
requirement and the type of the project.
The agile process is broken into individual The design process is not broken into
models that designers work on an individual models
Every iteration has its own testing phase. It Only after the development phase, the
allows implementing regression testing every testing phase is executed because
time new functions or logic are released. separate parts are not fully functional.
At the end of every sprint, user acceptance is User acceptance is performed at the
performed end of the project.
There are various methods present in agile testing, and those are listed below:
Scrum
Scrum Master
o Master is responsible for setting up the team, sprint meeting and removes obstacles to
progress
Product owner
o The Product Owner creates product backlog, prioritizes the backlog and is responsible
for the delivery of the functionality at each iteration
Scrum Team
o Team manages its own work and organizes the work to complete the sprint or cycle
Product Backlog
This is a repository where requirements are tracked with details on the no of requirements to be
completed for each release. It should be maintained and prioritized by Product Owner, and it
should be distributed to the scrum team. Team can also request for a new requirement addition or
modification or deletion
Extreme Programming technique is very helpful when there is constantly changing demands or
requirements from the customers or when they are not sure about the functionality of the system.
It advocates frequent "releases" of the product in short development cycles, which inherently
improves the productivity of the system and also introduces a checkpoint where any customer
requirements can be easily implemented. The XP develops software keeping customer in the
target.
Business requirements are gathered in terms of stories. All those stories are stored in a place
called the parking lot.
Ans. Agile Testing is a practice that a QA follows in a dynamic environment where testing
requirements keep changing according to the customer needs. It is done parallel to the
development activity where testing team receives frequent small codes from the development
team for testing.
Ans. Burn-up and burn-down charts are used to keep track the progress of the project.
Burn-up charts represent how much work has been completed in any project whereas Burn-down
chart represents the remaining work in a project.
Ans. There are mainly three roles that a Scrum team have:
1. Project Owner – who has the responsibility of managing product backlog. Works with end users
and customers and provide proper requirement to the team to build the proper product.
2. Scrum Master – who works with scrum team to make sure each sprint gets complete on time.
Scrum master ensure proper work flow to the team.
3. Scrum Team – Each member in the team should be self-organized, dedicated and responsible for
high quality of the work.
Ans. Product backlog is maintained by the project owner which contains every feature and
requirement of the product.
Sprint backlog can be treated as subset of product backlog which contains features and
requirements related to that particular sprint only.
Ans. Velocity is a metric that is calculated by addition of all efforts estimates associated with
user stories completed in a iteration. It predicts how much work Agile can complete in a sprint
and how much time will require to complete a project.
Q#6. Explain the difference between traditional Waterfall model and Agile testing?
Ans. Agile testing is done parallel to the development activity whereas in traditional waterfall
model testing is done at the end of the development.
As done in parallel, agile testing is done on small features whereas in waterfall model testing is
done on whole application.
Ans. Pair programming is a technique in which two programmer works as team in which one
programmer writes code and other one reviews that code. They both can switch their roles.
Benefits:
88
1. Improved code quality: As second partner reviews the code simultaneously, it reduces the
chances of mistake.
2. Knowledge transfer is easy: One experience partner can teach other partner about the
techniques and codes.
Ans. Modification of the code without changing its functionality to improve the performance is
called re-factoring.
Ans. Iterative Development: Software is developed and delivered to customer and based on the
feedback again developed in cycles or release and sprints. Say in Release 1 software is developed
in 5 sprints and delivered to customer. Now customer wants some changes, then development
team plan for 2nd release which can be completed in some sprints and so on.
Ans. This question is to test the analytical capability of the candidate. Answer can be-
Work with PO to understand the exact requirement to update test cases. Also understand the risk
in changing the requirement. Apart from this one should be able to write generic test plan and
test cases. Don’t go for the automation until requirements are finalized.
Ans. A small code which mimics a specific component in the system and can replace it. Its
output is same as the component it replaces.
Ans.
Ans. User Stories:User Stories defines the actual business requirement. Generally created by
Business owner.
Ans. Task board is dash board which shows progress of the project. It contains:
Ans. It is Test-first development technique in which we add a test first before we write a
complete production code. Next we run the test and based on the result refactor the code to fulfill
the test requirement.
Ans. QA can provide a value addition by thinking differently about the various scenarios to test a
story. They can provide quick feedback to the developers whether new functionality is working
fine or not.
Ans. It is a software development model which is combination of scrum and kanban. Scrumban
is considered for maintenance projects in which there are frequent changes or unexpected user
stories. It can reduce the minimum completion time for user stories.
Ans. Application Binary Interface or ABI defines an interface for complied application programs
or we can say it describes the low level interface between an application and the operating
system.
Ans. It can be defined as pre step to the first sprint. Activities like setting development
environment, preparing backlog etc needs to be done before starting of the first sprint and can be
treated as Sprint zero.
Ans. There may be some technical issues or design problem in the project which needs to be
resolved first. To provide the solution of these problem “Spikes” are created. Spikes are of two
types- Functional and Technical.
1. Re-factoring
2. Small feedback cycles
3. Dynamic code analysis
4. Iteration
Ans. It can be defined as spike with the current architecture or the current set of best practices.
The purpose of a tracer bullet is to examine how an end-to-end process will work and examine
feasibility.
Ans. If capacity is measured as a percentage of a 40 hours weeks then completed story points
* team capacity
If capacity is measured in man hours then Completed story points / team capacity
Q. What is Agile Testing and how is it different to traditional waterfall or the V model?
Agile Testing is testing practice that follows the principles of agile software development. Agile
testing involves all members of an agile team with special skills and expertise to ensure business
value is delivered at frequent intervals.
The big difference is that in Agile environment, testing is not a phase, it is an activity parallel to
development.
In agile environment, small features of software are delivered frequently, so testing activity
should be parallel to development activity. Testing time is short as we are only testing small
features.
In the waterfall model, there is a testing phase at the end of the development so, testing is a big
effort done after the whole application is developed. Testing time is long as we have to test the
whole application.
This question can be asked if you are interviewed for an agile QA position where requirements
are likely to change frequently during development. Although a complete change in requirement
is possible, most of the time, it is the technical details that are subject to change. e.g. the intent of
the requirement or behaviour of the feature is the same but implementation details can change
Write generic test plans and test cases which focus on the intent of the requirement rather
than its exact details
Work very closely with the product owners or business analysts to understand the scope
of change so testing can be updated
Make sure the team understands the risks involved in changing requirements especially
towards the end of sprint
If you’re going to automate this feature, it is best to wait until the feature is stable and
requirements are finalized
Negotiate to see if the changes can be kept to a minimum and/or implement the changes
in next sprint
When attending an Agile Testing Interview, questions can be asked to find out what you really
understand from an Agile Tester or Agile QA role and how you will fit with the rest of the team.
92
Good communicator – In agile teams, there is increased level of communication with the
Devs, QAs and BAs
Priorities change frequently in agile projects, so the Agile QA should be able to prioritize
the tasks accordingly
Ideally Agile Testers should be multi-skilled and technical or at least understand the
technical terminology so that they don’t feel alienated from the rest of the team when
developers talk in technical terms
Participate in daily sprint planning, stand-ups, retrospectives. Note the word Participate,
meaning to actually talk and take part in discussions rather than just attending the
meetings
Q: What are the two key factors when working as a QA in an Agile team?
A: QA can add a lot of value to an agile team because of the different mindset. Testers can and
should think about the different possible scenarios to test a story. However the most important
asset that they can bring is:
To prevent defect. QA should advocate best practices along the way to prevent defects
from entering the system in the first place.
To provide fast feedback. It is important for developers to know if the new functionality
works as expected and if regression tests pass, and they need that feedback quite quickly.
QA should provide the results of the tests to developers as soon as possible.
Product Owner: Manages the product backlog. PO is the voice of the business and
create new features to be developed for the application.
Scrum Master: Responsible for managing the sprint, remove any impediments and
keeps track of the progress of the project.
Scrum Team itself: Composed of developers, designers and QA. This forms the team
which is responsible for delivering high quality software.
93
SDLC Phases Explained What are the SDLC Phases? Software Development Life Cycle, or
SDLC is a process used to develop software. There are different stages or phases within the
Software Development Life Cycle and in each phase, different activities take… Read More »
February 6, 2010 by
Iterative / Incremental life cycle models, as the name suggests, focus on developing software in
increments or chunks. Popular iterative models include the Agile methodologies such as Scrum,
XP, etc. A common thread amongst the iterative models is that integrated… Read More »
Iterative Model
November 8, 2008 by
An iterative life cycle model does not attempt to start with a full specification of requirements.
Instead, development begins by specifying and implementing just part of the software, which can
then be reviewed in order to
Incremental Model
November 8, 2008 by
The incremental build model is a method of software development where the model is designed,
implemented and tested incrementally (a little more is added each time) until the product is
finished. It involves both development
November 8, 2008 by
RAD is, in essence, the “try before you buy” approach to software development. The theory is
that end users can produce better feedback when examining a live system, as opposed to working
strictly with documentation
Spiral Model
November 8, 2008 by
94
The spiral model starts with an initial pass through a standard waterfall lifecycle, using a subset
of the total requirements to develop a robust prototype. After an evaluation period, the cycle is
initiated again, adding
Prototyping
November 8, 2008 by
The software development team, to clarify requirements and/or design elements, may generate
mockups and prototypes of screens, reports, and processes. Although some of the prototypes may
appear to be very substantial, they’re generally similar to
V Model
November 8, 2008 by
The V Model is an enhanced version of the classic waterfall model whereby each level of the
development life cycle is verified before moving on to the next level. With this model, testing
explicitly starts at
Endurance testing ?
Endurance Testing also known as Soak Testing is performed to determine if the application
under test can sustain the continuous loads.
Endurance testing, non-functional testing involves examining the system if it can withstand a
huge load for a longer period of time and thereby measuring the system's reaction parameters.
95
Serious memory leaks that would eventually result in application or Operating System
crash
Failure to close connections between the layers of the system could stall some or all
modules of the system.
Failure to close database connections under some conditions might result in complete
system crash.
Gradual degradation of response time of the system as the application becomes less
efficient as a result of prolonged test.
Entry criterion is used to determine when a given test activity should start. It also includes the
beginning of a level of testing, when test design or when test execution is ready to start.
Exit criterion is used to determine whether a given test activity has been completed or NOT. Exit
criteria can be defined for all of the test activities right from planning, specification and
execution.
Exit criterion should be part of test plan and decided in the planning stage.
During testing phase where there is severe time pressure, Exploratory testing technique is
adopted that combines the experience of testers along with a structured approach to testing.
Exploratory testing often performed as a black box testing technique, the tester learns things that
together with experience and creativity generate new good tests to run.
Benefits:
Drawbacks:
Failover testing is a testing technique that validates a system's ability to be able to allocate extra
resource and to move operations to back-up systems during the server failure due to one or the
other reasons. This determines if a system is capable of handling extra resource such as
additional CPU or servers during critical failures or at the point the system reaches a
performance threshold.
Example:
Failover testing is very much critical for the following types of applications:
Banking Application
Financial Application
Telecom Application
Trading Platforms
97
Factors to be Considered:
Functional Testing is a testing technique that is used to test the features/functionality of the
system or Software, should cover all the scenarios including failure paths and boundary cases.
Unit Testing
Integration Testing
Smoke Testing
User Acceptance Testing
Localization Testing
Interface Testing
Usability Testing
System Testing
Regression Testing
Globalization Testing
98
DOMAIN
Product information management (PIM) means managing the information required to market
and sell products through distribution channels. A central set of product data can be used to feed
information to media such as web sites, print catalogs, ERP systems, and electronic data feeds to
trading partners.
PIM systems generally need to support multiple geographic locations, multi-lingual data, and
maintenance and modification of product information within a centralized catalog. Information kept by
a business can be scattered throughout departments and held by employees or systems, instead of
being available centrally; data may be saved in various formats, or only be available in hard copy form.
Information may be needed for detailed product descriptions with prices, or calculating freight costs.
PIM represents a solution for centralized, media-independent data maintenance, as well as efficient
data collection, management, refinement and output.
Content management (CM) is a set of processes and technologies that supports the collection,
managing, and publishing of information in any form or medium. When stored and accessed via
computers, this information may be more specifically referred to as digital content, or simply as content.
Digital content may take the form of text (such as electronic documents), multimedia files (such as audio
or video files), or any other file type that follows a content lifecycle requiring management. The process
is complex enough to manage that several large and small commercial software vendors such as
Interwoven and Microsoft offer content management software to control and automate significant
aspects of the content lifecycle.
Selenium
Selenium Interview Questions
A: Selenium is a browser based functional test automation tool. It is basically a library which
you can use in your program to test a web application. It is important to note that selenium is
mainly used for browser automation. It is NOT used for unit testing or API testing.
Selenium Webdriver has many language bindings, which means you can write your tests in your
favorite programming language and using the respective selenium bindings.
Q#2: Another interesting selenium interview question is how many languages does
selenium WebDriver support?
Q#3: In Selenium WebDriver, how do you select an item from a drop-down menu?
A: We can select an item from the drop-down menu by Value, by Index or by Visible Text.
Example:
<select id="cars">
<option value="vo">Volvo</ o
<option value="sa">Saab</ o
<option value="me">Mercede
1 <select id="cars">
2 <option value="vo">Volvo</option>
3 <option value="sa">Saab</option>
4 <option value="me">Mercedes</option>
5 <option value="au">Audi</option>
6 </select>
5 //select by value
8 //select by index
10
Because navigating to a URL is very common, then [Link]() is a convenient way. However it
does the same function as the [Link]().to(“url”)
[Link]().back()
[Link]().forward()
[Link]().refresh()
Q#5: What is the difference between implicit wait and explicit wait in selenium webdriver?
This question is asked in almost all selenium interview questions because many web applications
use AJAX.
A: Selenium Webdriver introduces the concept of waits for AJAX based applications. There are
two waiting methods, implicit wait and explicit wait
Implicit wait:
When an implicit wait is implemented in tests, if WebDriver cannot find an element in the
Document Object Model (DOM), it will wait for a defined amount of time for the element to
appear in the DOM. In other terms, an implicit wait polls the DOM for a certain amount of time
when trying to find an element or elements if they are not immediately available.
Implicit waits can slow down your tests, because once set, the implicit wait is set for the life of
the WebDriver object’s instance. This means that when an application responds normally, it will
still wait for each element to appear in the DOM which increases the overall execution time.
Another downside is if for example you set the waiting limit to be 5 seconds and the elements
appears in the DOM in 6 seconds, your tests will fail because you told it to wait a maximum of 5
seconds.
[Link]().timeouts().implicitlyWait(10, [Link]);
Explicit wait:
101
Explicit waits are better than implicit wait. Unlike an implicit wait, you can write custom code or
conditions for wait before proceeding further in the code.
An explicit wait can be used where synchronization is needed, for example, the page is loaded
but we are still waiting for a call to complete and an element to appear.
[Link]([Link]
3 [Link]([Link]("selenium"));
To summarize:
Implicit wait time is applied to all elements in your script and Explicit wait time is applied only
for a particular specified element.
This is a common selenium interview question because in many cases you want to click on an
item from a list. So it is important to know how to count the elements and select the correct one
from the list.
A: We first need to locate the node element where the items are listed. For example, in the html
code below:
<ul id="movies">
<li>movie title 1</ li>
<li>movie title 2</ li>
.
1 <ul id="movies">
4 .
5 .
6 .
8 </ul>
List<WebElement>movies =driv
Then we can use the .size() to get the number of <li> elements
[Link]([Link]("id_of_c
1 [Link]([Link]("id_of_checkbox")).isSelected();
4 [Link](start,end).perform();
A: We can use isDisplayed() method. The return type of the method is boolean. So if it return
true then element is visible otherwise it is not.
[Link]([Link](“id_of_e
1 [Link]([Link](“id_of_element”)).isDisplayed();
A: We can Use isEnabled() method. The return type of the method is boolean. So if it return true
then button is enabled else not enabled.
[Link]([Link](“id_of_e
1 [Link]([Link](“id_of_element”)).isEnabled();
Now that you have gone through these selenium interview questions, it is time to take a short
selenium webdriver quiz.
Automation testing or Test Automation is a process of automating the manual process to test the
application/system under test. Automation testing involves use to a separate testing tool which
lets you create test scripts which can be executed repeatedly and doesn’t require any manual
intervention.
104
Selenium
Selenium is one of the most popular automated testing suites. Selenium is designed in a way to
support and encourage automation testing of functional aspects of web-based applications and a
wide range of browsers and platforms. Due to its existence in the open source community, it has
become one of the most accepted tools amongst the testing professionals.
Selenium is not just a single tool or a utility, rather a package of several testing tools and for the
same reason, it is referred to as a Suite. Each of these tools is designed to cater different testing
and test environment requirements.
Selenium Integrated Development Environment (IDE) – Selenium IDE is a record and playback
tool. It is distributed as a Firefox Plugin.
Selenium Remote Control (RC) – Selenium RC is a server that allows a user to create test scripts
in the desired programming language. It also allows executing test scripts within the large
spectrum of browsers.
Selenium WebDriver – WebDriver is a different tool altogether that has various advantages over
Selenium RC. WebDriver directly communicates with the web browser and uses its native
compatibility to automate.
Selenium Grid – Selenium Grid is used to distribute your test execution on multiple platforms
and environments concurrently.
105
Q #5) What are the testing types that can be supported by Selenium?
1. Functional Testing
2. Regression Testing
Q #7) What is the difference between Selenium IDE, Selenium RC and WebDriver?
Object Oriented Selenium IDE is not an Selenium RC is semi object WebDriver is a purely object
106
Dynamic Finders
(for locating web Selenium IDE doesn't Selenium RC doesn't support WebDriver supports dynamic
elements on a support dynamic finders dynamic finders finders
webpage)
WebDriver is designed in a
way to efficiently support
Selenium IDE doesn't testing of iPhone/Android
WAP Selenium RC doesn't support
support testing of applications. The tool comes
(iPhone/Android) testing of iPhone/Andriod
iPhone/Andriod with a large range of drivers
Testing applications
applications for WAP based testing.
For example, AndroidDriver,
iPhoneDriver
Selenium IDE is the simplest and easiest of all the tools within the Selenium Package. Its record
and playback feature makes it exceptionally easy to learn with minimal acquaintances to any
programming language. Selenium IDE is an ideal tool for a naïve user.
Selenese is the language which is used to write test scripts in Selenium IDE.
The locator can be termed as an address that identifies a web element uniquely within the
webpage. Thus, to identify web elements accurately and precisely we have different types of
locators in Selenium:
ID
ClassName
Name
TagName
LinkText
PartialLinkText
Xpath
CSS Selector
DOM
Assert: Assert command checks whether the given condition is true or false. Let’s say we assert
whether the given element is present on the web page or not. If the condition is true then the
program control will execute the next test step but if the condition is false, the execution would
stop and no further test would be executed.
Verify: Verify command also checks whether the given condition is true or false. Irrespective of
the condition being true or false, the program execution doesn’t halt i.e. any failure during
verification would not stop the execution and all the test steps would be executed.
XPath is used to locate a web element based on its XML path. XML stands for Extensible
Markup Language and is used to store, organize and transport arbitrary data. It stores data in a
key-value pair which is very much similar to HTML tags. Both being markup languages and
since they fall under the same umbrella, XPath can be used to locate HTML elements.
The fundamental behind locating elements using XPath is the traversing between various
elements across the entire page and thus enabling a user to find an element with the reference of
another element.
Single Slash “/” – Single slash is used to create Xpath with absolute path i.e. the xpath would be
created to start selection from the document node/start node.
Double Slash “//” – Double slash is used to create Xpath with relative path i.e. the xpath would
be created to start selection from anywhere within the document.
108
The problem of same origin policy disallows to access the DOM of a document from an origin
that is different from the origin we are trying to access the document.
Origin is a sequential combination of scheme, host and port of the URL. For example, for a URL
[Link] the origin is a combination of http,
[Link], 80 correspondingly.
Thus the Selenium Core (JavaScript Program) cannot access the elements from an origin that is
different from where it was launched. For Example, if I have launched the JavaScript Program
from “[Link] then I would be able to access the pages within the
same domain such as “[Link] or
“[Link] The other domains like [Link],
[Link] would no more be accessible.
So, In order to handle same origin policy, Selenium Remote Control was introduced.
Selenium Grid can be used to execute same or different test scripts on multiple platforms and
browsers concurrently so as to achieve distributed test execution, testing under different
environments and saving execution time remarkably.
WebDriver
FirefoxDriver
InternetExplorerDriver
109
ChromeDriver
SafariDriver
OperaDriver
AndroidDriver
IPhoneDriver
HtmlUnitDriver
1. Implicit Wait
2. Explicit Wait
Implicit Wait: Implicit waits are used to provide a default waiting time (say 30 seconds)
between each consecutive test step/command across the entire test script. Thus, subsequent test
step would only execute when the 30 seconds have elapsed after executing the previous test
step/command.
Explicit Wait: Explicit waits are used to halt the execution till the time a particular condition is
met or the maximum time has elapsed. Unlike Implicit waits, explicit waits are applied for a
particular instance only.
User can use sendKeys(“String to be entered”) to enter the string in the textbox.
Syntax:
WebElement username = [Link]([Link](“Email”));
// entering username
[Link](“sth”);
WebDriver facilitates the user with the following methods to check the visibility of the web
elements. These web elements can be buttons, drop boxes, checkboxes, radio buttons, labels etc.
1. isDisplayed()
2. isSelected()
3. isEnabled()
Syntax:
isDisplayed():
boolean buttonPresence = [Link]([Link](“gbqfba”)).isDisplayed();
110
isSelected():
boolean buttonSelected = [Link]([Link](“gbqfba”)).isDisplayed();
isEnabled():
boolean searchIconEnabled = [Link]([Link](“gbqfb”)).isEnabled();
Get command is used to retrieve the inner text of the specified web element. The command
doesn’t require any parameter but returns a string value. It is also one of the extensively used
commands for verification of messages, labels, errors etc displayed on the web pages.
Syntax:
String Text = [Link]([Link](“Text”)).getText();
Value in the drop down can be selected using WebDriver’s Select class.
Syntax:
selectByValue:
Select selectByValue = new Select([Link]([Link](“SelectID_One”)));
[Link](“greenvalue”);
selectByVisibleText:
Select selectByVisibleText = new Select ([Link]([Link](“SelectID_Two”)));
[Link](“Lime”);
selectByIndex:
Select selectByIndex = new Select([Link]([Link](“SelectID_Three”)));
[Link](2);
Sample code:
[Link]().back();
navigate().forward() – This command lets the user to navigate to the next web page with
reference to the browser’s history.
111
Sample code:
[Link]().forward();
navigate().refresh() – This command lets the user to refresh the current web page there by
reloading all the web elements.
Sample code:
[Link]().refresh();
navigate().to() – This command lets the user to launch a new web browser window and navigate
to the specified URL.
Sample code:
[Link]().to(“[Link]
[Link]([Link](“Google”)).click();
The command finds the element using link text and then click on that element and thus the user
would be re-directed to the corresponding page.
The above mentioned link can also be accessed by using the following command.
[Link]([Link](“Goo”)).click();
The above command find the element based on the substring of the link provided in the
parenthesis and thus partialLinkText() finds the web element with the specified substring and
then clicks on it.
An inline frame acronym as iframe is used to insert another document with in the current HTML
document or simply a web page into a web page by enabling nesting.
Select iframe by id
[Link]().frame(“ID of the frame“);
frame(index)
[Link]().frame(0);
frame(Name of Frame)
[Link]().frame(“name of the frame”);
frame(WebElement element)
Select Parent Window
[Link]().defaultContent();
findElement(): findElement() is used to find the first element in the current web page matching
to the specified locator value. Take a note that only first matching element would be fetched.
Syntax:
Syntax:
List <WebElement> elementList =
[Link]([Link](“//div[@id=’example’]//ul//li”));
Q #29) How to find more than one web element in the list?
At times, we may come across elements of same type like multiple hyperlinks, images etc
arranged in an ordered or unordered list. Thus, it makes absolute sense to deal with such
elements by a single piece of code and this can be done using WebElement List.
Sample Code
6{
8 [Link](i).click();
10 [Link]().back();
11 }
close(): WebDriver’s close() method closes the web browser window that the user is currently
working on or we can also say the window that is being currently accessed by the WebDriver.
The command neither requires any parameter nor does is return any value.
quit(): Unlike close() method, quit() method closes down all the windows that the program has
opened. Same as close() method, the command neither requires any parameter nor does is return
any value.
Selenium is an automation testing tool which supports only web application testing. Therefore,
windows pop up cannot be handled using Selenium.
WebDriver offers the users with a very efficient way to handle these pop ups using Alert
interface. There are the four methods that we would be using along with the Alert interface.
void dismiss() – The accept() method clicks on the “Cancel” button as soon as the pop up
window appears.
void accept() – The accept() method clicks on the “Ok” button as soon as the pop up window
appears.
String getText() – The getText() method returns the text displayed on the alert box.
void sendKeys(String stringToSend) – The sendKeys() method enters the specified string pattern
into the alert box.
Syntax:
// accepting javascript alert
Alert alert = [Link]().alert();
[Link]();
Selenium is an automation testing tool which supports only web application testing, that means,
it doesn’t support testing of windows based applications. However Selenium alone can’t help the
situation but along with some third party intervention, this problem can be overcome. There are
114
several third party tools available for handling window based pop ups along with the selenium
like AutoIT, Robot class etc.
WebDriver offers a wide range of interaction utilities that the user can exploit to automate mouse
and keyboard events. Action Interface is one such utility which simulates the single user
interactions.
Thus, In the following scenario, we have used Action Interface to mouse hover on a drop down
which then opens a list of options.
Sample Code:
[Link]([Link]([Link]("id of the
4
dropdown"))).perform();
7 [Link]();
The values of the css properties can be retrieved using a get() method:
Syntax:
[Link]([Link](“id“)).getCssValue(“name of css attribute”);
[Link]([Link](“id“)).getCssValue(“font-size”);
1 import [Link];
2 import [Link];
3 import [Link];
115
4 import [Link];
5 import [Link];
6 import [Link];
7 import [Link];
8 import [Link];
9 import [Link];
10 import [Link];
11
14 @Before
driver =
16
new FirefoxDriver();
17
[Link]("[Link]
18 }
19 @After
21
[Link]();
22 }
23
24 @Test
28 // Code
116
30 }
31 }
@Test: Annotation lets the system know that the method annotated as @Test is a test method.
There can be multiple test methods in a single test script.
@Before: Method annotated as @Before lets the system know that this method shall be
executed every time before each of the test method.
@After: Method annotated as @After lets the system know that this method shall be executed
every time after each of the test method.
@BeforeClass: Method annotated as @BeforeClass lets the system know that this method shall
be executed once before any of the test method.
@AfterClass: Method annotated as @AfterClass lets the system know that this method shall be
executed once after any of the test method.
@Ignore: Method annotated as @Ignore lets the system know that this method shall not be
executed.
TestNG is an advance framework designed in a way to leverage the benefits by both the
developers and testers. With the commencement of the frameworks, JUnit gained an enormous
popularity across the Java applications, Java developers and Java testers with remarkably
increasing the code quality. Despite being easy to use and straightforward, JUnit has its own
limitations which give rise to the need of bringing TestNG into the picture. TestNG is an open
source framework which is distributed under the Apache software License and is readily
available for download.
TestNG with WebDriver provides an efficient and effective test result format that can in turn be
shared with the stake holders to have a glimpse on the product’s/application’s health thereby
eliminating the drawback of WebDriver’s incapability to generate test reports. TestNG has an
inbuilt exception handling mechanism which lets the program to run without terminating
unexpectedly.
117
There are various advantages that make TestNG superior to JUnit. Some of them are:
Code Snippet
1 package TestNG;
2 import [Link].*;
4 @Test(priority=0)
6 }
7 @Test(priority=1)
9 }
10 @Test(priority=2)
12 }
13 }
1. Method1
2. Method2
3. Method3
Reusability of code
Maximum coverage
Recovery scenario
Low cost maintenance
Minimal manual intervention
Easy Reporting
1. Module Based Testing Framework: The framework divides the entire “Application Under Test”
into number of logical and isolated modules. For each module, we create a separate and
independent test script. Thus, when these test scripts taken together builds a larger test script
representing more than one module.
2. Library Architecture Testing Framework: The basic fundamental behind the framework is to
determine the common steps and group them into functions under a library and call those
functions in the test scripts whenever required.
3. Data Driven Testing Framework: Data Driven Testing Framework helps the user segregate the
test script logic and the test data from each other. It lets the user store the test data into an
external database. The data is conventionally stored in “Key-Value” pairs. Thus, the key can be
used to access and populate the data within the test scripts.
4. Keyword Driven Testing Framework: The Keyword driven testing framework is an extension to
Data driven Testing Framework in a sense that it not only segregates the test data from the
scripts, it also keeps the certain set of code belonging to the test script into an external data file.
5. Hybrid Testing Framework: Hybrid Testing Framework is a combination of more than one above
mentioned frameworks. The best thing about such a setup is that it leverages the benefits of all
kinds of associated frameworks.
6. Behavior Driven Development Framework: Behavior Driven Development framework allows
automation of functional validations in easily readable and understandable format to Business
Analysts, Developers, Testers, etc.
Test data can efficiently be read from excel using JXL or POI API. See detailed tutorial here.
JXL supports “.xls” format i.e. binary based format. JXL doesn’t
1 POI jar supports all of these formats
support Excel 2007 and “.xlsx” format i.e. XML based format
119
2 JXL API was last updated in the year 2009 POI is regularly updated and released
4 JXL API doesn’t support rich text formatting POI API supports rich text formatting
5 JXL API is faster than POI API POI API is slower than JXL API
Selenium supports almost all the popular QTP supports Internet Explorer, Firefox
Browser
browsers like Firefox, Chrome, Safari, and Chrome. QTP only supports Windows
Compatibility
Internet Explorer, Opera etc Operating System
Object Object Repository needs to be created as a QTP automatically creates and maintains
Repository separate entity Object Repository
WebDriver cannot test Mobile applications. WebDriver is a web based testing tool, therefore
applications on the mobile browsers can be tested.
Q #50) What is Object Repository? How can we create Object Repository in Selenium?
120
Object Repository is a term used to refer to the collection of web elements belonging to
Application Under Test (AUT) along with their locator values. Thus, whenever the element is
required within the script, the locator value can be populated from the Object Repository. Object
Repository is used to store locators in a centralized location instead of hard coding them within
the scripts.
In Selenium, objects can be stored in an excel sheet which can be populated inside the script
whenever required.
Web Testing tools Selenium RC and WebDriver are consolidated in single tool in Selenium 2.0
Selenium 3.0 is the latest version of Selenium. It has released 2 beta versions of selenium 3.0
with few of the below changes:
In Selenium every object or control in a web page is referred as an elements, there are different
ways to find an element in a web page they are
ID
Name
Tag
Attribute
CSS
Linktext
PartialLink Text
Xpath etc
b) Regression
For post release validation with continuous integration automation tool could be used
a) Jenkins
b) Hudson
c) Quick Build
122
d) CruiseCont
6) 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 “waifFor”.
X-Path is used to find the WebElement in web pages. It is also useful in identifying the dynamic
elements.
8) Explain the difference between single and double slash in X-path? Single slash ‘/ ’
9) List out the technical challenges with Selenium? Technical challenges with Selenium are
10) 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
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.
123
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.
12) What is JUnit Annotations and what are different types of annotations which are useful
?
In JAVA a special form of syntactic meta-data can be added to Java source code, this is know as
Annotations. Variables, parameters, packages, methods and classes are annotated some of the
Junit annotations which can be useful are
Test
Before
After
Ignore
BeforeClass
AfterClass
RunWith
13) 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)
15) Why testers should opt for Selenium and not QTP? Selenium is more popular than QTP
as
16) What are the four parameter you have to pass in Selenium? Four parameters that you
have to pass in Selenium are
Host
124
Port Number
Browser
URL
[Link] () : It will stop the current (java) thread for the specified period of time. Its done
only once
SetSpeed () : For specific amount of time it will stop the execution for every selenium command.
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
18) 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
[Link] () ;
Alternatively you can use click method on the element which does form submission
21) What are the features of TestNG and list some of the functionality in TestNG which
makes it more effective?
TestNG is a testing framework based on JUnit and NUnit to simplify a broad range of testing
needs, from Unit Testing to Integration Testing. And the functionality which makes it efficient
testing framework are
22) 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.
23) Which attribute you should consider throughout the script in frame for “if no frame Id
as well as no frame name”?
You will ned to switch to each and every frame and search for locator which we want.
24) Explain what is the difference between find elements () and find element () ?
It finds the first element within the current page using the given “locating mechanism”. It
returns a single WebElement
126
findElements () : Using the given “locating mechanism” find all the elements within the current
page. It returns a list of web elements.
25) Explain what are the JUnits annotation linked with Selenium?
@Before public void method() – It will perform the method () before each test, this method can
prepare the test
@Test public void method() – Annotations @Test identifies that this method is a test method
environment
@After public void method()- To execute a method before this annotation is used, test method
must start with test@Before
Datadriven framework: In this framework, the test data is separated and kept outside the Test
Scripts, while Test Case logic resides in Test Scripts. Test data is read from the external files
( Excel Files) and are loaded into the variables inside the Test Script. Variables are used for both
for input values and for verification values.
Keyworddriven framework: The keyword driven frameworks requires the development of data
tables and keywords, independent of the test automation. In a keyword driven test, the
functionality of the application under test is documented in a table as well as step by step
instructions for each test.
27) Explain how you can login into any site if it’s showing any authentication popup for
password and username?
Syntax-[Link]
ex- [Link]
WebElement el = [Link]([Link](“ElementID”))
29) Explain what is the difference between Borland Silk and Selenium?
Silk test supports only Internet Selenium supports many browsers like Internet
Explorer and Firefox Explorer, Firefox, Safari, Opera and so on
Silk test uses test scripting Selenium suite has the flexibility to use many
language languages like Java, Ruby,Perl and so on
An object repository is an essential entity in any UI automations which allows a tester to store all
object that will be used in the scripts in one or more centralized locations rather than scattered all
over the test scripts.
Selenium Grid sent the tests to the hub. These tests are redirected to Selenium Webdriver, which
launch the browser and run the test. With entire test suite, it allows for running tests in parallel.
Yes. But not as effectively as a dedicated Performance Testing tool like Loadrunner.
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
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
34) Mention what are the capabilities of Selenium WebDriver or Selenium 2.0 ?
Handling multiple frames, pop ups , multiple browser windows and alerts
128
35) 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.
36) Explain how you can find broken images in a page using Selenium Web driver ?
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
Use getCssValue(arg0) function to get the colors by sending ‘color’ string as an argument
38) Using web driver how you can store a value which is text box?
You can use following command to store a value which is text box using web driver
WebDriverException
NoAlertPresentException
NoSuchWindowException
129
NoSuchElementException
TimeoutException
41) Explain using Webdriver how you can perform double click ?
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.
44) Explain how you can handle frames using Selenium 2.0 ?
To bring control on HTML frame you can use “SwitchTo” frame method-
[Link]().frame(“frameName”);
[Link]().frame(“[Link]”);
This would bring control on frame named- “frameName” of the 4th sub frame names
“parentFrame”
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
[Link]().defaultContent();
130
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
[Link]
[Link]()
48) 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 [Link]
49) 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
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
51) How can you prepare customized html report using TestNG in hybrid framework ?
Using our own customized reports using XSL jar for converting XML content to HTML
52) From your test script how you can create html test report?
TestNG: Using inbuilt [Link] 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
53) Explain how you can insert a break point in Selenium IDE ?
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
54) 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
Selenese is a selenium set of command which are used for running the test
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
58) In selenium IDE what are the element locators that can be used to locate elements on
web page?
X-path locators
Css locators
Html id
Html name
59) 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{[Link]()}
And for
type
css=input#s
javascript{new Date()}
60) 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
61) Using Selenium IDE is it possible to get data from a particular html table cell ?
storeTable
Css=#table 0.2
133
textFromCell
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
63) 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
64) 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
65) In which format does source view shows your script in Selenium IDE ?
66) Explain how you can insert a start point in Selenium IDE?
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”
67) 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
68) 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.
134
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.
70) 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.
71) How will you verify the specific position of an web element
You can use the storeAlert command which will fetch the message of the alert pop up and store it
in a variable.
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
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.
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
Advantages of RC are
77) 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 .
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
79) 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.
80) 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.
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.
82) Explain how you can capture server side log Selenium Server?
To capture server side log in Selenium Server, you can use command
83) Other than the default port 4444 how you can run Selenium Server?
136
You can run Selenium server on java-jar [Link]-port other than its default port
84) 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
To handle network latency you can use [Link] for network latency
86) To enter values onto text boxes what is the command that can be used?
isElementPresent(String locator)
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.
Few points that favor Python over Java to use with Selenium is,
90) Mention what are the challenges in Handling Ajax Call in Selenium Webdriver?
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.
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.
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.
IAnnotationTransformer
IAnnotationTransformer2
IConfigurable
IConfigurationListener
IExecutionListener
IHookable
IInvokedMethodListener
IInvokedMethodListener2
IMethodInterceptor
IReporter
ISuiteListener
ITestListener
138
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,
For Database Testing in Selenium Webdriver, you need JDBC (Java Database Connectivity)
API. It allows you to execute SQL statements.
99) 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.
100) Mention what are the advantages of Using Git Hub For Selenium?
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.