Recall & Review
beginner
What is Selenium WebDriver used for in testing?
Selenium WebDriver is used to automate web browsers. It helps testers simulate user actions like clicking buttons, entering text, and navigating pages to check if a website works correctly.
Click to reveal answer
beginner
In a Selenium Java test, what does the method
driver.get("https://example.com") do?It opens the web page at the URL "https://example.com" in the browser controlled by Selenium WebDriver.
Click to reveal answer
beginner
Why do we use
driver.quit() at the end of a Selenium test?To close the browser and end the WebDriver session. This frees up system resources and ensures the test ends cleanly.
Click to reveal answer
beginner
What is the purpose of assertions in a Selenium test?
Assertions check if the actual result matches the expected result. They help confirm that the web page behaves as intended during the test.
Click to reveal answer
beginner
Which locator strategy is recommended for finding elements in Selenium tests?
Using unique and stable locators like
id or name attributes is recommended. They make tests more reliable and easier to maintain.Click to reveal answer
What does the following Selenium Java code do? <br>
driver.findElement(By.id("submitBtn")).click();✗ Incorrect
The code finds the element with id 'submitBtn' and performs a click action on it.
Which method opens a web page in Selenium WebDriver?
✗ Incorrect
The method driver.get() loads a web page by URL in the browser.
Why is it important to use
driver.quit() after a test?✗ Incorrect
driver.quit() closes the browser and ends the WebDriver session, freeing resources.
Which locator is usually the most reliable in Selenium tests?
✗ Incorrect
Unique id attributes are stable and fast for locating elements.
What is the main purpose of assertions in Selenium tests?
✗ Incorrect
Assertions verify if the actual result matches the expected result, determining test success.
Describe the basic steps to write and run your first Selenium Java test.
Think about what you do when you test a website manually and how Selenium automates those steps.
You got /7 concepts.
Explain why choosing good locators is important in Selenium tests.
Imagine trying to find a friend in a crowd using a clear description versus a vague one.
You got /4 concepts.