Selenium WebDriver 4

Like posts with the mouse and the keyboard

Easy30 pts
  • Scoped locators
  • Toggle buttons
  • Keyboard input
  • ARIA state
Practice app · ConnectIn

A professional network: a 3-step sign-up wizard, a feed with likes, comments and lazy-loaded posts, a notifications dropdown, a messaging drawer with auto-replies, job search with filters and a multi-step Easy Apply modal, member profiles with connect/withdraw, a skills tag input and company pages that open a careers site in a new tab.

Test URL
/lab/selenium-connectin-like-post

Your starter code already declares TEST_URL — never hardcode a host.

Objective

Like Maya Chen's post with a mouse click and Daniel Okafor's post with the keyboard, and verify each Like button is pressed and each like count went up by one.

Your Task

  1. 1Open TEST_URL (you are already signed in as Alex Morgan).
  2. 2In the post with data-post-id="p1" (Maya Chen), assert .like-count shows 128, then click its Like button (.like-button).
  3. 3Assert the button now has aria-pressed="true" and .like-count shows 129.
  4. 4In the post with data-post-id="p2" (Daniel Okafor), focus the Like button and press Enter — do not click it.
  5. 5Assert that post's .like-count shows 57 and exactly two Like buttons on the page are pressed.

Validation Checks

  • Post p1 is liked and shows 129 likes.
  • Post p2 is liked and shows 57 likes.
  • Exactly two posts are liked.
  • The test makes at least two assertions.

Fixtures

Email
alex@connectin.test
Password
Connect@2026
Account name
Alex Morgan
Password rules
8+ characters with an uppercase letter, a number and a special character
Locations
Bengaluru, India · Berlin, Germany · London, UK · New York, US · Toronto, Canada
Featured company
Northwind Labs (#/company/northwind-labs)

Cloud Execution & Grading Guide

This Easy Selenium Challenges exercise runs inside TargetQA's managed cloud sandbox using Selenium WebDriver 4 (Java, Python, C#). Every submission runs inside an isolated headless Chromium container with pre-synced drivers, capturing live console logs, DOM assertions, and a 720p step-by-step video replay.

  • Supported stacks: Java (Selenium 4 + JUnit 5) · Python (Selenium 4 + pytest) · C# (Selenium 4 + NUnit)
  • Zero local setup: Use the pre-declared TEST_URL variable so your script targets the live ConnectIn sandbox reliably without hardcoding hosts.
  • Automated grading: Click Run to inspect step logs and behavior, then click Submit to validate all 4 acceptance checks and earn 30 points.

Selenium WebDriver 4 · Selenium Challenges Practice Track · ConnectIn