Selenium Python Interview Playbook
Not 300 questions. The 49 Selenium questions SDET interviews keep coming back to.
Answer the 49 Selenium Python questions SDET interviews keep coming back to, with Selenium 4 code and pytest.
Not 300 questions. The 49 Selenium questions SDET interviews keep coming back to, with clear answers, Python code and the mistakes to avoid.
- 46 pages
- 12 parts
- 49 questions
- Buy
- Instant download
- Prepare part by part
Selenium interviews have moved on. Many answers have not.
Common reasons testers lose marks:
- Using find_element_by_id, which was removed in Selenium 4.3.
- Downloading chromedriver by hand when Selenium Manager does it for you.
- Saying time.sleep when the interviewer wants explicit waits and expected conditions.
- Knowing Selenium but not pytest: fixtures, conftest.py, markers and parametrize.
Why 49 and not 300
Question banks with hundreds of entries spread your time thin and repeat the same idea in ten forms. These 49 are the questions SDET interviews keep returning to, each answered properly with Selenium 4 and pytest code. You prepare what you are most likely to be asked, and you prepare it well.
After this playbook you can
- Explain what happens between driver.find_element() and the browser, including WebDriver BiDi.
- Choose locators in a clear order and defend the choice of CSS or XPath.
- Handle waits, frames, windows, alerts, shadow DOM and JavaScript execution.
- Talk through a pytest framework with page objects, data-driven tests, API checks with requests, reports and CI.
- Compare Selenium and Playwright honestly when the interviewer asks which one to pick.
Look inside
The first 3 pages of 46, exactly as you get them. Swipe, then tap a page to enlarge it.
Buy to unlock all 46 pages
Full table of contents
All 12 parts and 49 questions, exactly as they appear in the PDF. Tap a part to see its questions.
Part 1. Selenium Architecture4 questions
- You call driver.find_element() in Python. Trace what happens between that line and the browser.
- A new joiner asks why the team never downloads chromedriver anymore. What do you tell them about Selenium Manager?
- Your team wants tests to react to browser events, like console errors, as they happen. Why is WebDriver BiDi the direction Selenium is taking?
- Your tests must run headless in CI, at a fixed window size, and not wait for slow ad scripts. How do you configure the browser?
Part 2. Python for Testers4 questions
- Your team is choosing between Java and Python for a new automation project. What makes Python a strong choice, and what is the trade-off?
- A test passes on your laptop but fails on a colleague's machine because of a different package version. How do you set up the Python environment so this stops?
- Your test dies with NoSuchElementException on one run and TimeoutException on the next. How should Selenium exceptions be handled in tests?
- You see @pytest.fixture and with blocks all over a test repo. Explain decorators and context managers using those examples.
Part 3. Locators5 questions
- Developers change the page layout and your locators break every sprint. Which locator strategies do you use, and in what order?
- Your lead says "never use XPath". Do you agree? Compare CSS selectors and XPath.
- An element's id looks like btn_83721 and changes on every page load. How do you locate it?
- A cookie consent button lives inside a shadow DOM, and find_element cannot see it. How do you reach it in Selenium 4?
- You must check that an error message is NOT shown. Why is find_elements the right call here, and not find_element?
Part 4. Waits and Synchronisation4 questions
- A button is in the DOM but stays disabled for two seconds. Why does an implicit wait not help, and what does?
- You need to wait until a spinner disappears and the Save button becomes clickable. Show how with WebDriverWait.
- Your framework sets a 10 second implicit wait and also uses explicit waits. Why do some failures take far longer than expected?
- You saved a table row element, sorted the table, and the next click throws an error. What happened, and how do you fix it?
Part 5. Browser Interactions5 questions
- A payment page loads its card form inside a frame and shows a confirm popup at the end. How do you automate both?
- Clicking "View invoice" opens a new tab. How do you check the invoice and come back to the first tab?
- A menu opens only on hover, and a card must be dragged into another column. Which Selenium feature handles this?
- A teammate fixed a failing click by switching to a JavaScript click. Is that a good fix? When should you use execute_script?
- A test must upload a resume and confirm that a report downloads. How do you automate both without touching the OS file dialog?
Part 6. pytest Essentials5 questions
- Every test file opens and closes its own browser with copied code. How do pytest fixtures and conftest.py remove that duplication?
- A browser per test is slow, but one shared browser makes tests leak into each other. How do fixture scopes and yield help you choose?
- You must test login with 12 username and password combinations. How do you do it without writing 12 tests?
- Before a release you want to run only the smoke tests. How do markers and pytest.ini make that possible?
- Your manager wants the same suite on Chrome, Firefox and Edge with no code changes. How do you pick the browser from the command line?
Part 7. Page Object Model and Framework Design4 questions
- The same login locators are copied into 25 test files, and one UI change broke all of them. How does the Page Object Model fix this in Python?
- Every page object repeats the same wait-then-click code. What would you move into a BasePage class, and what would you keep out?
- You are asked to set up a new Selenium Python framework from scratch. Walk me through the folders and why each one exists.
- The same tests must run on QA and staging with different URLs and users, and failures need clear logs. How do you handle config and logging?
Part 8. Test Data and Data-Driven Testing3 questions
- The business team wants to add new search test cases without touching Python code. How do you drive tests from a JSON or CSV file?
- Your client keeps test data in an Excel sheet and wants to keep it that way. How do you read it in pytest?
- Tests pass alone but fail in parallel because they all register the same email. How do you generate test data safely?
Part 9. API Testing with requests4 questions
- Before automating the UI, you want a fast check that the users API works. Write that check in Python.
- Every API call needs a bearer token, and logging in for each test is slow. How do you share the token across API tests?
- An API still returns 200, but a field the UI needs was renamed. How would a test catch this?
- Every UI test spends 8 seconds on the login form. How can the API skip that step?
Part 10. Reporting and Debugging4 questions
- Your manager wants a report after every run that anyone can open. Which reporting options do you use with pytest?
- A test fails at 3 a.m. in CI. How do you make sure a screenshot is already waiting for you in the morning?
- A test failed only on the CI Grid, and the screenshot looks normal. What other evidence do you collect?
- Your suite has 10 tests that fail at random, about once a week. How do you find and fix the causes?
Part 11. Parallel Runs, Grid, Docker and CI4 questions
- Your suite takes 50 minutes on one machine. How do you spread it across CPU cores with pytest-xdist, and what breaks when you do?
- You need the suite on Chrome and Firefox across several machines at once. How does Selenium Grid 4 help, and how does a test connect to it?
- Nobody wants to install and update browsers on the CI server. How do the official Selenium Docker images solve this?
- Your team wants smoke tests on every pull request and the full suite every night. What does the CI pipeline look like?
Part 12. Selenium, Playwright and AI3 questions
- Your team is starting a new web project. How would you compare Selenium and Playwright in front of the architect?
- Playwright is popular, yet you recommend Selenium for one project. When is that the right call?
- Your manager wants AI to write Selenium tests to save time. How do you use AI without lowering quality?
A real answer from the playbook
Developers change the page layout and your locators break every sprint. Which locator strategies do you use, and in what order?
- Prefer locators that are unique, stable and readable.
- Agree on id or data-testid attributes with developers for key elements.
- Use CSS for most cases and XPath when you need text or the DOM tree.
- Never use absolute XPath.
from selenium.webdriver.common.by import By
driver.find_element(By.ID, "email")
driver.find_element(By.NAME, "password")
driver.find_element(By.CSS_SELECTOR, "[data-testid='login-btn']")
driver.find_element(By.XPATH, "//button[text()='Sign in']")Remember: ID first, CSS for most things, XPath when you need text or the DOM tree.
Common mistake: Using find_element_by_id. It was deprecated in Selenium 4.0 and removed in 4.3.
Who it is for
This is for you if
- Testers interviewing for Selenium roles where tests are written in Python with pytest.
- Manual testers with some Python who are preparing for their first automation interview.
- Experienced Selenium testers who learnt on Selenium 3 and need current answers.
It is not for you if
- Your stack is Java. This playbook uses Python and pytest throughout.
- You want a video course. This is a reading and practice playbook.
What is inside
- In every answerShort points to say out loud, a small real code example, the one line to remember and the common mistake to avoid.
- Try it yourselfA hands-on task at the end of every part.
PDF, 46 pages. Works on phone and laptop.

From Jatin
Jatin Shharma
12+ years in test automation at Infosys, HERE Maps (originally Nokia Maps) and B2X. Client work for BMW and Audi, including self-parking car automation.
More about JatinQuestions
Why only 49 questions?
Long question banks spread your time thin. These are the 49 questions SDET interviews keep coming back to, each answered properly, so you prepare what you are most likely to be asked instead of skimming hundreds.
Who is it for?
Testers interviewing for Selenium roles where tests are written in Python with pytest.
Is it Selenium 4?
Yes. It covers Selenium Manager and WebDriver BiDi.
What format is it?
A PDF you can read on your phone or laptop and print if you like. The download link comes to your email and stays in My purchases.
Do I get updates?
Yes. Everyone who has it gets every update, and fresh links always download the newest version.
Is this generic content I can find online?
No. Every answer is written for the way SDET interviews are run: the points to say, the code to show, and the mistake that loses marks.
Give Selenium 4 answers in a Selenium 4 interview
49 questions, 12 parts, Python code in every answer and a task at the end of every part.