Web Automation: Click‑by‑Click Quickstart (Public Demo Site)
Tags: web, guide, quickstart, selectors, assertions
This guide uses a public demo site that is safe for automation practice: - https://the-internet.herokuapp.com You will build a simple, high-signal test: - Navigate → Login → Verify success message A) Create the project 1. Switch to WEB mode (top header should clearly indicate WEB). 2. Workspace Explorer → New Project 3. Mode = WEB, Name = Demo_Web B) Create the suite 1. Project Explorer → right‑click project → New Suite 2. Name it: “Login - The Internet (Demo)” 3. Open Suite Editor C) Add steps (in the grid) Tip: Use stable selectors. Prefer IDs. Avoid long brittle XPaths. Suggested steps (conceptual): 1. Navigate - URL: https://the-internet.herokuapp.com/login 2. Type - Locator: #username - Text: tomsmith 3. Type - Locator: #password - Text: SuperSecretPassword! 4. Click - Locator: button[type='submit'] 5. Assert Text Present - Locator: #flash - Expected contains: “You logged into a secure area!” D) Run 1. Open Run panel 2. Select a browser (Chrome recommended) 3. Click Run Expected result - Status: PASS If it fails - “Element not found”: selector is wrong or page didn’t load. - Fix: confirm URL, confirm locator, add wait (if available) or slow down execution. - “StaleElementReferenceException”: modern apps re-render DOM. - Fix: re-find element and retry click (the generator already includes retry patterns). E) Practice variations (real learning happens here) 1) Negative login - Use wrong password and assert error message contains “Your password is invalid!” 2) Dynamic elements - Visit: https://the-internet.herokuapp.com/add_remove_elements/ - Add/Remove elements and assert count changes. 3) File upload - Visit: https://the-internet.herokuapp.com/upload - Upload a small file and assert success.
