Locators help you find your way to any element (a button, a text/para, image or just anything) on the web page!
In this edition, we cover locators, specifically Xpaths.
XPath or XML path uses a path notation (as in URLs) for navigating through the hierarchical structure of an XML/HTML document.
Table Of Contents
Looking for a start?
Web Element Locators For Test Automation
Have you ever struggled with locating elements on a web page when writing tests? Here’s a guide to help you out.
XPath features a wealth of functions, and it is documented in detail in Mozilla’s XPath documentation.
Identify Web Elements Using XPaths
How do you identify and construct XPaths for web elements?
Case-Insensitive XPath Query Search On XML Document In ASP.NET
Here’s how you can make XPaths using text case-insensitive [same can be applied for other languages]
XPath In Selenium With All Tactics And Examples [2021 Guide]
Locators of some elements change dynamically in the DOM. These locators must be capable of locating complex and dynamically changing web elements. Here are 15 tactics to write effective XPath locators.
CSS Selector Strategies For Automated Browser Testing
Walk through to the syntax, thoughts on when and why CSS selectors are useful.
Robust Locator Strategy: Custom Attributes For Test Automation
Add custom attributes for test automation directly into your front-end code to reduce test brittleness and simplify test automation framework.
Practical UI Test Automation – Locators And Asynchronous Loading
Jim Holmes gives some advice on how to start building smart, robust test harnesses, and some tools you might want to consider before you automate your UI tests.
Good practices for best results!
Best Practices For Choosing Locators For Selenium
What are some best practices to use when choosing a locator for an element.
Why You Shouldn’t Use ids In E2E Testing
Best practices of locating elements on E2E automated testing and a take on why you shouldn’t blindly use ids.
Appium Tip #18: How To Use XPath Locators Efficiently
Let’s take a look at different XPaths and some tricks you might find useful.
XPath vs CSS
CSS Vs XPath – 3 Parts
One of the most heated and subjective conversations is which locator strategy is better, often circling around two – XPath and CSS. Also, explains how XPaths are faster than CSS. A must read!
Catch Them If You Can : Quality Locators For Stable End 2 End Tests
CSS and Xpaths were never designed to be used for test automation. Why?
Tools and workarounds
Selenium Webdriver – IE Driver
Jim Evans comments on IE Driver being slow.
Smart Automation Locator Generator
Element locator generators that provide unique, relative & absolute XPath and CSS.
Salesforce Xpath Generator
A smart way to automate the Salesforce application.
SelectorsHub : Xpath Plugin
A free tool that lets you generate and verify XPaths and CSS selectors all in a matter of a few minutes!
Selenium 4 Relative Locators
Selenium 4 brings Relative Locators (originally named Friendly Locators). Angie Jones covers this functionality that was added to help you locate elements that are nearby other elements.
Automate your tests with reliable, self-healing locators!
Have you also wondered if stability of automated tests equates to better quality?
We are having a panel disussion on Does the stability of automated tests equate to better quality? with Lisette Zounon, Bas Dijkstra, Brijesh Deb and Srinivas Kantipudi.
Join us on the 27th of October!
Until next, see ya!