Question 1
Which of the following is a benefit of using Relative Locators in Selenium?
They increase test execution speed
They allow locating elements based on their position relative to other elements
They require complex XPath expressions
 They are only used for static web elements
Question 2
What is the key limitation of using Relative Locators in Selenium?
They are not supported in Selenium 4
They are slow and inefficient
They are sensitive to window size and visibility of reference elements
They only work with specific browsers
Question 3
In the Page Object Model (POM) design pattern, how are web elements typically handled?
Web elements are directly handled in the test scripts
Web elements are encapsulated in separate classes
Web elements are stored in external files
Web elements are initialized using annotations
Question 4
What method does Page Factory use to initialize web elements in Selenium?
driver.findElement()
PageFactory.initElements()
WebDriverManager()
@FindBy annotations
Question 5
Which of the following is a difference between Page Object Model (POM) and Page Factory?
POM requires more boilerplate code for element initialization, while Page Factory reduces it
POM uses annotations to define web elements, while Page Factory does not
Page Factory requires manual element locator updates, while POM does not
POM cannot be used for testing dynamic elements, while Page Factory can
Question 6
What is Shadow DOM used for in web development?
To create invisible web elements
 To encapsulate styles and scripts within a component
To improve browser performance
 To prevent browser pop-ups
Question 7
How can Shadow DOM elements be accessed in Selenium WebDriver?
By using driver.findElement() directly on the shadow element
 By using getShadowRoot() or JavascriptExecutor
By waiting for the shadow DOM to load
By using the driver.switchTo().frame() method
Question 8
In the context of Selenium, what does JavascriptExecutor allow you to do?
It allows Selenium to manage browser sessions
 It lets you execute JavaScript within the browser's context
It handles synchronization issues in Selenium tests
 It enhances the performance of Selenium tests
Question 9
What does the following JavascriptExecutor command do?
js.executeScript("window.scrollBy(0,150)");It opens a new browser window
It scrolls the page by 150 pixels vertically
 It scrolls the page by 150 pixels horizontally
 It clicks an element on the page
Question 10
What is the main challenge when automating Shadow DOM elements in Selenium?
Shadow DOM elements cannot be located using standard locators
Shadow DOM elements are too slow to interact with
Shadow DOM elements are only available in specific browsers
Shadow DOM is deprecated and no longer supported
There are 10 questions to complete.