Software Testing Interview - 1698897258390
Software Testing Interview - 1698897258390
https://www.linkedin.com/in/shady-ahmed97/
https://github.com/Shady1997
ABSTRACT
Sofware Tesng Inerview Quesons and Answers
(Manual Tesng, API, Perormance Tesng,
Auomaon Tesng, Java, Maven, TesNG, Daabase,
Agile) suppored wih cases sudy
SOFTWARE https://chat.whatsapp.com/JHbX1
TESTING https://t.me/+e9mrF1oMSM1jNW
INTERVIEW
Sofware Tesng Inerview Quesons and Answers
Selenium:
1.Wha are he challenges during auomaon esng?
- Challenges during esng may include handling dynamic elemens, synchronizaon, idenying elemens wih
changing aribues, and ensuring cross-browser compabiliy.
2.Wha sraegies you ollowed while building a Selenium ramework rom scrach?
- Common sraegies include srucuring code using Page Objec Model (POM), using es daa exernalizaon,
implemen reporng and logging, and employing a version conrol sysem.
3.Where do you perorm he singleon design paern? I you don' use i, hen do you have an idea abou his?
- The singleon design paern is ofen used o ensure a single insance o a WebDriver hroughou he es suie o
preven resource wasage.
6.Why do we preer explici wai insead o uen wai? Wha are he disadvanages o uen wai?
- Explici wais are more versale and oer ne-grained conrol, while Fluen wais are ofen considered less readable
and harder o use.
- Selenium scrips will sll work wihou an implici wai bu may no wai or elemens o load, poenally causing
synchronizaon issues.
8.Wha is he deaul polling me in explici wai and in implici wai?
- The deaul polling me in explici and implici wais is 500 milliseconds.
- Synchronizaon is he process o ensuring ha he auomaon scrip and web applicaon are in harmony, prevenng
scrip execuon beore he web page is ready.
- Boh explici and uen wais rely on he “WebDriverWai” class o speciy waing condions.
- Absracon involves creang absrac classes or ineraces or page objecs, making he code more modular. For
example, using an absrac Page class.
- Facory design ocuses on creang objecs, while Singleon ensures only one insance exiss. They serve dieren
purposes.
- Page Objec Model (POM) is a design paern ha represens web pages as Java classes.
- Page Facory is a class provided by Selenium o inialize elemens in POM classes.
14.Have you used an inerace in your ramework oher han Selenium ineraces?
- In your ramework, you can use ineraces o dene common behavior or page objecs.
- Inheriance can be used o creae a hierarchy o page objecs or cusom uliy classes.
16.Wha is Webdriver, and wha are he mehods ha do no have an implemenaon?
- Webdriver is an inerace. Some mehods wihou implemenaon include ge(), ndElemen(), and navigae().
- Mehods like ge(), ndElemen(), navigae(), and ohers are presen in he WebDriver inerace.
- This code maximizes he browser window. Driver.manage() reurns an insance o he Opons inerace.
- Boh mehods navigae o a URL, bu ge() is shorer and more inuive.
- Ge open URL and wai page o load bu navigae no wai page o load.
- To check or broken links, you can ierae hrough all links, send HTTP requess, and check he response saus code
(e.g., 404 or no ound).
- submi() is used o submi a orm, while click() is used o simulae a click acon on a web elemen like a buon or a
link.
- Absolue XPah sars rom he roo node o he documen, while relave XPah sars rom he curren conex node.
- Relave XPah is generally preerred or robus and mainainable auomaon.
- ndElemen reurns he rs maching web elemen or hrows an excepon i no ound.
- ndElemens reurns a lis o maching web elemens or an empy lis i none are ound.
- Frames are HTML elemens ha allow you o divide a webpage ino mulple secons.
- irames (inline rames) are rames embedded wihin a webpage.
29.Sae some excepons which you have aced in your ramework (Don' menon only Selenium, explain Java excepons
as well).
- Commonly used ineraces in Selenium include WebDriver, WebElemen, Aler, JavascripExecuor, and more.
- Inheriance can be used o creae a hierarchy o es classes, cusom uliy classes, and page objec classes or a more
organized es ramework.
33.How do you inialize web elemens in POM? Wha error or excepon will come i no iniaed?
- Web elemens in POM are ypically inialized using he @FindBy annoaon and PageFacory class. I no inialized,
you may ge a NullPoinerExcepon or similar excepons when rying o use hem.
34.I boh wai mehods, ha is implici and explici, are menoned in he scrip, hen which one will work? Is i good
pracce o menon boh?
- I boh are used in he same scrip, explici wai akes precedence or he elemens ha have explici wais applied.
Menoning boh can be redundan and no considered a good pracce.
- To handle alers, you can use he Aler inerace and is mehods like accep(), dismiss(), and geTex().
- You can handle pop-ups by using explici wais and handling he pop-up when i appears or by swiching o he pop-up
window using driver.swichTo().window(windowHandle).
38.How o handle le upload when he ype aribue does no speciy he le or he upload web elemen?
- To handle le uploads when he ype aribue is no specied, you can use he sendKeys() mehod o send he le
pah o an <inpu ype="le"> elemen.
39.How o cover characer keyboard operaons rom he conex menu ulizing a user-dened keyword?
- To cover keyboard operaons, you can use he Acons class o build and perorm a cusom keyword ha simulaes
keyboard shorcus.
40.Consider his snippe: WebDriver driver = new ChromeDriver(); Wha does he above code snippe mean?
- Dynamic Polymorphism is observed when mehods like ndElemen or click behave dierenly based on he conex
(elemen ype, sae, ec.).
43.I proper Xpah, CssSelecor, and ID are no available, how do you ideny an objec?
- I proper locaors are no available, you may resor o using oher aribues, CSS classes, or JavaScrip o locae
elemens.
- CSS Selecors can be based on aribues like id, class, ag name, aribue name, or elemen hierarchy.
- CSS locaors are generally aser han XPah, bu perormance can depend on he browser and specic use cases.
- To ge he nh elemen, you can use [n] in boh XPah and CSS selecors, where n is he index (0-based).
47.Consider you are only allowed o use CSS locaor, how will you nd he paren/grandparen o a web elemen?
- CSS does no provide a direc way o selec a paren or grandparen elemen. You may need o use JavaScrip.
driver.ndElemens() does no hrow an excepon and reurns an empy lis i no elemens are ound.
- driver().manage() reurns an insance o he Opons inerace, which is used or browser window managemen.
50.In Selenium, i you wan o access he elemen ha has he ex "This elemen has an ID ha changes every me he
page is loaded" in i, hen which o he ollowing will you use?
- You can use XPah or CSS selecors ha arge he elemen's ex, aribues, or hierarchy o locae i
51.Sared auomaon es suie execuon and a ew es cases ailed in a es run. How can you execue only ailed es
cases a once wih one click? Wha design paern do we use when we rigger dieren browsers?
- To rerun ailed es cases, you can use esng-ailed.xml, a esng.xml le conaining only he ailed es cases. Design
paerns like he Facory Paern can be used or browser managemen.
- Handling dynamic elemens may require using explici wais or modiying locaors o use paral or sable aribues.
53.How o click he las opon in a dynamically changing dropdown (Las dropdown changes dynamically)?
- To click he las opon in a dynamically changing dropdown, you can locae he dropdown, dynamically calculae he
las opon, and click i.
- You can calculae links on a page by locang all anchor (<a>) elemens in he HTML and counng hem.
- You can read values rom an Excel shee using libraries like Apache POI in Java.
- Page Facory is a class provided by Selenium ha allows easy inializaon o page elemens in he Page Objec Model
(POM) design paern.
57.Suppose you have 10 pages in your applicaon. How do you achieve POM? Wha will you do?
- In POM, you creae a separae Java class or each page and dene web elemens and mehods specic o ha page.
- Common annoaons used in Page Objec Model (POM) include @FindBy, @FindBys, and @CacheLookup.
- To nd broken links, ierae hrough all links, send HTTP requess, and check or response saus codes. A valid link
should reurn a 200 (OK) saus code.
- To handle rames, use driver.swichTo().rame() o swich o he rame by index, name, or a reerence o he rame
elemen.
- To handle alers, use driver.swichTo().aler() o inerac wih JavaScrip alers, conrmaons, and promps.
- asser and veriy are used or asseron in es scrips. The key dierence is ha asser sops he es i i ails, while
veriy allows he es o connue.
- You can se browser preerences o speciy he download older and handle le download dialogs o auomae le
downloads.
- You can use libraries like Apache POI or handle daa ables as web elemens o rerieve and manipulae daa.
Localizaon esng involves changing he browser's language setngs and checking i he web applicaon displays conen in
he correc language.
67.How o avoid NoSuchElemenExcepon wihou using a ry/cach block and wih a ry/cach block?
- You can use explici wais o handle elemen visibiliy and avoid excepons. Wih ry/cach, you can cach he
excepon and ake appropriae acon.
- Dynamic web ables may require nding he able elemen, ierang hrough rows and columns, and locang specic
daa.
69.How o check wheher a web elemen is enabled or disabled wihou using isEnabled mehod?
- CSS locaors are usually aser han XPah due o heir opmized synax and implemenaon in browsers.
71.Even hough CSS is aser han XPah, why do 95% o companies use XPah?
- XPah provides more powerul and exible ways o locae elemens, which may be required or complex scenarios.
72.Wha should be done when an elemen is no ound, bu i's available on he web page? The elemen is no hidden, so
no need o use JavaScrip Execuor. How do you solve his?
- Ensure ha he locaor is correc, he elemen is wihin he curren rame, and here are no dynamic aribues
aecng he elemen's visibiliy.
- You can run ess in headless mode by setng he browser o headless mode using opons and capabilies provided
by WebDriver.
74.In Selenium, how o ge he ex value rom a ex-box i geTex() is no working?
- I geTex() doesn' work, you can use geAribue("value") o ge he value o a ex box.
75.I we are using he correc locaor bu sll getng an "elemen no ound" error, hen how will you resolve his error?
- Check i he elemen is wihin he curren rame, here are no dynamic aribues, and synchronizaon issues exis.
You may need o use explici wais.
76.In Page Objec Model, once you creae LoginPage.java class, wha is he rs hing you sar wih wring inially? How
are you iniang wring somehing ino a page class?
- The rs sep is dening he web elemens using @FindBy annoaons. Then, creae mehods o inerac wih hose
elemens.
77.Wha i a Windows popup occurs during es execuon, and due o ha, you can' execue auomaed ess? How will
you resolve his error?
- You can use hird-pary libraries like AuoIT or he Robo class in Java o inerac wih sysem dialogs.
- Hidden elemens can be handled by using JavaScrip o manipulae heir visibiliy or by modiying heir aribues.
79.Wha is he dierence beween click() uncon in WebElemen inerace and click() uncon in Acons class?
- Boh click() uncons are used or clicking, bu he Acons class allows or complex ineracons and is commonly used
or righ-click acons.
- Tes behavior can be changed a runme using condional saemens or by reading conguraons rom exernal
sources.
- You can righ-click using he Acons class o build and perorm he righ-click acon.
- You can scroll down a page using JavaScrip by execung a scroll command hrough he WebDriver.
- driver.geWindowHandles() reurns a se o window handles or all open windows or abs.
- For Windows-based applicaons, you can use ools like AuoIT or WinAppDriver, which provide WebDriver-like
capabilies or Windows apps.
85.How o rerun only ailed es cases wih one click and wha design paern is used when riggering dieren browsers?
- You can rerun ailed es cases using TesNG's esng-ailed.xml conguraon le. The Facory Design Paern is ofen
used or managing dieren browsers.
- Dynamic WebElemens can be handled using explici wais, modiying locaors, or using regular expressions when he
aribue values change.
87.How o click he las opon in a dynamically changing dropdown (Las dropdown changes dynamically)?
- To click he las opon in a dynamically changing dropdown, you can locae all opons and choose he las one
programmacally.
- To coun links on a page, locae all anchor <a> ags in he HTML and coun hem using Selenium.
- You can use libraries like Apache POI o read values rom Excel shees in Selenium. Here's a sample code snippe in
Java:
- Page Facory is a class provided by Selenium o inialize elemens wihin Page Objecs, improving code mainainabiliy
and readabiliy.
91.Suppose you have 10 pages in your applicaon. How do you achieve Page Objec Model (POM)? Wha will you do?
- In Page Objec Model (POM), you creae a separae class or each web page, dening he page's elemens and acons
as mehods wihin he class.
- To nd broken links, you can locae all anchor elemens, send HTTP requess, and veriy he response saus code. A
valid link should reurn a 200 (OK) saus.
- To handle rames, you can use driver.swichTo().rame() o swich o a rame by index, name, or WebElemen
reerence.
- You can handle JavaScrip alers using mehods rom he Aler inerace, such as accep(), dismiss(), and geTex().
- Boh asser and veriy are used or making asserons in es scrips. The primary dierence is ha an asser ails he
es i i's no rue, while veriy connues execung he es and repors he resul.
- To download a le, you can congure he browser's download setngs and handle le download dialogs using
Selenium.
- To manage daa ables, you can use libraries like Apache POI or rea ables as web elemens, parsing heir conen or es
daa.
- Auomang localizaon esng involves changing he browser's language setngs and veriying ha he UI displays conen
in he correc language.
101.How o avoid NoSuchElemenExcepon wihou using a ry/cach block and wih a ry/cach block?
- You can avoid NoSuchElemenExcepon using explici wais o ensure elemen visibiliy. Wih ry/cach, you can handle he
excepon graceully by caching i.
- For dynamic web ables, locae he able, ierae hrough rows and columns, and use appropriae condions o exrac or
manipulae daa.
103.How o check wheher a web elemen is enabled or disabled wihou using isEnabled mehod?
- You can check i an elemen is enabled or disabled by using geAribue("disabled") and evaluang he value. Disabled
elemens ofen have he "disabled" aribue se.
- CSS locaors are generally aser han XPah due o heir ecien implemenaon in modern browsers.
105.Even hough CSS is aser han XPah, why do 95% o companies use XPah?
- XPah oers more powerul and exible elemen selecon capabilies, especially or complex scenarios.
106.Wha should be done when an elemen is no ound, bu i's available on he web page? The elemen is no hidden, so
no need o use JavaScrip Execuor. How do you solve his?
- Veriy he locaor is accurae, check i he elemen is wihin he curren rame, and accoun or any dynamic aribues ha
may aec visibiliy.
- You can run ess in headless mode by setng he browser o run wihou a visible GUI using browser opons or capabilies.
108.In Selenium, how o ge he ex value rom a ex-box i geTex() is no working?
- I geTex() doesn' work or a ex-box, you can use he geAribue("value") mehod o rerieve he ex inpu's value.
109.I we are using he correc locaor bu sll getng an "elemen no ound" error, hen how will you resolve his error?
- Ensure he elemen is wihin he curren rame, review he elemen's aribues, and use explici wais o handle
synchronizaon issues.
110.In Page Objec Model, once you creae LoginPage.java class, wha is he rs hing you sar wih wring inially? How
are you iniang wring somehing ino a page class?
- Sar by dening web elemens using @FindBy annoaons, ollowed by creang mehods o inerac wih hose elemens in
he Page Objec class.
111.Wha i a Windows popup occurs during es execuon, and due o ha, you can' execue auomaed ess? How will
you resolve his error?
- To handle Windows popups, you can use hird-pary ools like AuoIT or he Robo class in Java or ineracon wih sysem
dialogs.
- Hidden elemens can be handled by using JavaScrip o manipulae heir visibiliy or by modiying heir aribues.
113.Wha is he dierence beween click() uncon in WebElemen inerace and click() uncon in Acons class?
- Boh click() uncons are used or clicking, bu he Acons class allows or more complex ineracons and is ofen used or
righ-click acons.
- Tes behavior can be changed a runme using condional saemens, conguraons, or exernal daa sources.
115.Describe how o handle irames, windows, ables, and alers using Selenium.
- Handling hese elemens usually involves swiching o he appropriae rame/window and using WebDriver mehods or
ineracon.
- You can perorm a righ-click using he Acons class o build and execue a righ-click acon.
- You can scroll down a page using JavaScrip by execung a scroll command hrough he WebDriver.
- driver.geWindowHandles() reurns a se o window handles or all open windows or abs.
- For Windows-based applicaons, you can use ools like AuoIT or WinAppDriver, which provide WebDriver-like capabilies
or Windows apps.
================================================================================================
Java:
1.Why is Sring immuable in Java?
- Srings are immuable in Java because heir values canno be changed afer hey are creaed. When you modiy a
sring, a new sring is creaed insead o modiying he exisng one. This ensures ha sring objecs remain consan
and are hread-sae.
For example:
- sac is a keyword in Java used o creae class-level variables and mehods ha belong o he class, no o insances o
he class. Sac variables are shared among all insances o he class, and sac mehods can be called wihou
creang an insance o he class.
For example:
class Example {
coun++;
- nal is a keyword in Java used o make variables, mehods, and classes unmodiable. When a variable is marked as
nal, is value canno be changed afer inializaon. When a mehod is declared nal, i canno be overridden in
subclasses. When a class is marked as nal, i canno be exended.
For example:
- his is a keyword in Java ha reers o he curren insance o he class. I is ofen used o disnguish beween
insance variables and parameers or local variables wih he same name.
For example:
class Example {
in x;
Example(in x) {
}}
- nally is a block ha is used in excepon handling o ensure ha a cerain block o code is always execued, wheher
an excepon is hrown or no. I's commonly used in conjuncon wih ry and cach blocks o clean up resources.
For example:
ry {
} nally {
// This block always ges execued, e.g., o close a le or release resources
- Auoboxing is he auomac conversion o primive daa ypes ino heir corresponding wrapper classes (e.g., in o
Ineger) when necessary. Unboxing is he opposie, where wrapper objecs are auomacally convered o heir
primive ypes.
For example:
- Serializaon is he process o converng an objec's sae ino a bye sream, which can be saved o a le, sen over a
nework, or sored in a daabase.
- Deserializaon is he reverse process, where he bye sream is convered back ino an objec. This is ofen used or
daa persisence and communicaon.
- Java has primive daa ypes like in, char, and boolean, which hold simple values direcly.
- Non-primive daa ypes, ofen reerred o as reerence ypes, include classes and ineraces.
- Sring is a non-primive daa ype because i's a class ha represens a sequence o characers.
- Mehod overloading is a eaure in Java ha allows you o dene mulple mehods in he same class wih he same
name bu dieren parameer liss.
- The mehods are disnguished by he number or ype o parameers.
For example:
void prin(in x) {
// ...
void prin(Sring s) {
// ...
- When you override he equals() mehod, you're dening how wo objecs are considered equal.
- To ensure proper behavior when using hese objecs in collecons like HashMap or HashSe, you should also override
he hashCode() mehod.
- The hashCode() mehod is used o deermine he hash code o an objec, and his hash code is used o place objecs
in a hash-based daa srucure.
- I you override equals() wihou overriding hashCode(), you may encouner unexpeced behavior.
- An absrac class can have mehod implemenaons and elds, while an inerace can only declare mehod signaures
and consans.
- A class can implemen mulple ineraces, bu i can exend only one absrac class.
- SringBuilder is no synchronized (no hread-sae), making i more ecien or single-hreaded operaons.
- SringBuer is synchronized (hread-sae), suiable or mulhreaded operaons.
- Boh classes provide similar unconaliy or manipulang srings.
- An array is a xed-size daa srucure, while an ArrayLis is a dynamic array-like daa srucure ha can grow or shrink
as needed.
- Arrays use square brackes ([]), and ArrayLis is par o he Java Collecons Framework.
- In Java, you can creae a dynamic array using daa srucures like ArrayLis or LinkedLis.
For Example:
impor java.ul.ArrayLis;
dynamicArray.add(1);
dynamicArray.add(2);
dynamicArray.add(3);
- No, you canno creae objecs direcly rom ineraces. However, you can creae objecs o classes ha implemen he
inerace.
- Sarng rom Java 8, you can wrie non-absrac mehods in an inerace using he deaul and sac keywords.
- Deaul mehods have implemenaons in he inerace, and hey can be inheried by classes ha implemen he
inerace.
-
30.Can we execue mulple cach blocks wihou ry, and will i give a compile-me error?
- No, you canno have mulple cach blocks wihou a preceding ry block.
- The ry block is essenal or excepon handling in Java.
- I is used o enclose he code ha may hrow excepons, and cach blocks are used o handle specic excepons.
- Wihou he ry block, he cach blocks have no conex, and he code will no compile.
- Serializaon is achieved by implemenng he Serializable inerace in a class, and hen using ObjecOupuSream o
wrie he objec o a le or sream.
- Deserializaon is done using ObjecInpuSream o read he objec rom he le or sream.
Here's an example:
// Serializaon
oupuSream.wrieObjec(objecToSerialize);
oupuSream.close();
// Deserializaon
inpuSream.close();
- I you declare he main mehod as privae, he Java Virual Machine (JVM) will no be able o access i, and you won'
be able o run your Java program.
- The main mehod mus be declared as public o serve as he enry poin or your applicaon.
- To check i an array is empy, you can use array.lengh == 0. To check i an array is null, use array == null.
Here's an example:
i (arr == null) {
} else i (arr.lengh == 0) {
} else {
- The Java Lis inerace is par o he Java Collecons Framework and provides a collecon ha holds elemens in a
sequence.
- Common implemenng classes include ArrayLis, LinkedLis, Vecor, and Sack.
For example:
public MyClass() {
Here's an example:
map.pu("one", 1);
map.pu("wo", 2);
in value = map.ge("wo"); // Rerieves he value associaed wih he key "wo"
- HashMap is used or key-value mapping, while HashSe is used or soring unique elemens.
- HashMap sores key-value pairs, whereas HashSe sores individual elemens wihou duplicaes.
38.Where did you use HashMap in your projec, and also OOPs conceps in your Auomaon Framework?
- you can use HashMap in various siuaons, such as caching, conguraon managemen, and managing key-value
pairs.
- Objec-Oriened Programming (OOP) conceps are ofen used in sofware developmen or creang modular and
mainainable code, including conceps like inheriance, polymorphism, encapsulaon, and absracon.
- Access modiers conrol he visibiliy and accessibiliy o classes, elds, mehods, and consrucors in Java.
- A hread is he smalles uni o a process ha can run concurrenly in a program.
- In Java, you can creae and manage hreads using he Thread class or he Runnable inerace.
- Threads are used or concurren execuon and parallel processing.
- A singleon class is a class ha allows only one insance o isel o be creaed.
- I ofen includes a privae consrucor and a mehod o ge he insance.
- This ensures ha here's only one insance o he class hroughou he program.
- A sac variable belongs o he class raher han o any specic insance.
- You can se he value o a sac variable by direcly reerencing he class name and using he assignmen operaor,
or example:
- Yes, you can overload privae mehods in Java as long as hey are wihin he same class.
- Overloading is based on he mehod's parameer lis, and access modiers do no aec overloading.
- No, i’s no possible o exend a nal class in Java. A nal class canno be subclassed.
- Yes, i's possible o overload he main mehod by dening mulple main mehods wih dieren parameer liss.
- However, only he sandard public sac void main(Sring[] args) mehod is used as he enry poin or he Java
applicaon.
- In Java, inerace elds are implicily public, sac, and nal, and hey mus be inialized when declared.
- You can' inialize hem laer in he implemenng class.
- Java does no suppor mulple inheriance or classes. However, i suppors mulple inheriance or ineraces.
- I mulple inheriance or classes were possible, i could lead o he "diamond problem," where ambiguiy arises i a
class inheris rom wo classes wih he same mehod names.
- Java avoids his issue by allowing mulple inheriance hrough ineraces only.
- Overloading: I involves dening mulple mehods in he same class wih he same name bu dieren parameer
liss. Overloaded mehods have he same name bu dieren signaures.
- Overriding: I occurs when a subclass provides a specic implemenaon or a mehod dened in is superclass. The
mehod in he subclass has he same name, reurn ype, and parameer lis.
- Encapsulaon: Encapsulaon is he concep o wrapping daa (aribues) and he code (mehods) ha operaes on
ha daa ino a single uni, known as a class. I hides he inernal sae o an objec and provides conrolled access via
access modiers.
- Absracon: Absracon is he process o simpliying complex realiy by modeling classes based on heir essenal
characeriscs. I hides he complex implemenaon deails and ocuses on dening a clear inerace or conrac.
57.Wha is polymorphism?
- Ineraces in Java are used o dene a conrac o mehods ha implemenng classes mus adhere o.
- They are useul when you wan o ensure ha mulple classes provide specic unconalies while allowing or
exibiliy in he implemenaon.
- Ineraces suppor mulple inheriance in Java, as a class can implemen mulple ineraces.
- Yes, you can overload he main mehod in Java by providing dieren parameer liss.
- However, only he sandard public sac void main(Sring[] args) mehod is recognized as he enry poin or your
applicaon.
- Consrucors canno be overridden in Java. Consrucors are no inheried and canno be called by subclasses.
- Polymorphism is used in various siuaons, including mehod overriding, dynamic mehod dispach, and designing
generic and exensible code.
- I allows you o work wih objecs o dieren classes hrough a common inerace or superclass.
64.Why do we use nally, and how does i dier rom he nal keyword?
- The nally block is used in excepon handling o ensure ha a cerain block o code is always execued, wheher an
excepon is hrown or no.
- I's unrelaed o he nal keyword, which is used or declaring consans and making classes, mehods, or variables
unmodiable.
65.Can we use mulple cach blocks? When can we use mulple cach blocks?
- Yes, you can use mulple cach blocks in a ry-cach saemen o handle dieren ypes o excepons.
- The cach blocks are evaluaed in order, and he rs maching block is execued.
- Apache POI and JXL are Java libraries used or working wih Excel les.
- POI is more eaure-rich, supporng boh reading and wring Excel les (XLS and XLSX), while JXL primarily suppors
reading older Excel les (XLS).
- To preven a mehod rom being overridden in a subclass, mark he mehod wih he nal keyword.
- This prevens subclasses rom providing heir implemenaons or ha mehod.
- The main mehod is sac because i needs o be accessible and called wihou creang an insance o he class.
- I serves as he enry poin or he Java applicaon, and sac mehods can be called using he class name.
- Objec creaon is no possible in absrac classes because absrac classes are incomplee and mean o be
subclassed.
- They can conain absrac mehods ha have no implemenaon.
- To creae an objec, you need a concree class ha provides implemenaons or all mehods.
- Design paerns in Java are esablished soluons o common sofware design problems.
- Some popular design paerns include Singleon, Facory, Observer, Sraegy, and Decoraor, among ohers.
- These paerns provide reusable and mainainable soluons o common archiecural and design challenges.
- All classes in he Java Collecon Framework implemen he java.ul.Collecon inerace.
- This inerace denes a common se o mehods or working wih collecons, such as add, remove, size, and ieraor.
- Absracon and ineraces are undamenal conceps in sofware design ha promoe modular, mainainable, and
loosely coupled code:
- Absracon is he process o simpliying complex sysems by modeling classes based on heir essenal characeriscs.
In objec-oriened programming (OOP), absracon involves dening classes ha capure he mos crical aribues
and behaviors o real-world objecs, while hiding unnecessary deails.
- Ineraces are a key ool or achieving absracon in Java. They dene a conrac or a se o mehods wihou
providing heir implemenaons. This conrac allows dieren classes o provide heir own implemenaons while
adhering o he same inerace. I promoes code consisency and suppors polymorphism.
- Loosely Coupled code is modular and has minimal dependencies beween is componens. Each module or class
operaes independenly, and changes in one module do no require changes in many oher modules. Loosely coupled
code is more exible and easier o mainain.
- Tighly Coupled code has srong dependencies beween is componens. Changes in one componen can have a
cascading eec on many oher componens, making he code less exible and harder o mainain.
For example, le's say you have a NotcatonService inerace wih mehods like sendEmail and sendSMS. Multple classes can
implemen his inerace, providing dieren ways o send notcatons (e.g., hrough email, SMS, or a mobile app). Classes
ha need o send notcatons depend on he inerace, no he specic implemenaton, making he sysem more fexible and
less tghly coupled.
- Loose coupling is a key principle in achieving mainainable and exensible sofware, and absracon hrough
ineraces is a powerul echnique o help achieve his goal.
- Java provides a deaul (no-argumen) consrucor or a class only i you haven' explicily dened any consrucors or
ha class.
- I you provide any consrucor (wih or wihou argumens) in your class, Java will no creae a deaul consrucor or
you.
79.Dierence beween ArrayLis and LinkedLis, and in which siuaons hey are used?
- ArrayLis:
1- Implemens a dynamic array.
2- Provides as random access (O(1)) and slower inseron/deleon (O(n) or shifing elemens).
3- Suiable when you need as access and less requen inserons/deleons.
- LinkedLis:
1- Implemens a doubly-linked lis.
2- Provides as inseron/deleon (O(1)) and slower random access (O(n)).
3- Suiable when you need requen inserons/deleons and don' require as random access.
Choose beween ArrayLis and LinkedLis based on your specic use case and he ype o operatons you'll be perorming
requenly.
80.Dierence beween Lis<Sring> lis = new ArrayLis<Sring>() and ArrayLis<Sring> lis = new ArrayLis<Sring>()?
- Lis<Sring> lis = new ArrayLis<Sring>() uses he inerace Lis o reerence an ArrayLis.
- This is ofen recommended because i allows or exibiliy in case you wan o change he implemenaon o anoher
Lis implemenaon (e.g., LinkedLis) wihou modiying your code signicanly.
- ArrayLis<Sring> lis = new ArrayLis<Sring>() explicily uses he ArrayLis class o reerence an ArrayLis.
- This binds your code o he specic implemenaon, which may no be as exible i you decide o change o a
dieren lis ype laer.
- HashMap is a daa srucure in Java ha sores key-value pairs, where each key maps o a single value.
- MulMap, on he oher hand, is no par o he Java sandard library.
- I ypically reers o a daa srucure ha allows one key o map o mulple values.
- Libraries like Apache Commons Collecons provide a MulMap implemenaon.
- In a MulMap, you can associae mulple values wih a single key.
Sac Mehod:
- Use sac mehods when he behavior o he mehod is no dependen on he sae o he insance (i.e., i doesn'
access insance-specic daa).
- Use sac mehods or uliy mehods, consans, or mehods ha can be invoked using he class name wihou
creang an insance.
Non-Sac Mehod:
- Use non-sac (insance) mehods when he behavior o he mehod depends on he sae or elds o an insance.
- Use non-sac mehods or operaons specic o individual objecs or when he mehod needs access o insance
daa.
When you wan o rerieve a value by key, he key is hashed again, and he index is calculaed. The HashMap navigaes o ha
index and searches he linked lis or ree (i needed) o nd he maching key and reurn he associaed value.
84.I you have a class and an absrac class, and he class has a user-dened consrucor and a main mehod, which one will
ge execued rs?
- In Java, when you run a program, he main mehod is he enry poin o he applicaon.
- I will be execued rs. Consrucors are called when you creae an insance o a class, bu he main mehod is he
sarng poin or your program.
- POJO sands or "Plain Old Java Objec." I reers o a Java class ha adheres o simple convenons: i has privae
elds, public geer and seer mehods, and oponal consrucors.
- POJOs are used or simpliciy, ease o mainenance, and o represen daa in a clean and sandardized way.
- They are ofen used or daa sorage and ranser, especially in rameworks like JavaBeans, Hibernae, or Spring.
86.Class A has 3 mehods, Class B has 2 mehods, and Class B inheris rom Class A. How do you call a mehod o Class A by
creang an objec o Class B?
- I Class B inheris rom Class A, you can creae an objec o Class B and call he mehods o Class A using he objec o
Class B. This is achieved hrough inheriance.
For example:
API
Queson 1: Dierence beween REST and SOAPUI?
- REST (Represenaonal Sae Transer) and SOAPUI (Simple Objec Access Proocol User Inerace) are wo dieren
approaches or designing web services.
- REST is an exile and rapid archiecural syle ha uses sandard HTTP mehods and is ypically based on resources
and allow daa exchange in mulple ormas such as JSON (JavaScript Object Notation)
- SOAP is highly srucured approach or API design which using XML(Extensible Markup Language) daa orma.
- SOAPUI is a ool used or esng SOAP-based web services.
- Posman can be inegraed ino a projec by creang collecons o API requess, organizing hem, and sharing hem
wih eam members.
- You can impor/expor collecons and use Posman's eaures or auomaed esng and monioring.
For example, you can use environmen variables o sore and reuse values rom one reques o anoher.
Queson 6: How do you capure specic response values and pass hem o oher requess in Posman?
- In Posman, you can capure specic response values by using JavaScrip ess and se hem as variables o use in
subsequen requess.
- Challenges in API esng can include handling auhencaon, managing dynamic daa, esng dieren reques
mehods, and ensuring securiy.
For example, logging ino a sysem is auhencaon, and accessing specic resources wihin ha sysem is auhorizaon.
Queson 9: Wha are some common HTTP saus codes you have come across in API esng?
Queson 10: Wha's he dierence beween OAuh 1.0 and OAuh 2.0, when and where do you use hem, and can you
provide a sample code or OAuh 2.0?
- OAuh 1.0 and OAuh 2.0 are dieren versions o he OAuh proocol.
- OAuh 2.0 is more widely used and oers improvemens in securiy and simpliciy.
Queson 11: How do you ge a response rom one API and send i o anoher API?
- You can achieve his by exracng daa rom he response o one API reques in Posman and hen using ha daa as
variables in subsequen requess.
- This is ofen done using Posman's scripng capabilies.
- TesNG is imporan or es auomaon because i provides a powerul ramework or wring and running es cases.
- I allows you o dene es suies, run ess in parallel, and provides deailed reporng.
- TesNG is used or is exibiliy and eaures like es grouping, parallel es execuon, and comprehensive reporng.
- TesNG XML les are used o congure and organize es suies, se parameers, and dene es dependencies.
- You can use he @DaaProvider and invocaonCoun aribues o run he same es mehod wih he same daa
mulple mes.
Here's an example:
@Tes(daaProvider = "daa-provider")
@DaaProvider(name = "daa-provider")
reurn daa;}
6.Wha is he reporng ool in your ramework, and why do you use i?
- Reporng ools like ExenRepors or Allure are ofen used in conjuncon wih TesNG o generae deailed and user-
riendly es repors.
- These ools make i easier o undersand es resuls.
- @Tes,
- @BeoreMehod,
- @AferMehod,
- @BeoreTes,
- @AferTes,
- @BeoreClass,
- @AferClass,
- @BeoreSuie,
- @AferSuie.
- Tess are congured in TesNG XML les where you dene suies, ess, classes, mehods, parameers, and daa
providers.
Here's an example:
@DaaProvider(name = "daa-provider")
{"Daa1", "Resul1"},
{"Daa2", "Resul2"},
};
For example, i you have a es class MyTes and you wan o run i wih dieren daa ses, you can creae a acory
mehod o insanae i mulple mes wih dieren daa.
- By deaul, TesNG runs es mehods in lexicographic order (i.e., he order in which hey appear in he class).
- You can use prioriy aribues, such as @Tes(prioriy = 1), o conrol he execuon order.
- To add or remove es cases in a TesNG XML le, you can simply edi he XML le direcly.
- Add or remove <class> or <mehod> elemens wihin he <es> ags o include or exclude es cases.
- @BeoreSuie
- @BeoreTes
- @BeoreGroups
- @BeoreClass
- @BeoreMehod
- @Tes
- @AferMehod
- @AferClass
- @AferGroups
- @AferTes
- @AferSuie
- You can achieve parallel execuon in TesNG by setng he parallel aribue in he TesNG XML le.
For example:
16.Ou o 50 es cases, how do you run only he ailed es cases?
- You can rerun ailed es cases by using TesNG's IInvokedMehodLisener and TesNG's IAnnoaonTransormer
- You would need o implemen cusom logic o ideny and rerun ailed ess.
17.How can you ake a screensho or he ailed es cases?
- You can capure screenshos or ailed es cases by implemenng a cusom lisener ha uses Selenium WebDriver's
screensho capabilies.
- When a es ails, he lisener can capure he screensho and save i.
- You can use he invocaonCoun aribue in TesNG o run he same es mehod mulple mes. For example:
@Tes(invocaonCoun = 10)
- TesNG suppors parallel execuon o ess by using he parallel aribue in he XML le.
- Grouping is a way o caegorize and run ess ha belong o specic groups.
- @AferSuie runs afer all es suies in he XML le have compleed,
- @BeoreSuie runs beore any es suies sar.
- TesNG XML les are used or conguraon, grouping o es cases, parallel execuon, and speciying es
dependencies.
23.How many suies can be here in TesNG, and wha happens i you run all he suies?
To run mehods in parallel, you can se he parallel aribue in your suie XML le like his:
24.Can you have mulple suies in one XML le, and wha i you wan o run all suies?
- invocaonCoun species how many mes a es mehod should be invoked or run.
- The Background keyword in Cucumber is used o dene a se o seps ha are common o mulple scenarios.
- These seps are execued beore each scenario.
@RunWih(Cucumber.class)
@CucumberOpons(
eaures = "src/es/resources/eaures",
glue = "com.example.seps"
- You can run dieren combinaons o Cucumber ags by speciying hem in he es runner class or using he
command line wih --ags.
- Hooks are blocks o code ha run beore or afer each scenario.
- Tags are used o caegorize and ler scenarios or execuon based on specic crieria.
Maven
Queson 1: Liecycle o Maven
- The Maven liecycle consiss o a sequence o phases ha dene he build process.
- The deaul liecycle includes phases like compile, es, package, insall, and deploy.
- Developers can bind heir goals o hese phases in he pom.xml le o auomae he build process.
Example:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<aracId>maven-compiler-plugin</aracId>
<version>3.8.1</version>
<conguraon>
<source>1.8</source>
<arge>1.8</arge>
</conguraon>
</plugin>
</plugins>
</build>
Example:
<build>
<plugins>
<groupId>org.apache.maven.plugins</groupId>
<aracId>maven-surere-plugin</aracId>
<version>2.22.0</version>
<conguraon>
<includes>
<include>**/*Tes.java</include>
</includes>
</conguraon>
</plugin>
</plugins> </build>
- The pom.xml (Projec Objec Model) is a undamenal conguraon le in a Maven projec.
- I denes he projec's srucure, dependencies, build process, and plugins. I's used o manage he projec's build and
dependencies.
Example:
<projec>
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<aracId>my-projec</aracId>
<version>1.0.0</version>
</projec>
- Connuous Inegraon (CI) and Connuous Deploymen (CD) ools auomae he build, es, and deploymen
processes.
- Jenkins is an open-source auomaon server used or building, esng, and deploying code.
- I provides a way o auomae sofware developmen and is ofen used in CI/CD pipelines.
- Maven handles dependencies a runme by downloading he required libraries and resources rom reposiories
specied in he pom.xml le.
- These dependencies are eched rom cenral reposiories and cached locally.
- I someone delees dependencies rom he pom.xml le, you won' be able o execue ess or he missing
dependencies.
- I's crucial o keep he pom.xml le up o dae o ensure all required dependencies are available.
- You can use Maven proles o dene environmen-specic conguraons and pass dieren daa or each
environmen. Proles are dened in he pom.xml le.
Example:
<proles>
<prole>
<id>qa</id>
<properes>
<environmen>qa</environmen>
</properes>
</prole>
<prole>
<id>preproducon</id>
<properes>
<environmen>preproducon</environmen>
</properes>
</prole>
</proles>
- To congure a Jenkins job, you need o creae a new job, speciy he build seps, se build riggers (e.g., SCM changes),
and congure pos-build acons (e.g., es repors and deploymens).
- Jenkins is inegraed wih various ools and services, including version conrol sysems (e.g., Gi), build ools (e.g.,
Maven), and deploymen plaorms (e.g., Docker, AWS).
- Jenkins allows you o schedule deploymens by conguring build jobs o run a specic mes or in response o evens
like code commis.
- Version conrol ools like Gi are used o rack and manage changes o source code.
- They provide version hisory, collaboraon, and code inegriy.
- gi ini,
- gi clone,
- gi add,
- gi commi,
- gi push,
- gi pull,
- and gi merge.
- Jenkins is used in auomaon or building, esng, and deploying applicaons in connuous inegraon and
connuous deploymen (CI/CD) pipelines.
- I auomaes he developmen and deploymen processes.
Agile
Queson 1: Wha is an Agile Mehodology?
- Sprin Planning: The eam plans he work or he upcoming sprin.
- Daily Sandup: A brie daily meeng or eam members o discuss progress and obsacles.
- Sprin Review: A demo o he compleed work in he sprin.
- Sprin Rerospecve: A meeng o reec on wha wen well and wha could be improved.
- A rerospecve meeng, held a he end o each sprin, is an Agile ceremony or he eam o reec on heir work.
- The goal is o ideny wha wen well and wha could be improved in he nex sprin.
- The eam discusses processes, communicaon, and acons o ake or improvemen.
- Scrum ceremonies include Sprin Planning, Daily Sandup, Sprin Review, and Sprin Rerospecve.
- These meengs provide a srucured ramework or planning, communicaon, and improvemen in Agile projecs.
- In Agile, auomaon should ideally be par o he Denion o Done (DoD) or user sories.
- Tes auomaon should be done in he same sprin as he developmen.
- However, i auomaon work is subsanal, i migh spill over o he nex sprin bu should be a prioriy.
- Velociy is a measure o he amoun o work a Scrum eam can complee in a sprin.
- I's usually represened in sory poins or ideal days.
- Velociy helps in predicng how much work can be done in uure sprins and is used or sprin planning.
- A backlog in Scrum is a priorized lis o user sories and asks ha need o be developed in uure sprins.
- I includes he Produc Backlog (long-erm goals) and he Sprin Backlog (work o be done in he curren sprin).
Queson 10: Designing and Running Tes Scrips in a Release wih 30+ Sprins
- In a long release wih many sprins, i's essenal o mainain es scrip version conrol and auomaon inrasrucure.
- Tes scrips should be organized, modular, and well-documened.
- Tes execuon should align wih sprin goals, and regression esng should be auomaed o ensure previous
unconaliy remains inac.
Queson 11: Wha dierence beween burn up and burn down in agile?
In Agile projec managemen, "burn up" and "burn down" chars are used o rack he progress o work in a visual manner.
Boh chars are helpul in monioring he compleon o work iems, bu hey represen he daa in dieren ways.
Here are he key dierences beween "burn up" and "burn down" chars in Agile:
2. Focus:
- Burn Down Char: A burn down char ocuses on how much work is remaining and wheher he eam is on rack o
complee he scope by he end o he sprin or release. I helps in idenying scope changes, delays, or overages.
- Burn Up Char: A burn up char ocuses on how much work has been compleed, giving a clear view o he progress
oward ullling he projec's scope. I helps in undersanding he cumulave eor expended.
3. Scope Changes:
- Burn Down Char: In a burn down char, scope changes or he addion o new work can make i more challenging o
assess progress, as i doesn' inherenly show he eec o scope changes.
- Burn Up Char: A burn up char handles scope changes more graceully, as i connues o show he progress made
despie scope changes.
4. Ease o Use:
- Burn Down Char: Burn down chars are ofen simpler o creae and inerpre because hey ocus on a single meric –
he remaining work.
- Burn Up Char: Burn up chars are slighly more complex o consruc and undersand, as hey represen boh
compleed work and poenally scope changes.
Funconal Tesng:
Queson 1: Wha is a Tes Plan?
A es plan is a comprehensive documen ha oulines he approach, scope, resources, schedule, and deliverables or a
esng projec. I denes he es objecves, sraegies, enry and exi crieria, and es deliverables.
- The bug lie cycle consiss o sages such as "New," "Assigned," "Open," "Fixed," "Veried," and "Closed."
- A bug sars in he “New” sae when repored, goes hrough vericaon, and is closed when i’s resolved. Each sae
has specic acons and responsibilies.
- Smoke Tesng: Smoke ess ensure ha he crical unconalies o he sofware are working beore urher esng.
I’s a broad es o check i he applicaon can be considered or more in-deph esng.
- Saniy Tesng: Saniy ess ocus on specic areas or componens o he sofware o veriy ha parcular changes or
xes have no adversely impaced relaed unconaliy.
- Regression Tesng: Regression esng is perormed o ensure ha new code changes have no aeced exisng
unconaliy. I involves reesng exisng es cases and running new ones.
- Reesng: Reesng ocuses on esng he specic deecs ha were ound and xed. I ensures ha he repored
issues are resolved and do no reoccur.
- Funconal Tesng: Funconal esng veries wheher he sofware's eaures and uncons work according o
specicaons. I is perormed o validae ha he sofware mees is unconal requiremens.
- Regression Tesng: Regression esng is aimed a checking wheher new code changes have inroduced new deecs
or caused exisng unconaliy o break.
- Severiy: Severiy indicaes he impac o a deec on he sysem's unconaliy. I caegorizes deecs based on how
severely hey aec he applicaon, e.g., "Crical," "Major," "Minor."
- Prioriy: Prioriy deermines he order in which deecs should be xed. I's based on business or projec needs and
may be caegorized as "High," "Medium," or "Low."
- Tes Plan: A es plan is a deailed documen ha oulines how esng will be conduced or a specic projec. I
includes objecves, scope, schedules, and es cases.
- Tes Sraegy: A es sraegy is a higher-level documen ha denes he approach o esng across mulple projecs.
I ses guidelines or how esng should be done in an organizaon.
- Boundary Value Analysis: Boundary Value Analysis ocuses on esng he values a he boundaries o accepable inpu
ranges. I ess or issues ha ofen occur a he edges, such as minimum and maximum values.
- Equivalence Paroning: Equivalence Paroning divides he inpu domain ino groups or parons and ess a
represenave value rom each paron. I helps reduce he number o es cases while ensuring adequae coverage.
- Whie Box Tesng: Whie box esng examines he inernal srucure and code o he sofware. Tesers need
knowledge o he sysem's archiecure and use his inormaon o design es cases.
- Black Box Tesng: Black box esng ocuses on he unconaliy o he sofware wihou knowledge o is inernal
code. Tesers validae he sofware based on is specicaons and behavior.
- For auomaon esng o 1000 es cases, i's crucial o priorize and selec es cases based on cricaliy and
coverage. I's also imporan o design modular and mainainable es scrips. You can use es auomaon
rameworks like TesNG or JUni and design mehods ha reurn mulple values using daa srucures like liss, maps,
or cusom objecs.
- The bug lie cycle consiss o various saes like "New," "Assigned," "Open," "Fixed," "Veried," and "Closed." Each
sae represens he bug's saus and he acons aken by he developmen and esng eams. The bug progresses
hrough hese saes unl i's closed.
- Bug riage is a process where a cross-unconal eam, including developers and esers, evaluaes newly repored
bugs.
- The eam priorizes and assigns he bugs based on heir severiy and impac on he projec. This process helps in
ecienly managing bug repors.
- Exploraory esng is an approach where esers simulaneously design and execue es cases based on heir
inuion, experience, and domain knowledge.
- I's ofen unscriped and aims o nd deecs in an exploraory manner.
- Ad-hoc esng is an inormal and unsrucured esng approach where esers explore he sofware wihou
predened es cases. Tesers randomly inerac wih he applicaon o nd deecs and issues.
- Build Accepance Tesng, also known as Smoke Tesng, is perormed on a new build or release o veriy ha he mos
crical unconalies work correcly. I ensures ha he build is sable enough or urher esng.
- Validaon: Validaon checks wheher he sofware mees he user's requiremens and is or is inended purpose.
I answers he queson, "Are we building he righ produc?"
- Vericaon: Vericaon ensures ha he sofware conorms o is specicaons and requiremens. I answers he
queson, "Are we building he produc righ?"
Queson 17: Explain Severiy and Prioriy, High Severiy wih Low Prioriy, Low Severiy and High Prioriy
- Severiy: Severiy indicaes he impac o a deec on he sysem. High severiy means he deec has a signican
impac.
- Prioriy: Prioriy deermines when a deec should be addressed. High prioriy means he deec should be xed
urgenly.
- High Severiy wih Low Prioriy: This means he deec has a signican impac on he sysem, bu i's no considered a
op prioriy or immediae xing.
- Low Severiy and High Prioriy: This means he deec has a low impac on he sysem bu needs o be addressed
urgenly.
Queson 18: Sequence o Execuon or Tes Cases wih Priories o -1, 0, 1, 2
- Inner Join: An inner join in SQL reurns only he rows ha have maching values in boh ables being joined. I
excludes non-maching rows rom he resul se.
- Ouer Join: An ouer join reurns all rows rom one able and he maching rows rom he oher able. I includes non-
maching rows wih NULL values in columns rom he non-maching able.
- DELETE: DELETE is used o remove specic rows rom a able based on a condion. I preserves he able srucure.
- DROP: DROP is used o delee an enre able or daabase, removing is srucure and daa.
- TRUNCATE: TRUNCATE is used o delee all rows rom a able, bu i mainains he able's srucure. I's aser han
DELETE bu canno be used wih condions.
- Tes design echniques are mehods used o creae es cases and deermine he es daa.
- Common echniques include Equivalence Paroning, Boundary Value Analysis, Decision Table Tesng, Sae
Transion Tesng, and more.
- These echniques help ensure eecve es coverage.
- A deerred bug is a bug ha is no xed immediaely bu is scheduled or a laer release or sprin.
- I's usually a low-prioriy issue ha doesn' impac he curren projec's goals.
- Tess are seleced or auomaon based on crieria like repeaabiliy, sabiliy, and he need or regression esng.
- High-prioriy, high-impac, and requenly execued ess are good candidaes or auomaon.
Queson 25: How o Reduce Tes Execuon Time or a 1.5-Hour Tes Suie?
- To reduce es execuon me, consider parallel es execuon, selecve es suie execuon, opmizing es scrips,
and using ecien es rameworks.
- Achievemens in auomaon may include improving es coverage, reducing es execuon me, enhancing es daa
managemen, or successully implemenng es rameworks.
- BDD (Behavior-Driven Developmen): BDD is a sofware developmen mehodology ha ocuses on he behavior o
he applicaon rom he user's perspecve. I uses naural language descripons and scenarios o dene applicaon
behavior.
- TDD (Tes-Driven Developmen): TDD is a developmen process ha emphasizes wring ess beore wring code. I
helps ensure ha he code mees is requiremens and is esable.
- Inbound Tesng: Inbound esng reers o esng acvies conduced o validae daa or componens coming ino a
sysem. I ensures ha daa is acceped and processed correcly.
- Oubound Tesng: Oubound esng involves veriying daa or componens leaving a sysem. I ensures ha daa is
generaed or ransmied accuraely.
- Smoke Tesng: Smoke esng veries ha he crical unconalies o he sofware are working afer a new build or
release. I's an inial check o ensure he sofware is sable enough or urher esng.
- Regression Tesng: Regression esng is perormed o ensure ha new code changes have no adversely aeced
exisng unconaliy. I includes reesng exisng es cases.
- Saniy Tesng: Saniy esng is a subse o regression esng ha ocuses on specic areas or eaures o ensure hey
sll work afer code changes. I checks i recen xes or changes have no broken relaed unconaliy.
- I a developer rejecs an open deec, i ypically goes hrough he ollowing seps:
- The deec repor is reviewed by he developer and he eser.
- I i's deermined ha he deec is no valid or requires urher claricaon, i's marked as "Rejeced."
- I i's valid, he deec is assigned back o he developer or correcon.
- The developer xes he deec, and i goes hrough reesng.
- I he deec is reesed successully, i is marked as "Closed." I no, i goes hrough he bug lie cycle again.
- Tess are priorized based on acors like business requiremens, cricaliy, risk, dependencies, and cusomer needs.
- High-prioriy ess are execued rs, ollowed by medium and low-prioriy ess.
- Auomaon code review or walk-hrough is a process where auomaon scrips are reviewed by peers or expers o
ensure hey ollow coding sandards, are mainainable, and ree rom errors.
- I's done o improve scrip qualiy.
- Smoke ess should be he mos crical and sable es cases, ensuring basic unconaliy.
- Saniy ess should cover core unconalies o veriy ha recen code changes haven' aeced hem.
- Regression ess should include a comprehensive se o es cases covering boh new and exisng unconaliy.
The ming o execung hese ess can vary based on he projec's needs:
- Smoke ess are execued afer a new build or release o ensure basic unconaliy.
- Saniy ess are run o veriy specic changes or eaures, ypically in conjuncon wih new code.
- Regression ess are execued afer every code change o ensure ha exisng unconaliy is unaeced.
- Tess o auomae are seleced based on crieria such as requency o execuon, repeaabiliy, cricaliy, and sabiliy.
- High-prioriy, high-impac, and requenly execued ess are suiable candidaes or auomaon.
Perormance Tesng
Perormance esng is he process o esng a sysem or applicaon o measure is perormance
The purpose o perormance esng is o ideny any bolenecks or perormance issues in he
sysem, so ha hey can be addressed beore he sysem goes live.
The ypes o perormance esng include load esng, sress esng, endurance esng, spike esng,
Load esng is a ype o perormance esng ha measures he perormance o a sysem under a
Sress esng is a ype o perormance esng ha measures he perormance o a sysem under
Endurance esng is a ype o perormance esng ha measures he perormance o a sysem under
Spike esng is a ype o perormance esng ha measures he perormance o a sysem when here
Scalabiliy esng is a ype o perormance esng ha measures how well a sysem can handle
A perormance es plan is a documen ha oulines he goals, scope, and approach o a
A perormance es scrip is a program ha simulaes user behavior o es he perormance o a
sysem.
A virual user is a sofware program ha simulaes a user ineracng wih a sysem, and is used in
A boleneck is a poin in a sysem where he perormance is limied by a resource consrain, such as
You can ideny a boleneck by monioring he sysem during a perormance es and looking or
Throughpu is he amoun o work ha a sysem can process in a given amoun o me, and is ofen
Response me is he me i akes or a sysem o respond o a user reques, and is ofen measured
in milliseconds.
Laency is he delay beween when a user sends a reques and when hey receive a response, and is
Throughpu measures he amoun o work a sysem can do, while response me measures how
The goal o perormance esng is o ensure ha a sysem can handle he expeced workload and
Some common perormance esng ools include JMeer, LoadRunner, Galing, and BlazeMeer.
A perormance baseline is a benchmark ha represens he expeced perormance o a sysem under
normal condions.
The purpose o a perormance baseline is o provide a reerence poin or uure perormance
Perormance uning is he process o opmizing a sysem or applicaon o improve is perormance.
Some common perormance uning echniques include opmizing code, improving daabase
A perormance issue is any problem ha impacs he perormance o a sysem, such as slow
To diagnose a perormance issue, you can use perormance monioring ools o ideny any
A perormance es repor is a documen ha summarizes he resuls o a perormance esng
projec, including any issues ha were idened and recommendaons or improvemen.
A perormance dashboard is a real-me display o key perormance merics or a sysem, such as
A perormance hreshold is a predened limi or a perormance meric, such as response me or
A load balancer is a device or sofware program ha disribues incoming nework rac across
A load balancer works by disribung incoming nework rac across mulple servers based on
A disribued sysem is a nework o compuers ha work ogeher o provide a single sysem or
service.
33. Wha are some common challenges in perormance esng disribued sysems?
Some common challenges in perormance esng disribued sysems include nework laency, daa
perormance esng.
Some consideraons when setng up a perormance esng environmen include ensuring ha he
environmen is represenave o he producon environmen, and ha i has enough resources o
36. Wha is he dierence beween sress esng and load esng?
Sress esng measures he perormance o a sysem under exreme condions, while load esng
37. Wha is he dierence beween a load es and a soak es?
A load es measures he perormance o a sysem under a specic load, while a soak es measures
he perormance o a sysem over a prolonged period o me o ideny any issues wih long-erm
usage.
A warm-up period is a period o me a he beginning o a perormance es during which he
sysem is allowed o sabilize and reach a seady sae beore he acual es begins.
An SLA (Service Level Agreemen) is a conrac beween a service provider and a cusomer ha
An SLO (Service Level Objecve) is a measurable arge ha is se or a specic service level meric,
An SLI (Service Level Indicaor) is a measurable meric ha is used o rack he perormance o a
A perormance budge is a predened limi or perormance merics, such as response me or page
load me, ha are used o ensure ha a sysem mees he perormance requiremens o he
business.
Perormance esng in Agile developmen is he process o incorporang perormance esng ino
he Agile developmen liecycle o ensure ha perormance issues are idened early and can be
addressed quickly.
Some common ools used in perormance esng include Apache JMeer, LoadRunner, Galing, and
Selenium.
45. Wha is he dierence beween a perormance es plan and a es sraegy?
A perormance es plan is a deailed documen ha oulines he specic ess ha will be
perormed, while a es sraegy is a higher-level documen ha oulines he overall approach o
Some common perormance esng merics include response me, hroughpu, error rae, and
concurrency.
A baseline in perormance esng is a se o perormance merics ha represen he normal
A spike es is a ype o perormance es ha measures he abiliy o a sysem o handle sudden
A ramp-up period is a period o me during a perormance es during which he workload is
Some bes pracces or perormance esng include sarng wih a clear undersanding o he
business requiremens, using realisc daa and scenarios, and involving sakeholders hroughou he
A perormance es plan is a documen ha oulines he approach, objecves, scope, resources, and
Scalabiliy esng is a ype o perormance esng ha measures he abiliy o a sysem o handle
A load es scenario is a combinaon o user behavior, es daa, and workload parameers ha are
A es bed is he hardware, sofware, and nework inrasrucure ha is used o run perormance
ess.
A perormance boleneck is a componen in he sysem ha limis is abiliy o handle a specic
A perormance esng ramework is a se o ools, mehodologies, and bes pracces ha are used
A soak es is a ype o perormance es ha measures he perormance o a sysem over a
A sress es is a ype o perormance es ha measures he perormance o a sysem under exreme
A virual user is a simulaed user ha is used in perormance esng o simulae realisc user
Throughpu is he number o requess or ransacons ha a sysem can handle per uni o me,
A ransacon is a sequence o acons or operaons ha represens a complee uni o work, such as
User load is he number o simulaneous users or virual users ha are accessing he sysem during a
perormance es.
Daabase perormance uning is he process o opmizing daabase queries, indexes, and setngs o
Nework laency is he delay beween when a reques is sen rom a clien o a server and when he
response is received, caused by he me i akes or daa o ravel across he nework.
Page load me is he me i akes or a web page o ully load in a user's browser, including all
66. Wha is he dierence beween a perormance es and a load es?
A perormance es measures he perormance o a sysem under a specic se o condions, while a
load es measures he perormance o a sysem under varying user loads.
A ramp-down period is a period o me a he end o a perormance es during which he workload
A warm-up period is a period o me a he beginning o a perormance es during which he
sysem is allowed o sabilize and reach a seady sae beore he acual es begins.
69. Wha is he dierence beween sress esng and spike esng?
Sress esng measures he perormance o a sysem under exreme condions, while spike esng
A disribued load es is a ype o perormance es ha simulaes user rac rom mulple locaons
and devices o measure he perormance o a sysem under realisc usage scenarios.