Selenium Notes 1
Selenium Notes 1
(h
ttps://www.linkedin.com/in/anshulagarwal30)
Agenda
● eneral
G
● Java
● Selenium
● TestNG
● Maven
● Cucumber
l
● WebService
● Java Programs
wa
● Functional Testing
● Agile
● Managerial
ar
General:
Ag
● T ell me about yourself.
● What are your Roles and Responsibilities?
● What is the architecture of your current application?
● What are your Roles & Responsibilities in your current Assignment?
ul
Java:
● Why String is immutable in Java?
An
● hat is static in Java?
W
● What is final in Java?
● What is this word in Java?
● What is finally and where do we use it?
● What is Autoboxing and unboxing?
● What is serialisation and deserialisation?
● What is an abstract modifier?
● What is call by reference and call by value?
● Primitives and Non-Primitives datatypes in Java? String is
primitive or non-primitive?
● hat is the method of overloading?
W
● Why is it important to override HashCode() when you
override equals()?
● What is the difference between a checked and
unchecked exceptions?
● Difference between final, finally, finalize?
● Difference between abstract and interface?
● Difference between String Builder and String Buffer?
● Difference between Array and ArrayList?
l
● Difference between ArrayList and LinkedList
How to define dynamic array?
wa
●
●
●
ar
Can we create constructor of abstract class?
Can constructor be overloaded. Explain why?
Can main method be overloaded?
Ag
● Can main method be overridden?
● Can we override static method?
● Can we overload static method?
ul
l
● Can we overload private methods?
Is it possible to extend Final Class?
wa
●
●
●
ar
Is it possible to initialize a variable present in an Interface?
What would happen, if multiple inheritance is possible, in Java?
Explain Exceptions hierarchy in java?
Ag
● Explain Set and Map in Java?
● Explain about Inheritance.
● Difference between overloading and overriding?
ul
l
explanation about loosely coupled and tightly coupled
wa
● Will Java provide default constructor by own ?
● ifference between Arraylist and Linked List,In which
D
situation they are used ?
Difference between ar
List<String> list = new ArrayList<String>() and
ArrayList<String> list = new ArrayList<String>();
Ag
● Difference between HashMap and MultiMap?
● In which situation the method should be static and
when non static?
ul
user defined constructor and main method which one will get
executed first?
An
● hat are the challenges you have faced during testing?
W
● What strategies you followed while building a
selenium framework from scratch?
● Where do you perform the singleton design pattern? If you
don’t use it, then do you have an idea about this?
● Difference between Implicit, Explicit and Fluent waits
in Selenium?
l
● Pros and cons of Implicit wait and Explicit wait.
Why we prefer explicit wait instead of fluent wait? What
wa
●
●
●
ar
What is default polling time in explicit wait and in implicit wait?
Explain about synchronization in selenium?
Which concept they have implemented in explicit and
Ag
fluent wait?
● Explain abstraction and interface respect of selenium with
some example
ul
●
l
● State some exception which you have faced in your
wa
framework? (Don’t mention only selenium explain. Explain java
exception also)
● Types of Exceptions and how to handle stale
●
ar
element exception?
What are the interface used in selenium?
Ag
● Where do you used inheritance in selenium?
● How do you initialize web elements in POM? What error
or exception will come if not initiated?
● If both wait method that is implicit and explicit is mentioned
ul
in the script, then which one is work? is it good practice to
sh
● In a web page, there are several Pop-up, but we don’t when
the pop-up will appear, in this case how we will handle the
Pop-up using Selenium WebDriver (Java)
● How to handle file upload when type attribute does not file
for upload web element.
● How to cover character keyboard operation from the
context menu utilizing user-defined keyword?
● onsider this snippet:
C
Web driver driver=new chromedriver();
what does the above code snippet mean?
● Where can “Dynamic Polymorphism” in Selenium WebDriver be
observed?
● What is the difference between “/” and “//” in XPath?
● If proper Xpath, CssSelector and ID are not available, how
do you identify an object?
● Attributes of CSS Selector?
l
● Which is most faster xpath or css?
How to get n-th element using XPath and CSS?
wa
●
● Consider you are only allowed to use css locator, how will
you find the parent/grandparent of a web element?
●
●
●
ar
Will driver.findelements() throw an exception?
What is returned by driver().manage()?
In selenium, if you want to access the element that has the
Ag
text “This element has an ID that changes every time the page
is loaded” in it, then which of the following will you use?
● On page Object Model Framework (POM), how do you
ul
● et the values from the dropdown and print them in
G
Ascending order
● Using TreeSet to find elements command
● Does takes screenshot is interface or class
● Selenium uses lots of third parties jars for scripting. Then
why do we still go for selenium?
● Why do we have to use build() and perform() with the
action object?
● an we use perform() along in scripting without build()
C
● What is difference between build() and perform() in selenium?
● Return type of getwindowhandle() and getwindowhandles()?
● Window Handling in Selenium -Switching from another
window to Parent window
● If the button is disabled? how to check -using getattribute()
● Explain method overloading with selenium and some example
● How do you read excel in the script? (very careful while
answering. the counter-question will come as per your
l
answer)
Do you use the property file in your framework? If yes,
wa
●
●
ar
the pop-up will appear, in this case how we will handle the
Pop- up using Selenium WebDriver (Java)
Started automation test suite execution and few test cases
Ag
are failed in a test run. How can you execute only failed test
cases at once (with one click) what design pattern do we use
when we trigger different browsers?
ul
changes dynamically)
● How to calculate links on a page? (Answer with HTML tag)
Write the code to read the value from the excel sheet.
An
●
l
● How to check whether web element is enabled or
Disabled without using isEnabled method?
wa
● Why is CSS locator faster than Xpath?
● Even though CSS is faster than Xpath ,why do 95% of
●
ar
the companies use XPath ?
Error is throwing as Element not found but when I go and
check that element is available in the web page? The element
Ag
is not hidden so no need to use Java script executor? How do
you solve this?
● How do you execute using headless mode?
ul
● In Selenium, how to get text value from text-box if gettext()
is not working?
sh
● If we are using correct locator but still getting element
not found error then how you will resolve this error?
● In Page object model once you create loginpage.java class
An
what is the first thing you start with writing initially. How are
you initiating writing something into a page class?
● What if Windows popup occurs during test execution and
due to that can't execute automated tests, how u will resolve
this error?
● Different ways to handle hidden elements?
● hat is the difference between click() function in
W
webelement interface and click() function in Actions class?
● Is it possible to change the behaviour of a test at runtime?
● Describe how to handle the below items using selenium
l
● How will you automate Windows based application?
wa
ar
Ag
ul
sh
An
TestNG:
● What is the importance of the testng framework?
● hy we use TestNG in your framework
W
● What is the purpose of testing XML
● Explain the purpose of listeners? is it the selenium concept
of TestNG?
● Case Scenario: How to run the same method 100 times
in TestNG with the same data?
l
● What is the reporting tool in your framework? and why?
wa
● Some questions in TestNG XML?
● What are different testng annotations?
● How can you configure tests in testng?
ar
● What is @dataprovider?
● Difference between @Factory and @DataProvider?
Ag
● @Factory explain with real time example?
● T est Order in TestNG?
● How to add/remove test cases in Testng.xml?
ul
● Out of 50 testcases, how you will run only the failed testcases?
● ow can you take the screenshot for the failed testcases?
H
● How can you run the same tests for 10 times?
● Types of Listeners?
● TestNG: Parallel executions, Grouping?
● ifference between after suite and before suite?
D
● What is the use of testng.xml?
● ow many suits can be there in testNG , what if I run all
H
the suits?
● S yntax to perform parallel testing in TestNG and what do you
write in <suite tag> also what do you mention in double
quotes like parallel = “ ”
● In testNG, do we have multiple suite in one XML file and what
If I want to run all suits?
● What is invocationcount in testng?
l
● Cucumber tags and annotations?
● What is background in Cucumber?
wa
● ifference between Scenario and Scenario Outline?
D
● Write skeleton of test runner?
●
●
ar
Explain retry analyzer?
ucumber tags? And how to run different combinations of
C
tags when multiple tags are present
Ag
● Difference between hooks and tags?
ul
sh
An
Maven:
l
tomorrow when you see that someone deleted all
wa
dependencies from .pom file then in that case will you be
able to execute tests or not.
● Consider you have to write test/suite for different
ar
environments(qa, preproduction, production) and pass
different set of data for each environment. How will you do
it using maven file(Pom.xml)?
Ag
● Can you give some basic commands used in maven project?
● How will you configure Jenkins job?
● What are two components Jenkins is integrated with?
ul
●
W
● hat is Cucumber, and why is it used in BDD?
● What are Gherkin keywords, and can you name some of them?
(e.g., Given, When, Then, And, But)
● How do you structure feature files in Cucumber?
● What is the difference betweenScenarioandScenarioOutline?
● How are step definitions mapped to feature file steps?
● How do you parameterize steps in Cucumber?
(Explain usage of regular expressions or<placeholders>in steps.)
l
● What happens if multiple step definitions match the same step?
● What are tags in Cucumber, and how are they used?
wa
● Explain the different types of hooks (@Before,@After,etc.) in Cucumber.
● Can you run specific scenarios based on tags? How?
● How do you handle test data in Cucumber scenarios?
ar
● What is the difference betweenDataTableandExamples?
● How do you convert aDataTableto a list or map instep definitions?
● How do you integrate Cucumber with Selenium WebDriver?
Ag
● Can you run Cucumber tests in parallel? How?
● What is the role of theRunnerclass in Cucumber?
● How do you handle dynamic locators in Cucumber steps?
● What are some common challenges in writing Cucumber tests, and how
ul
files?
● How do you ensure Cucumber scenarios remain readable and
An
maintainable?
● What does your Cucumber framework structure look like?
● How do you handle reports in Cucumber (e.g., Allure or ExtentReports)?
● Explain the significance of thecucumber.propertiesorcucumber.ymlfile.
● How do you ensure collaboration between developers, testers, and
business stakeholders in BDD?
● Can you share an example of how you wrote a complex scenario in
Cucumber?
● How do you decide whether a scenario should be automated or not?
WebService:
l
● What is difference between Authorization and Authentication?
wa
● What are the API status codes, you have come across?
● What is difference between OAuth1.0 and OAuth2.O ,When
and where do you use and how. Can you write a sample
●
code? ar
How you get the response from one api and send to
Ag
another api?
ul
sh
An
Java Program:
l
small letter in a given string.
wa
● Write code to check if a number is palindrome?
● Write a code to reverse the code, without using the
built-in method.
●
ar
Write a Java code to identify, if the pair of strings are
an Anagram or not?
Ag
● Write a code to get Highest number using array.
ul
sh
An
Functional Testing:
l
●
equivalence partitioning?
wa
● Difference between white box and black box testing?
● If we are having 1000 test cases, what type of testing
carriedforautomationtesting?Canwewriteamethodthat
● Explain severity and priority and High severity with low
priority, low severity and high priority?
● Given the test cases having priority of -1,0,1,2 tell me
An
l
● What is smoke, regression and sanity testing?
wa
● What is the next step to be taken, if developer rejects the
Open defect?
● Explain the test metrices?
●
●
ar
How would you priorities Tests?
How do you perform Automation Code Review/ Walk
Through in your project?
Ag
● There are 250 manual test cases , how will you segregate
(on what basis) the regression , sanity , smoke suite?
● When Regression ,Sanity , smoke test scripts are executed ?
ul
● How will you decide that this test case is feasible or
good candidate for automation ?
sh
An
Agile:
l
will you handle this situation?
wa
● What is backlog in Scrum methodology?
● Y ou have 30 + sprints in your release how will you design
your test scripts and run them?
ar
Ag
ul
sh
An
Managerial round:
l
● As Lead, how do you define quality of product before releases?
wa
● Suppose you are the leam QA and 1 new member join your
team and at the same time you have a deadline to meet in next
2 or 3 days so how will you involve that new member in team
●
ar
so that you can utilise him/her to meet deadlines?
As a QA, where do you see yourself after 3 years?
Ag
● What are your strengths and Weakness?
● What are some best practices you learnt and how much
difference it made in testing career? Explain before and
after situations
ul
● After you have run a full regression test, and find new
sh