0% found this document useful (0 votes)
26 views13 pages

Selenium - Interview - Question and Answars

Uploaded by

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

Selenium - Interview - Question and Answars

Uploaded by

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

what is bug life cycle?

what is test framework?


ans: A test framework is a set of guidelines and tools that help QA
professionals design and create test cases more efficiently. Frameworks
can include coding standards, test data handling methods, and processes
for storing test results. Testers can still script or record tests without
following the guidelines, but using a framework can provide additional
benefits.

what is test automation framework?


ans: A test automation framework is a structured approach to software
testing that helps create, execute, and manage tests. It's a platform that
combines tools, programs, compilers, and features to provide an
environment for running automated test scripts.

A test automation framework typically includes:


 Guidelines, standards, and tools
 Test environment setup
 Test data management
 Test planning and design
 Test execution engine
 Logging and reporting
 Test libraries and utilities

What is Stress Testing?


Stress testing is defined as types of software testing that verifies the
stability and reliability of the system. This test particularly determines the
system’s robustness and error handling under the burden of some load
conditions. It tests beyond the normal operating point and analyses how
the system works under extreme conditions. Stress testing is performed to
ensure that the system does not crash under crunch situations. Stress
testing is also known as Endurance Testing or Torture Testing.
What is Regression Testing?
Regression testing is like a software quality checkup after any changes
are made. It involves running tests to make sure that everything still works
as it should, even after updates or tweaks to the code. This ensures that
the software remains reliable and functions properly, maintaining its
integrity throughout its development lifecycle.

What is Sanity Testing?


It is a subset of regression testing. Sanity testing is performed to ensure
that the code changes that are made are working properly. Sanity testing
is a stoppage to check whether testing for the build can proceed or not.
The focus of the team during the sanity testing process is to validate the
functionality of the application and not detailed testing. Sanity testing is
generally performed on a build where the production deployment is
required immediately like a critical bug fix.

what is smoke testing?


ans: Smoke testing, also known as “Build Verification Testing” or
“Build Acceptance Testing,” is a type of software testing that is
typically performed at the beginning of the development process to
ensure that the most critical functions of a software application are
working correctly. It is used to quickly identify and fix any major
issues with the software before more detailed testing is performed.
The goal of smoke testing is to determine whether the build is stable
enough to proceed with further types of testing.
what black box testing?
ans: Black box testing is a software testing technique where the internal
workings or code structure of the system being tested are not known to the
tester.
In other words, the tester focuses solely on the external behaviour of the
software, without having access to its internal source code. The name
“black box” comes from the idea that the internal workings are hidden or
“boxed” from the tester’s view.
what is white box testing?
ans: White Box Testing, or glass box testing, is a software testing
technique that focuses on the software’s internal logic, structure, and
coding. It provides testers with complete application knowledge,
including access to source code and design documents, enabling
them to inspect and verify the software’s inner workings,
infrastructure, and integrations.
what is test plan in software testing?
ans: A test plan is a detailed document that outlines the strategy,
objectives, schedule, resources, and overall approach for testing
software. It's similar to a blueprint for a building, providing a step-by-
step guide to reach the goal of a verified application.

what is STLC?
ans: The Software Testing Life Cycle (STLC) is a sequence of specific
actions performed during the testing process to ensure that the
software quality objectives are met. The STLC includes both
verification and validation. Contrary to popular belief, software testing
is not just a separate activity. It consists of a series of methodological
activities to help certify your software product.
what are the STLC phases?
1. ans: Requirement Analysis;
2. Test Planning;
3. Test Case Development;
4. Test Environment Setup;
5. Test Execution;
6. Test Cycle Closure.
what is test plan in STLC?
ans: A test plan is the first phase of the Software Testing Life Cycle
(STLC). It helps ensure that all software components are tested
sufficiently before a release. A test plan can be a master plan or a
plan for a specific type of testing, such as unit testing, integration
testing, usability testing, or performance testing.
Here are some steps to create a test plan:
 Define the release scope
 Schedule timelines
 Define test objectives
 Determine test deliverables
 Design the test strategy
 Plan test environment and test data
 Define test criteria: This includes outlining the software's requirements to
