Skip to content
CodeKruPro

Practice

Selenium Python Assignments

Practice Selenium with 80 hands-on assignments, from opening Chrome through waits, frames, and a combined script. You need variables, strings, lists, dicts, functions, if, for, print, and the ability to read a short traceback.

  • 80 lessons
  • 17 modules
  • Beginner to Advanced
  • Lessons 1 to 12 free

Keep your progress

Signed-in learners keep solved lessons and a leaderboard rank. Lessons also work without an account.

Sign in to save progress

Getting Started

3 lessonsBeginner
  1. Open Chrome and Read the Page Title
  2. Visit Two Pages with driver.get()
  3. Go Back and Forward

Locators

9 lessonsBeginner
  1. Locate a Field with By.ID
  2. Locate a Field with By.NAME
  3. Locate a Field with By.CLASS_NAME
  4. Locate a Heading with By.TAG_NAME
  5. Match a Link with By.LINK_TEXT
  6. Match a Link with By.PARTIAL_LINK_TEXT
  7. Find Every Radio Button
  8. Two Elements Share One ID
  9. Fix a Locator That Does Not Exist

CSS and XPath Locators

5 lessonsBeginner
  1. Find Elements with CSS
  2. Match Attributes with CSS
  3. Find Elements with XPath
  4. Use contains and starts-with in XPath
  5. Move to a Parent with XPath

Web Element Interactions

7 lessonsBeginner
  1. Click a Button and Read the New Text
  2. Assert the Text You Just Read
  3. Type into a Text Field
  4. Clear a Field and Type Again
  5. Read Visible Text
  6. Read an Attribute
  7. Read a CSS Property

Checkboxes and Radio Buttons

4 lessonsIntermediate
  1. Select a Checkbox
  2. Clear a Checkbox That Starts Selected
  3. Choose One Radio in a Group
  4. Tell a Disabled Checkbox from an Enabled One

Dropdowns

6 lessonsIntermediate
  1. Choose a Dropdown Option by Visible Text
  2. Choose a Dropdown Option by Value
  3. Choose a Dropdown Option by Index
  4. List Every Dropdown Option
  5. Select and Deselect in a Multi-Select
  6. Read the Option That Is Already Selected

Element States

3 lessonsIntermediate
  1. Check Whether an Element Is Displayed
  2. Check Whether a Text Field Is Enabled
  3. Check Whether a Checkbox Is Selected

Waits

6 lessonsIntermediate
  1. Set an Implicit Wait
  2. Wait Until an Element Is Visible
  3. Wait Until a Button Is Clickable
  4. Wait Until an Element Disappears
  5. Wait for Two Elements That Appear at Different Times
  6. Diagnose a Wait That Times Out

Alerts and Popups

5 lessonsIntermediate
  1. Accept a Simple Alert
  2. Accept and Dismiss a Confirm
  3. Type into a Prompt
  4. Handle Two Alerts in a Row
  5. Read a Modal Without Treating It as an Alert

Frames

4 lessonsAdvanced
  1. Enter a Frame by ID with switch_to.frame
  2. Enter a Frame by Name with switch_to.frame
  3. Read a Nested Frame
  4. Return to the Top Document

Window Management

3 lessonsAdvanced
  1. Read the Open Window
  2. Open a Tab and Return to the Original Window
  3. Set the Window Size

Mouse and Keyboard

7 lessonsAdvanced
  1. Hover and Read the Color Change
  2. Double-Click a Button
  3. Right-Click a Button
  4. Drag a Box onto a Drop Zone
  5. Click and Hold a Box
  6. Select All and Replace Text with the Keyboard
  7. Type Uppercase with the Shift Key

JavaScript

5 lessonsAdvanced
  1. Read a Value with JavaScript
  2. Scroll an Element into View
  3. Click a Button through execute_script
  4. Change the Page with JavaScript
  5. Recover After an Element Goes Stale

Screenshots

2 lessonsAdvanced
  1. Save a Screenshot of the Viewport
  2. Save a Screenshot of One Element

Tables

4 lessonsAdvanced
  1. Read the Employee Table Headers
  2. Read Specific Cells from the Employee Table
  3. Count Employee Rows and Columns with len()
  4. Read Every Employee Row

Page Data

2 lessonsAdvanced
  1. Add, Read, and Delete a Cookie
  2. Search the Page Source

Structure

5 lessonsAdvanced
  1. Write a Function That Returns Element Text
  2. Quit the Browser with a Context Manager
  3. Build a One-File Page Object
  4. Drive a Dropdown from a List of Choices
  5. Combine a Wait, a Frame, and an Alert in One Script

Practice on TestKru

Explore the elements and interactions used in these assignments.

Open TestKru