What This Topic Covers
This topic focuses on the foundation of Selenium automation.
You will practice:
- Launching Chrome, Firefox, and Edge browsers
- Maximizing the browser
- Deleting browser cookies
- Opening URLs
- Understanding the difference between
close()andquit() - Using WebDriverManager
Starter Practice
Launch Browser → Open Google → Close Browser
Basic Practice Exercises (0–1 Year)
- Launch the Chrome browser and open Google.
- Launch the Firefox browser and open Google.
- Launch the Edge browser and open Google.
- Maximize the browser window after launch.
- Open a URL using the
get()method. - Open a URL using the
navigate().to()method. - Delete all cookies before opening a URL.
- Refresh the browser after page load.
- Navigate back and forward between pages.
- Close the browser using
close(). - Close the browser using
quit(). - Observe the difference between
close()andquit(). - Launch browser → Open Google → Close browser.
- Launch browser → Open Google → Quit browser.
- Launch the browser without maximizing the window.
- Relaunch the browser after closing it.
- Open the browser and validate the page title.
- Open the browser and validate the current URL.
- Verify that the browser opened successfully.
- Open the browser and wait for the page to load completely.
Intermediate Practice Exercises (1–3 Years)
- Launch the browser using WebDriverManager.
- Remove the local driver path and execute using WebDriverManager.
- Launch Chrome and Firefox using the same test.
- Launch the browser using a parameter value.
- Launch the browser using a configuration file.
- Launch the browser using a TestNG XML parameter.
- Delete cookies before login.
- Handle browser notifications.
- Launch the browser in Incognito Mode.
- Launch the browser in Headless Mode.
- Launch the browser with a custom window size.
- Launch the browser with browser extensions disabled.
- Open a secure HTTPS website.
- Launch an internal application.
- Validate the browser type.
- Log the browser name.
- Capture the browser version.
- Execute multiple test cases.
- Close the browser after every test.
- Close the browser after suite execution.
Advanced Practice Exercises (3–5 Years)
- Launch the browser using a BaseTest class.
- Create a reusable browser setup method.
- Launch the browser across multiple test classes.
- Launch the browser only once for multiple tests.
- Execute browser tests in parallel.
- Launch multiple browsers simultaneously.
- Ensure one test does not close another browser.
- Implement browser management using ThreadLocal.
- Handle browser launch failures gracefully.
- Ensure the browser always quits even if a test fails.
- Launch the browser inside a CI environment.
- Execute browsers in Jenkins using Headless Mode.
- Pass the browser name from a Jenkins job.
- Launch browsers on Linux.
- Launch browsers on Windows.
- Handle browser crashes during execution.
- Restart the browser after a crash.
- Clean orphan browser instances.
- Optimize browser launch performance.
- Control the number of browser instances during execution.
Real-Time Defect and Failure Simulation Exercises
Practice troubleshooting by intentionally creating failures.
- Execute a test after a browser auto-update.
- Observe the driver mismatch failure.
- Fix the mismatch using WebDriverManager.
- Run a test without deleting cookies.
- Fix login issues by clearing cookies.
- Observe failures when
quit()is not used. - Monitor increased memory usage due to orphan browsers.
- Fix memory leaks using proper browser cleanup.
- Observe failures during parallel execution.
- Resolve parallel execution failures using ThreadLocal.
Interview-Level Practice Tasks
- Explain and demonstrate the browser setup flow.
- Modify an automation framework to support a new browser.
- Convert a single-browser framework into a cross-browser framework.
- Convert sequential execution into parallel execution.
- Debug a browser launch failure during an interview.
- Demonstrate the practical difference between
close()andquit().
Must-Do Final Practice
- Launch browser → Maximize → Delete cookies → Open Google → Close browser.
- Launch browser → Open Google → Quit browser.
- Launch Chrome, Firefox, and Edge individually.
- Launch browsers using only WebDriverManager.
- Launch browsers without hardcoding values.
- Execute the same test across multiple browsers.
- Execute the same test in parallel browsers.
- Execute the test in Headless Mode.
- Run the test in a Jenkins-like environment.
- Ensure all browser instances are properly closed after execution.
Site-Mapped Practice
Basic Practice
- Launch, open, and close browser → google.com
- Firefox maximize, open, and quit → google.com
- Edge launch and validation → example.com
get()andnavigate().to()→ wikipedia.org- Delete cookies and reload → amazon.in
- Refresh practice → demoqa.com
- Browser back and forward → demoqa.com and demoqa.com/login
- Close vs Quit using multiple Google tabs
Intermediate Practice
- Cross-browser execution → saucedemo.com
- WebDriverManager → example.com
- Delete cookies before login → saucedemo.com
- Browser from configuration → demoqa.com/login
- Browser using TestNG XML → demoqa.com
- Browser notifications → justdial.com
- Incognito mode → amazon.in
- Headless execution → the-internet.herokuapp.com
- Custom window size → selenium.dev
- Browser name and version → example.com
- Browser cleanup after each test → demoqa.com
Advanced Practice
- BaseTest implementation → saucedemo.com
- Browser reuse → demoqa.com
- ThreadLocal execution → demoqa.com
- Browser instance control → demoqa.com
- Browser launch optimization → google.com
- Memory cleanup validation → example.com
Failure Simulation
- Driver mismatch → google.com
- Cookie-based login issue → saucedemo.com
- Browser not closing → demoqa.com
- Parallel execution conflict → the-internet.herokuapp.com
- Jenkins-style Headless execution → example.com
Final Capstone Exercise
Exercise 36 — Complete Browser Setup Flow
Practice on saucedemo.com.
Implement the complete browser initialization flow using:
- Browser selection from Configuration or XML
- WebDriverManager
- Browser maximize
- Delete cookies
- Open application URL
- Parallel execution
- Proper browser cleanup using
quit()
This exercise combines every browser setup concept into one complete framework-style implementation.
FAQs
What is the practical difference between close() and quit()?
close() closes only the current browser window, whereas quit() terminates the complete browser session and closes every associated browser window.
Why should I practice WebDriverManager?
WebDriverManager automatically manages browser driver versions and eliminates driver mismatch issues that occur after browser updates.
Why is ThreadLocal important?
ThreadLocal allows each parallel test to maintain its own WebDriver instance, preventing browser conflicts during parallel execution.
Which websites should I use for practice?
Recommended practice websites include:
- google.com
- example.com
- wikipedia.org
- demoqa.com
- saucedemo.com
- the-internet.herokuapp.com
- amazon.in
Which exercise combines all browser setup concepts?
The Final Capstone Exercise combines configuration-driven browser launch, WebDriverManager, browser setup, parallel execution, and proper cleanup into one complete implementation.