be considered successful in testing, such as the testing environment,
acceptance criteria, and test completion criteria. The test criteria should
align with the software's business needs, technical requirements, and
target audience expectations.

what is cross browser testing?


ans: Cross-browser testing is a type of functional testing used to
ensure that web sites and web applications are compatible with
various browsers. Cross-browser testing ensures that a site
works as expected across popular browsers, allowing more
people to access and use it regardless of their device, operating
system, or resolution.
what are the exceptions in selenium
 ans: NoSuchWindowException.
 NoSuchFrameException.
 NoSuchElementException.
 NoAlertPresentException.
 InvalidSelectorException.
 TimeoutException.
 ElementNotVisibleException.
 ElementNotSelectableException.

1) What are the different locators used?

1. Tag name
2. Class name
3. id
4. link text
5. Partial link text
6. CSS Selector
7. XPath
8. Name

2) Which is the slowest locator?


Xpath.
3) Which is the best locator?
The selection of the best locator depends on the web elements or the ui
page we are automating.
4) What is the library to be imported to add keyboard actions to our
scripts?
from selenium.webdriver.common.keys import Keys
5) What is the library to be imported to add mouse actions to our
scripts?
from selenium.webdriver.common.actionchains import ActionChains

6) What is a locator?
It’s an element in web page with which the python script would interact
through the selenium driver
7) What is a Webdriver?
Selenium provides a tool to interact with the different web browsers. And
they control the operation of the script. Ex: chromedriver, Iedriver, gecko for
firefox.

8) Whats XPATH?
It is the extensible markup language’s path finder where the data is stored
in XML format like Key value pair
9) Whats the difference between / and // in xpath?
/ : absolute path // relative path
We will use / to start the selection from a node in the document. It allows us
to create absolute Xpath expressions. We will use // to start the selection
from anywhere in the document. It allows us to create relative Xpath
expressions

10) Whats explicit and implicit wait?


Explicit wait makes the browser wait for a given duration or the condition is
true else, it will throw a time exceeded exception
Implicit wait- will make the browser wait for a defined time and the
execution continues

11) What are window handles?


During the script execution if there is a new window that pops up then they
have an address and they have a handle, each handle is listed in the
variable handles[]
12) What are alerts and how do you handle?
Alerts are the popup windows that you get when there is notification to the
user,
Handling them: alert_var = browser.switch_to_alert()
To dismiss: alert_var.dismiss()
To accept: alert_var.accept() etc

13) How to find element by hyperlink?


Find_element_by_link_text(“text of that hyperlink”).click()
14) How do you write the text in the login form?
Find_element_by_id(“username_field”).send_keys(“USERNAME”)

15) What is the difference between close() and quit() func of the
browser?
Browser.close() will close the current executing window and you can
always switch to other window handles even after closing currently active
one.Browser.quit() – will close the complete browser with all the open
windows, this func handle and makes sure the processes are closed and
terminated correctly without any memory leaks.
16) When webpage is dynamic which element locater do we use to
locate an element?
driver.findElementByXpath()
17) What is WebDriver in selenium?
WebDriver is a plugin that helps to run selenium test scripts on a web
browser.

18) Can I use selenium for automation scripting without selenium


IDE?
Yes, selenium can be imported as a module in any other programming
platform & write selenium test scripts.
19) Can we do data-driven testing using selenium?
Yes, bypassing values as parameters during run time.
20) What versions are there of Selenium?
Selenium WebDriver – Used for the automation of tests in web
applications.
Selenium IDE – Firefox plugin to record and run tests.
Selenium Grid – Allows you to run Selenium tests in parallel through
multiple machines.

21) What are the different types of locators that we can use to search
for an element with Selenium?
The locators that we can use with Selenium are ID, Name, ClassName,
TagName, LinkText, and Partial LinkText, XPath, CSS Selector.

22) What is an XPath?


