Selenium was originally developed by Jason Huggins while he was working at ThoughtWorks.
Incorrect! Try again.
2In which year was the first version of Selenium created?
Who developed Selenium?
Easy
A.1999
B.2004
C.2001
D.2010
Correct Answer: 2004
Explanation:
The first version of Selenium was created in 2004.
Incorrect! Try again.
3Which Selenium component is mainly used to create browser automation scripts without writing much code?
Selenium Components
Easy
A.Selenium RC
B.Selenium Grid
C.Selenium IDE
D.Selenium Server
Correct Answer: Selenium IDE
Explanation:
Selenium IDE is a browser extension that supports recording and playing back browser actions.
Incorrect! Try again.
4Which Selenium component provides programming language APIs for browser automation?
Selenium Components
Easy
A.Selenium IDE
B.Selenium Recorder
C.Selenium Grid
D.Selenium WebDriver
Correct Answer: Selenium WebDriver
Explanation:
Selenium WebDriver provides APIs that allow programs to control web browsers.
Incorrect! Try again.
5Which Selenium component is used to run tests on multiple machines and browsers?
Selenium Components
Easy
A.Selenium IDE
B.Selenium RC
C.Selenium Grid
D.Selenium WebDriver
Correct Answer: Selenium Grid
Explanation:
Selenium Grid supports running tests across multiple machines, browsers, and operating systems.
Incorrect! Try again.
6Which object is commonly created first to control a browser using Selenium WebDriver?
Creating your First Selenium script
Easy
A.WebPage object
B.WebElement object
C.WebDriver object
D.TestSuite object
Correct Answer: WebDriver object
Explanation:
A WebDriver object represents the browser and is used to perform browser actions.
Incorrect! Try again.
7Which WebDriver method is used to open a web page by specifying its URL?
Creating your First Selenium script
Easy
A.open()
B.get()
C.launch()
D.visit()
Correct Answer: get()
Explanation:
The get() method navigates the browser to the URL provided as an argument.
Incorrect! Try again.
8Which method is commonly used to close the current browser window in Selenium?
Creating your First Selenium script
Easy
A.end()
B.exit()
C.stop()
D.close()
Correct Answer: close()
Explanation:
The close() method closes the current browser window controlled by WebDriver.
Incorrect! Try again.
9What is the main purpose of a Selenium test?
Creating and Running Tests
Easy
A.To compile operating systems
B.To design database tables
C.To automate browser actions
D.To edit image files
Correct Answer: To automate browser actions
Explanation:
Selenium tests automate actions such as opening pages, entering data, and checking results in a browser.
Incorrect! Try again.
10What does an assertion in a test generally do?
Creating and Running Tests
Easy
A.Creates a project
B.Downloads a driver
C.Checks an expected result
D.Starts the browser
Correct Answer: Checks an expected result
Explanation:
An assertion compares an actual result with an expected result to determine whether a test passes.
Incorrect! Try again.
11What usually indicates that a Selenium test has completed successfully?
Creating and Running Tests
Easy
A.The browser changes color
B.The IDE closes automatically
C.The computer restarts
D.The test reports a pass
Correct Answer: The test reports a pass
Explanation:
A successful test normally produces a pass result in the test runner or reporting tool.
Incorrect! Try again.
12What is commonly required before installing Selenium for Java?
Installing Selenium
Easy
A.A database server
B.A Java Development Kit
C.A graphics driver
D.A video editing tool
Correct Answer: A Java Development Kit
Explanation:
Java-based Selenium projects require a Java Development Kit to compile and run the test code.
Incorrect! Try again.
13What must a Selenium project include to use WebDriver classes?
Installing Selenium
Easy
A.Image filters
B.Audio libraries
C.Operating system patches
D.Selenium libraries
Correct Answer: Selenium libraries
Explanation:
The Selenium libraries provide the classes and methods needed to write WebDriver automation code.
Incorrect! Try again.
14What is the purpose of a browser driver such as ChromeDriver?
Installing Selenium
Easy
A.To store test screenshots
B.To manage email accounts
C.To write HTML pages
D.To connect Selenium with a browser
Correct Answer: To connect Selenium with a browser
Explanation:
A browser driver acts as a communication bridge between Selenium WebDriver and a specific browser.
Incorrect! Try again.
15Which Selenium tool is the newer and generally preferred alternative to Selenium RC?
Comparison with Selenium RC
Easy
A.Selenium IDE
B.Selenium WebDriver
C.Selenium Recorder
D.Selenium Builder
Correct Answer: Selenium WebDriver
Explanation:
Selenium WebDriver replaced Selenium RC for modern browser automation and is the standard WebDriver approach.
Incorrect! Try again.
16How does Selenium WebDriver commonly communicate with a browser?
Comparison with Selenium RC
Easy
A.Through spreadsheet formulas
B.Through browser-specific drivers
C.Through email messages
D.Through manual keyboard actions
Correct Answer: Through browser-specific drivers
Explanation:
WebDriver communicates with browsers through drivers such as ChromeDriver and GeckoDriver.
Incorrect! Try again.
17What does AUT stand for in software testing?
Launching AUT and Inspecting properties of Elements
Easy
A.Application User Template
B.Application Under Test
C.Automated Unit Tracker
D.Automation Utility Tool
Correct Answer: Application Under Test
Explanation:
AUT means Application Under Test, which is the application being tested.
Incorrect! Try again.
18Which browser feature is commonly used to inspect an element's HTML properties?
Launching AUT and Inspecting properties of Elements
Easy
A.Developer Tools
B.Task Manager
C.Download Manager
D.Print Preview
Correct Answer: Developer Tools
Explanation:
Browser Developer Tools allow testers to inspect HTML, attributes, styles, and other element properties.
Incorrect! Try again.
19Which WebDriver class is used to launch Google Chrome in a Java Selenium script?
Launching AUT in Firefox and Chrome
Easy
A.EdgeDriver
B.ChromeDriver
C.FirefoxDriver
D.SafariDriver
Correct Answer: ChromeDriver
Explanation:
The ChromeDriver class is used to create a WebDriver session for Google Chrome.
Incorrect! Try again.
20Which WebDriver class is used to launch Mozilla Firefox?
Launching AUT in Firefox and Chrome
Easy
A.FirefoxDriver
B.ChromeDriver
C.InternetDriver
D.OperaDriver
Correct Answer: FirefoxDriver
Explanation:
The FirefoxDriver class is used to create a WebDriver session for Mozilla Firefox.
Incorrect! Try again.
21A project team is documenting Selenium's origins. Which statement should be included in the document?
Who developed Selenium?
Medium
A.James Gosling developed Selenium at Sun Microsystems
B.Jason Huggins developed Selenium at ThoughtWorks
C.Simon Stewart developed Selenium at Microsoft
D.Brendan Eich developed Selenium at Netscape
Correct Answer: Jason Huggins developed Selenium at ThoughtWorks
Explanation:
Jason Huggins created Selenium in 2004 while working at ThoughtWorks to automate testing of web applications.
Incorrect! Try again.
22Why was the original Selenium tool given a name associated with a chemical element?
Who developed Selenium?
Medium
A.It identified a ThoughtWorks testing framework
B.It represented support for the Java language
C.It referred to an antidote for mercury poisoning
D.It described a browser rendering mechanism
Correct Answer: It referred to an antidote for mercury poisoning
Explanation:
The name was a reference to selenium being an antidote for mercury poisoning and indirectly contrasted the tool with Mercury Interactive products.
Incorrect! Try again.
23A tester wants to record browser interactions quickly and export them as an initial automated test. Which Selenium component is most suitable?
Selenium Components
Medium
A.Selenium Manager
B.Selenium IDE
C.Selenium WebDriver
D.Selenium Grid
Correct Answer: Selenium IDE
Explanation:
Selenium IDE is a browser extension designed for recording, editing, and replaying browser interactions.
Incorrect! Try again.
24A test suite must run simultaneously on different browser and operating-system combinations. Which Selenium component directly supports this requirement?
Selenium Components
Medium
A.Selenium Grid
B.Selenium Manager
C.Selenium WebElement
D.Selenium IDE
Correct Answer: Selenium Grid
Explanation:
Selenium Grid distributes WebDriver tests across multiple machines, browsers, and operating systems for parallel execution.
Incorrect! Try again.
25Which Selenium component provides a programming interface for controlling browsers through browser-specific automation mechanisms?
Selenium Components
Medium
A.Selenium WebDriver
B.Selenium Server
C.Selenium IDE
D.Selenium Grid
Correct Answer: Selenium WebDriver
Explanation:
Selenium WebDriver exposes language APIs that send automation commands to browsers through their supported driver mechanisms.
Incorrect! Try again.
26In a Java Selenium script, which sequence correctly opens a page, reads its title, and closes the entire browser session?
get() loads the URL, getTitle() returns the page title, and quit() closes every window associated with the WebDriver session.
Incorrect! Try again.
27A first Selenium test creates WebDriver driver = new ChromeDriver(); but never releases it. Which statement should normally be placed in test cleanup?
Creating your First Selenium script
Medium
A.driver.clear();
B.driver.quit();
C.driver.dispose();
D.driver.stop();
Correct Answer: driver.quit();
Explanation:
quit() ends the WebDriver session and closes all browser windows created by that session.
Incorrect! Try again.
28A JUnit test opens a browser successfully but leaves it running when an assertion fails. Which design best prevents this problem?
Creating and Running Tests
Medium
A.Place driver.close() inside the test setup
B.Place driver.get() in an @AfterEach method
C.Place driver.quit() in an @AfterEach method
D.Place driver.quit() after every assertion
Correct Answer: Place driver.quit() in an @AfterEach method
Explanation:
JUnit invokes an @AfterEach cleanup method after each test, including tests that fail during an assertion.
Incorrect! Try again.
29A login test clicks Submit and immediately checks a message that appears after an asynchronous request. The test fails intermittently. What is the most appropriate improvement?
Creating and Running Tests
Medium
A.Repeat the click until the message appears
B.Add a fixed delay before every test step
C.Wait explicitly for the message to become visible
D.Refresh the page before checking the message
Correct Answer: Wait explicitly for the message to become visible
Explanation:
An explicit wait synchronizes the assertion with the required UI condition and avoids unreliable fixed delays.
Incorrect! Try again.
30A test method performs an action but contains no assertion. What is the main consequence?
Creating and Running Tests
Medium
A.It may pass without verifying expected behavior
B.It always fails when the action completes
C.It cannot locate elements on the page
D.It cannot launch a supported web browser
Correct Answer: It may pass without verifying expected behavior
Explanation:
Actions exercise the application, but assertions are needed to compare actual results with expected behavior.
Incorrect! Try again.
31A Java project uses Maven. What is the most maintainable way to add Selenium WebDriver libraries?
Installing Selenium
Medium
A.Declare selenium-java in pom.xml
B.Install Selenium as an Eclipse plugin
C.Copy WebDriver classes into src
D.Add browser binaries to pom.xml
Correct Answer: Declare selenium-java in pom.xml
Explanation:
Declaring selenium-java as a Maven dependency lets Maven resolve Selenium and its required transitive libraries consistently.
Incorrect! Try again.
32A recent Selenium 4 Java project creates new ChromeDriver() without configuring a driver executable path, and the correct driver is obtained automatically. Which feature most likely handled this?
Installing Selenium
Medium
A.Selenium IDE
B.Selenium Manager
C.Selenium RC
D.Selenium Grid
Correct Answer: Selenium Manager
Explanation:
Selenium Manager can discover, download, and manage compatible browser drivers when manual driver configuration is absent.
Incorrect! Try again.
33A legacy Selenium RC suite is being migrated to WebDriver. Which architectural change should the team expect?
Comparison with Selenium RC
Medium
A.Commands interact through browser automation interfaces
B.Tests must be recorded through a browser extension
C.Commands require JavaScript injection through an RC server
D.Tests must execute only on a Grid hub
Correct Answer: Commands interact through browser automation interfaces
Explanation:
WebDriver uses browser-supported automation interfaces, while Selenium RC relied on a server that injected JavaScript into the browser.
Incorrect! Try again.
34Why does WebDriver generally handle browser dialogs and native browser controls better than Selenium RC?
Comparison with Selenium RC
Medium
A.WebDriver communicates through browser automation capabilities
B.WebDriver converts every dialog into an HTML element
C.WebDriver executes all commands inside the page JavaScript
D.WebDriver disables browser security during test execution
Correct Answer: WebDriver communicates through browser automation capabilities
Explanation:
WebDriver operates through browser automation capabilities and can control browser-level features that are outside the page's JavaScript context.
Incorrect! Try again.
35An AUT contains <input id="email" name="userEmail" type="email">. If the id is unique and stable, which locator is the clearest choice?
Launching AUT and Inspecting properties of Elements
Medium
A.By.id("email")
B.By.xpath("//input")
C.By.tagName("input")
D.By.name("userEmail")
Correct Answer: By.id("email")
Explanation:
A unique, stable ID is usually direct, readable, and less likely to match unintended elements.
Incorrect! Try again.
36A button receives a different generated id after every deployment but always has data-testid="save-order". Which locator is likely to be most stable?
Launching AUT and Inspecting properties of Elements
Medium
A dedicated and stable data-testid attribute is more reliable than a generated ID, a broad tag locator, or a positional XPath.
Incorrect! Try again.
37While inspecting an element in browser developer tools, which property is most useful for determining whether a CSS locator will uniquely identify it?
Launching AUT and Inspecting properties of Elements
Medium
A.The number of DOM matches for the selector
B.The order of requests in the Network panel
C.The screen coordinates of the selected element
D.The element's current background color
Correct Answer: The number of DOM matches for the selector
Explanation:
Checking how many DOM nodes match a selector reveals whether the locator uniquely identifies the intended element.
Incorrect! Try again.
38A test framework must run the same scenario in Chrome or Firefox based on configuration. Which implementation is most appropriate?
Launching AUT in Firefox and Chrome
Medium
A.Run both browsers through one driver instance
B.Create ChromeDriver or FirefoxDriver conditionally
C.Use ChromeDriver and rename it for Firefox
D.Convert the test into a Selenium IDE project
Correct Answer: Create ChromeDriver or FirefoxDriver conditionally
Explanation:
Both drivers implement the WebDriver interface, so configuration can select the appropriate implementation while sharing the test logic.
Incorrect! Try again.
39Chrome opens the AUT correctly, but Firefox reports a certificate warning in a test environment using a self-signed certificate. What is the targeted Selenium configuration?
Launching AUT in Firefox and Chrome
Medium
A.Disable JavaScript in Firefox preferences
B.Enable insecure certificates in Firefox options
C.Replace get() with navigate().to()
D.Set Chrome options on the Firefox driver
Correct Answer: Enable insecure certificates in Firefox options
Explanation:
Firefox capabilities can be configured to accept insecure certificates for controlled test environments using self-signed certificates.
Incorrect! Try again.
40After importing a Maven Selenium project into Eclipse, imports such as org.openqa.selenium.WebDriver remain unresolved. What should be checked first?
Downloading and Configuring latest Eclipse IDE
Medium
A.The browser homepage was configured in Eclipse
B.The AUT was added to the Eclipse workspace
C.Maven dependencies were downloaded and added to the build path
D.The Selenium IDE extension was installed in Chrome
Correct Answer: Maven dependencies were downloaded and added to the build path
Explanation:
Unresolved Selenium imports usually mean Maven dependencies were not resolved or are missing from the project's build path.
Incorrect! Try again.
41Which account most accurately describes Selenium's origin and early evolution?
Who developed Selenium?
Hard
A.Paul Hammant created it at Netscape to automate Firefox, and it was later renamed Selenium Grid.
B.Jason Huggins created it at ThoughtWorks to test an internal web application, and it was later released as open source.
C.Shinya Kasatani created it at Apache to test Java applications, and it was later renamed Selenium RC.
D.Simon Stewart created it at Google to replace WebDriver, and it was later transferred to ThoughtWorks.
Correct Answer: Jason Huggins created it at ThoughtWorks to test an internal web application, and it was later released as open source.
Explanation:
Jason Huggins began Selenium at ThoughtWorks in 2004 while testing an internal web application. Other contributors later created major projects such as Selenium RC, WebDriver, IDE, and Grid.
Incorrect! Try again.
42Which contributor-to-component mapping is historically accurate?
Who developed Selenium?
Hard
A.Jason Huggins—Selenium IDE; Paul Hammant—WebDriver; Simon Stewart—Selenium RC; Shinya Kasatani—Selenium Core
B.Jason Huggins—WebDriver; Paul Hammant—Selenium Grid; Simon Stewart—Selenium Core; Shinya Kasatani—Selenium RC
C.Jason Huggins—Selenium Grid; Paul Hammant—Selenium Core; Simon Stewart—Selenium IDE; Shinya Kasatani—WebDriver
D.Jason Huggins—Selenium Core; Paul Hammant—Selenium RC; Simon Stewart—WebDriver; Shinya Kasatani—Selenium IDE
Correct Answer: Jason Huggins—Selenium Core; Paul Hammant—Selenium RC; Simon Stewart—WebDriver; Shinya Kasatani—Selenium IDE
Explanation:
Selenium grew through several contributors: Huggins initiated Selenium Core, Hammant drove RC, Stewart developed WebDriver, and Kasatani created the Firefox-based Selenium IDE.
Incorrect! Try again.
43A team needs authoring by recording browser actions, standards-based programmatic automation, and parallel execution across remote machines. Which component sequence best matches those needs?
IDE supports recording and playback, WebDriver supplies the programming API and browser control, and Grid distributes sessions across remote execution environments.
Incorrect! Try again.
44A Grid node has Chrome installed, but every requested Chrome session fails before navigation begins. Local Chrome tests on the same machine work. Which missing or mismatched element is the most relevant first investigation?
Selenium Components
Hard
A.The test framework's assertion library and its compatibility with the browser profile
B.The AUT's JavaScript framework and its compatibility with the Grid event bus
C.The node's browser-driver management and its compatibility with the installed browser
D.The hub's Selenium IDE extension and its compatibility with the recorded project
Correct Answer: The node's browser-driver management and its compatibility with the installed browser
Explanation:
The node must be able to create a local browser session before Grid can expose it remotely. Driver discovery, browser availability, permissions, and version compatibility are therefore primary checks.
Incorrect! Try again.
45Which statement correctly separates Selenium WebDriver from a test framework such as JUnit or TestNG?
Selenium Components
Hard
A.WebDriver distributes tests across nodes, while the framework records and replays browser interactions.
B.WebDriver compiles test classes, while the framework downloads browsers and configures executable paths.
C.WebDriver supplies assertions, while the framework translates commands into browser-specific protocol messages.
D.WebDriver controls browsers, while the framework supplies test lifecycle, assertions, grouping, and reporting support.
Correct Answer: WebDriver controls browsers, while the framework supplies test lifecycle, assertions, grouping, and reporting support.
Explanation:
Selenium WebDriver is a browser-automation API, not a complete testing framework. Assertions, fixtures, test discovery, and reports normally come from tools such as JUnit or TestNG.
Incorrect! Try again.
46A Java script executes driver.get(url), finds an element, and clicks it. If element lookup throws an exception, driver.quit() is skipped and browser processes accumulate. Which structure most directly guarantees cleanup?
Creating your First Selenium script
Hard
A.Create the driver before a try block and invoke quit() in its finally block.
B.Create the driver inside a catch block and invoke close() before each assertion.
C.Create the driver as a static field and rely on JVM shutdown to close each session.
D.Create the driver in every page object and invoke quit() after each element lookup.
Correct Answer: Create the driver before a try block and invoke quit() in its finally block.
Explanation:
A finally block runs whether the test succeeds or throws. quit() ends the complete WebDriver session and closes all windows associated with it.
Incorrect! Try again.
47A first script clicks a button immediately after navigation. It passes locally but intermittently raises NoSuchElementException in CI because the button is inserted asynchronously. What is the most targeted correction?
Creating your First Selenium script
Hard
A.Wait explicitly until the button is present or clickable, then locate and click it.
B.Refresh repeatedly until the page source contains the button's visible label.
C.Set a fixed sleep longer than the slowest observed run, then reuse the old element.
D.Catch NoSuchElementException and treat the test as passed when the button is absent.
Correct Answer: Wait explicitly until the button is present or clickable, then locate and click it.
Explanation:
An explicit wait synchronizes the action with the required UI state and tolerates variable load times. Fixed sleeps are slower and still fail when timing exceeds the chosen delay.
Incorrect! Try again.
48A JUnit test passes when run alone but fails when the entire class runs because another test leaves the user authenticated. Which redesign best restores test isolation?
Creating and Running Tests
Hard
A.Establish the required session state in setup and terminate or reset it in teardown for every test.
B.Order the methods alphabetically so authentication always occurs before the dependent test.
C.Reuse one static driver and add assertions that identify which test changed the session.
D.Retry the failing method after the suite completes so the browser state can stabilize.
Correct Answer: Establish the required session state in setup and terminate or reset it in teardown for every test.
Explanation:
A test should not depend on state left by another test. Per-test setup and cleanup make outcomes reproducible regardless of execution order or parallelism.
Incorrect! Try again.
49Four tests are executed in parallel using one shared static WebDriver. Failures show navigation and element actions occurring in the wrong test's window. Which change addresses the underlying concurrency defect?
Creating and Running Tests
Hard
A.Disable browser cookies so authentication data cannot cross test boundaries.
B.Use one shared window handle and switch to it before every test command.
C.Provide each parallel test thread with an independent WebDriver session.
D.Add an implicit wait so commands remain queued until each page is ready.
Correct Answer: Provide each parallel test thread with an independent WebDriver session.
Explanation:
A WebDriver session is stateful and should not be concurrently shared by independent tests. Thread-confined sessions prevent commands, windows, and browser state from interfering.
Incorrect! Try again.
50A Maven-based Java project compiles in Eclipse but fails on a clean CI agent because Selenium JARs were manually added from a developer's local directory. What is the most reproducible installation fix?
Installing Selenium
Hard
A.Copy only the WebDriver interface JAR to the CI agent and omit protocol-related libraries.
B.Install the Selenium IDE extension on the CI agent and export the tests as Java.
C.Declare the Selenium Java dependency in pom.xml and let Maven resolve transitive dependencies.
D.Commit the developer's Eclipse workspace metadata and preserve its absolute classpath entries.
Correct Answer: Declare the Selenium Java dependency in pom.xml and let Maven resolve transitive dependencies.
Explanation:
A build-tool declaration gives local and CI builds the same versioned dependency graph. Workspace-specific absolute JAR paths are not portable or reliably reproducible.
Incorrect! Try again.
51With Selenium Manager available in a current Selenium installation, a new Java test still fails with NoSuchDriverException. Which diagnosis is most appropriate before manually setting a driver path?
Installing Selenium
Hard
A.Replace driver.get() with driver.navigate().to() because only navigation initializes the driver.
B.Add Selenium IDE to Eclipse because IDE performs driver discovery for Java bindings.
C.Install Selenium RC because WebDriver cannot discover executables without an RC server.
D.Check Selenium version, browser installation, network or cache access, permissions, and the exception's resolution details.
Correct Answer: Check Selenium version, browser installation, network or cache access, permissions, and the exception's resolution details.
Explanation:
Current Selenium releases can manage drivers automatically, but discovery may fail because of an outdated library, missing browser, restricted download access, cache problems, or permissions.
Incorrect! Try again.
52Why did WebDriver generally provide a more browser-native automation model than Selenium RC?
Comparison with Selenium RC
Hard
A.WebDriver communicates through browser automation endpoints, whereas RC injected Selenium Core JavaScript through an intermediary server.
B.WebDriver injects JavaScript into every page, whereas RC communicates only through operating-system accessibility APIs.
C.WebDriver requires a proxy server for every command, whereas RC invokes each browser's native driver directly.
D.WebDriver runs solely inside the browser extension, whereas RC uses the W3C WebDriver protocol externally.
Correct Answer: WebDriver communicates through browser automation endpoints, whereas RC injected Selenium Core JavaScript through an intermediary server.
Explanation:
RC depended on a server and injected JavaScript automation into the application context. WebDriver instead uses browser-specific automation implementations behind a standardized remote-control protocol.
Incorrect! Try again.
53A legacy RC suite could interact with content only after configuring a proxy and starting a separate Selenium server. When migrating ordinary local tests to modern WebDriver, which architectural change is expected?
Comparison with Selenium RC
Hard
A.Tests create WebDriver sessions through browser-specific automation endpoints without the RC JavaScript-injection server.
B.Tests convert all browser actions to HTTP assertions because WebDriver cannot manipulate page elements.
C.Tests embed Selenium Core into every AUT page and retain the proxy to satisfy same-origin restrictions.
D.Tests execute exclusively through Selenium Grid because local WebDriver sessions are not supported.
Correct Answer: Tests create WebDriver sessions through browser-specific automation endpoints without the RC JavaScript-injection server.
Explanation:
Local WebDriver tests do not require Selenium RC's server-and-injected-JavaScript architecture. A Grid server remains optional when remote or distributed execution is needed.
Incorrect! Try again.
54Inspection shows five rows whose edit buttons all have generated IDs that change on every load, but each row has a stable data-user-id. Which locator is most resilient for editing user 42?
Launching AUT and Inspecting properties of Elements
Hard
A.An ID selector copied from the edit button during the latest inspection
B.An absolute XPath using the current row number and button position
C.A CSS selector matching the first button element anywhere in the table
D.A CSS selector scoped to [data-user-id='42'] and its edit button
Correct Answer: A CSS selector scoped to [data-user-id='42'] and its edit button
Explanation:
A stable domain attribute identifies the intended row independently of generated IDs or layout order. Scoping the button lookup to that row also avoids matching another user's control.
Incorrect! Try again.
55Developer Tools shows the target input inside an open shadow root. driver.findElement(By.cssSelector("#email")) from the document root fails. What is the correct conceptual approach?
Launching AUT and Inspecting properties of Elements
Hard
A.Convert the selector to an absolute XPath because XPath automatically crosses shadow boundaries.
B.Wait for all cookies to load, then use the same selector against the top-level document.
C.Locate the shadow host, obtain its shadow root, and search for #email within that root.
D.Switch to the shadow root with switchTo().frame() and search from the document root.
Correct Answer: Locate the shadow host, obtain its shadow root, and search for #email within that root.
Explanation:
Shadow DOM establishes a separate search context. Selenium must first locate the host and then query through its shadow root; frame switching and ordinary document-level selectors do not cross that boundary.
Incorrect! Try again.
56An inspected element is inside an iframe. Its CSS selector is unique within that frame, but the test cannot find it from the main page. Which sequence is required?
Launching AUT and Inspecting properties of Elements
Hard
A.Open the frame's source URL in a second tab and reuse the original element reference.
B.Use JavaScript to rename the frame before locating the element in the main document.
C.Wait for the frame, switch into it, locate the element, and return to default content when finished.
D.Prefix the element selector with the frame's ID and search directly from the main document.
Correct Answer: Wait for the frame, switch into it, locate the element, and return to default content when finished.
Explanation:
An iframe has its own browsing context. WebDriver must switch to that context before locating its descendants and switch back before interacting with the top-level page.
Incorrect! Try again.
57The same test must launch Firefox and Chrome using browser-specific options while keeping the test workflow unchanged. Which design best supports this requirement?
Launching AUT in Firefox and Chrome
Hard
A.Create a driver factory that returns a configured WebDriver based on an external browser parameter.
B.Use ChromeOptions for both browsers because all capability names are interchangeable.
C.Start both browsers for every test and execute each command against the first responsive one.
D.Place ChromeDriver and FirefoxDriver commands alternately inside each test method.
Correct Answer: Create a driver factory that returns a configured WebDriver based on an external browser parameter.
Explanation:
Programming against the WebDriver interface and centralizing browser-specific construction isolates configuration differences while preserving one reusable test workflow.
Incorrect! Try again.
58Chrome opens the AUT successfully, but Firefox reports a certificate warning for the same internal HTTPS environment. The certificate is intentionally trusted only for test execution. Which configuration is most appropriate?
Launching AUT in Firefox and Chrome
Hard
A.Rewrite the AUT URL from HTTPS to HTTP inside every cross-browser test.
B.Use ChromeDriver to create Firefox sessions because Chrome already accepts the site.
C.Disable all Firefox security preferences globally in the developer's default profile.
D.Set the accept-insecure-certificates capability for the Firefox test session.
Correct Answer: Set the accept-insecure-certificates capability for the Firefox test session.
Explanation:
The session capability explicitly allows insecure certificates for that automation session. It avoids modifying a user's permanent browser profile or changing the application's protocol.
Incorrect! Try again.
59After importing a Maven Selenium project into the latest Eclipse IDE, Java imports remain unresolved even though pom.xml is correct and mvn test succeeds in a terminal. What is the most appropriate Eclipse-side action?
Downloading and Configuring latest Eclipse IDE
Hard
A.Update the Maven project configuration and verify Eclipse is using a compatible installed JDK.
B.Remove the Maven nature and add each transitive dependency as an external class file.
C.Install Selenium IDE in Firefox and point Eclipse at the browser extension's installation folder.
D.Convert the project to a plain folder and manually copy dependencies into the source directory.
Correct Answer: Update the Maven project configuration and verify Eclipse is using a compatible installed JDK.
Explanation:
A successful command-line build indicates the Maven model is valid. Eclipse may need to refresh that model, rebuild its classpath, or use a JDK compatible with the project's compiler settings.
Incorrect! Try again.
60Eclipse launches with one JRE, but the Selenium project targets a newer Java release and reports a compiler-compliance mismatch. Which configuration resolves the cause most directly?
Downloading and Configuring latest Eclipse IDE
Hard
A.Install another Eclipse workspace and move only the generated .class files into it.
B.Change the WebDriver implementation to RemoteWebDriver and retain the older compiler level.
C.Add the browser driver executable to the Java build path and lower warning severity.
D.Install the required JDK, register it in Eclipse, and align the project JRE and compiler level.
Correct Answer: Install the required JDK, register it in Eclipse, and align the project JRE and compiler level.
Explanation:
Compiler compliance and the project's Java runtime must agree with the source level required by the build. Browser-driver configuration does not correct a Java toolchain mismatch.
Incorrect! Try again.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill.
The rest comes out of a student's own pocket: the domain, the storage,
and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it.
What it pays for →