
Discover how web locators identify HTML elements on a page for automated testing and QA. Use browser developer tools and the console to locate and test elements across browsers.
Discover how the DOM maps HTML elements into a hierarchical family of parents, children, and siblings, and learn to inspect and use these relationships to access page elements.
Discover how the console serves as a testing tool to write and test locators, using querySelector with element IDs and CSS selectors to reference and verify HTML elements.
Web locators specify elements on a page for automated tests. Learn how replicators and applicators help your program locate the right element to click, read text, and enter data.
Learn how to craft good web locators that uniquely identify the target element, ensuring the locator refers to a single element so your script interacts with the correct page element.
Learn how HTML element IDs serve as the most reliable web locator when unique, and verify single matches with document.querySelectorAll and CSS selectors, focusing on input fields.
Use class names as web locators in HTML, noting they may not be unique or present. Choose robust selectors by ensuring uniqueness and stability, utilizing dot notation for classes.
Explore what XPath means and how it defines a path from the document body to a target element, using shortcuts and tools to avoid long, fragile paths.
Learn when to use XPath as a locator when no stable or unique id or class exists, and how to write an effective XPath efficiently.
Explore how to locate elements in the dom using xpath with concise one-line selectors, including the $x pattern, and learn why simple, unique paths beat long traversals.
Learn to refine XPath selectors by filtering anchor elements with their visible text, using 'request demo' to make a non-unique a tag uniquely identifiable.
Master ancestor and descendant axes in XPath to navigate between elements, locating targets by id or name and performing stepwise traversal from parent to child.
Explore following and preceding in XPath to locate elements relative to another in DOM. See how a label with text make can come after an element with a given id.
Explore how to identify and navigate sibling relationships in XPath, using following-sibling and preceding-sibling axes to move from a label to its related select element.
Web locators are very important in web automation, whether for test or any other purpose. Because everything in web development go for Automation now, including integration in CI/CD pipelines and nightly regression tests, so web locators are nowadays more important than ever.
To write a web locator, there's a selections of methods available. Engineers have developed many ways to write web locators. Because in different situations, one or the other web locator may be fit for a specific case. Web locators can depend on Id, a classname, a type, a name or some other property. In other cases, we may be obliged to use XPath. Don't worry, the definition of each of these as well as examples and use cases are covered within this course.
We learn in this course what a robust web locator means. How we can write robust web locators. We also learn how to choose the best locator between the different types available for use.
To learn more about me and my work background, please visit my personal page. There's other courses on this subject, but I give you the reasons why mine is best for you. First, I come from technical background and have applied the principles in this course many times. Second, I give you complete examples while we learn so that you can see how to actually use the material and excel it. Third, I am always available to answer your questions or inquiries. Please write me and I will always reply to you.
I made the course classified into small sections so you can in the future revisit only parts you need to review your knowledge about.
It's a fun course, so let's get started right away.