Xpath (XML Path Language) is a language that allows you to retrieve
information from an XML document by defining a syntax to set parts in an
XML document, allowing you to navigate through its elements and
attributes, as well as allowing basic manipulation of Booleans, numbers,
and strings.
23) What is the difference between / and // in an XPath expression?
We will use / to start the selection from a node in the document. It allows us
to create absolute Xpath expressions. We will use // to start the selection
from anywhere in the document. It allows us to create relative Xpath
expressions.
24) How can we select an option of a dropdown using Selenium
Webdriver?
To be able to select the value of a dropdown using Selenium Webdriver we
have to use the Select class, of Webdriver. Through this class we can
select a value of a dropdown by its value, its visible text or its index number
(position).
25) How Synchronization works in Selenium.
Synchronization is achieved using Implict Wait and Explicit Wait.

26) What is Implicit Wait.


Implicit Wait is used to default waiting time.
27) What is explicity Wait.
Explicit Wait is used to halt the execution untill condition is met or when
time is elasped.

28) How can enter the values in text box using python.
driver.find_element(By.ID,”Value”).send_keys(“Value”)
29) How can we get text of a web element.
driver.find_element(By.ID,”Value”).text, this specific method will return
innertext of the control.
30) what are the different Navigation command in selenium
it is used to refresh
driver.refresh()
it is used to navigate back
driver.back()
it is used to move forward
driver.forward()
31) What is the difference b/w findelement and findelements

 FindElement returns first matching element.


 FindElements returns more than one element
32) what is the difference b/w Driver.Close and Diver.quit

 close is used to close the entire browser


 quit is used to close the working tab.

33) Can selenium handle WebBased Pop Up.


Yes it can handle webbased pop up using “driver.switch_to_alert()”
34) How can capture screenshot in selenium.
driver.get_screenshot_as_file(“filename”) with this method we can take
screen shot.

35) What are switch Class in selenium.


Switch class are used to switch between the different browser,frames and
alert pop up.

36) What Action class in selenium


ACtion class is user facing API to achieve complex user action events.

37) How can we perform drag drop in selenium


act=ActionChains(driver)
act.drag_and_drop(sourcelement,targetelement), with this method we can
perform drag and drop

38) How can mouse hover on a control in selenium.


act=ActionChains(driver)
act.move_to_element(element)
with the above method we mouse hover on element, element argument is
web element where we need to mouse hover
39) How will identify when web element doesn’t have any of the
unique locater.
we can make use of the get_attribute method to get web element from list
of web elements.
for control in controls:
if control.get_attribute(“attributename”)==”attributeValue”:
#found the matching control
40) How to execute java script in selnium with python
driver.execute_script(script)
above method will execute the java script.

41) What are the differnt way entering value TextBox

 find_element_by_id(“val”).send_keys(“valuetoebeentered”)
 other is using Action Class
act=ActionChains(driver)

42) What is the use of Xpath


xpath is used to find the web element in webpage.
43) What are the different exception in selenium

 webdriver exception
 noalertPresent Exception
 nosuchwindow Exception
 nosuchelement exception
 timeoutexception

44) How will perform double click on web element


act=ActionChains(driver)
act.double_click(control)
Above method will be used to double click on the control.
45) How will you handle multiple windows in selenium
we can use “switch_to_window” method to switch between the multiple
windows. where in argument we would be sending the address of the
window in the form of string.

46) What is the difference between Assert and Verify?


Assert it is used to verify the result. If the test case fails then it will stop the
execution of the test case there itself and move the control to another test
case.
Verify it is also used to verify the result. If the test case fails then it will not
stop the execution of that test case.

47)difference between soft assert hard assert?

Hard Assert:Hard Asserts are used when you want to halt the
execution of the test script (or test method)

when the assert condition does not match with the expected
result.

Soft Assert:oft Asserts are used when the test script (or test
method) need not be halted
when the assertion condition does not meet the
expected result
48) Why XPath is slower than other locators?
Xpath allows bidirectional flow which means the traversal can be both ways
from parent to child and child to parent as well. Css allows only one
directional flow which means the traversal is from parent to child
only. Xpath is slower in terms of performance and speed

You might also like