🌐
BrowserStack
browserstack.com › home › guide › css selectors cheat sheet (basic & advanced)
CSS Selectors Cheat Sheet (Basic & Advanced) | BrowserStack
March 20, 2025 - An exhaustive CSS Selectors Cheat Sheet with examples to help locate HTML elements for Browser Automation using Selenium.
🌐
testRigor
testrigor.com › home › blog › css selector vs xpath: your pocket cheat sheet
CSS Selector vs XPath: Your Pocket Cheat Sheet - testRigor AI-Based Automated Testing Tool
August 21, 2025 - We will also learn about two beneficial ... Selenium supports eight different types of locators: className, name, id, tagName, linkText, partialLinkText, XPath and CSS selector....
People also ask

What is XPath in Selenium?
XPath is a method where Selenium navigates via the HTML page structure. It lets the testers go through the XML document structure, which you can use on both XML and HTML documents.
🌐
testmuai.com
testmuai.com › testmu ai › blog › the most comprehensive selenium locators cheat sheet | testmu ai
The Most Comprehensive Selenium Locators Cheat Sheet | TestMu AI ...
Which is the best locator to use in Selenium?
Even though there are different types of locators in Selenium, many users prefer the Selenium ID locator to locate the needed WebElements on any page since it’s the fastest method. Selenium ID locators would be unique for each DOM element.
🌐
testmuai.com
testmuai.com › testmu ai › blog › the most comprehensive selenium locators cheat sheet | testmu ai
The Most Comprehensive Selenium Locators Cheat Sheet | TestMu AI ...
Which locator is faster CSS or XPath?
CSS selectors have a tendency to perform faster and reliably in comparison to XPath in the majority of the browsers. They are quite short and easier when you read them.
🌐
testmuai.com
testmuai.com › testmu ai › blog › the most comprehensive selenium locators cheat sheet | testmu ai
The Most Comprehensive Selenium Locators Cheat Sheet | TestMu AI ...
🌐
Ghost Inspector
ghostinspector.com › home › css selector cheat sheet for automated browser testing
CSS Selector Cheat Sheet for Automated Browser Testing
September 11, 2025 - XPath is supported by both Selenium and by Ghost Inspector, so this is a good option when matching an element by its text contents makes sense — which is fairly often. For more details on using XPath, check out our CSS to XPath Conversion Guide. And if you’d like to refer back to any of these tips, save our CSS Selector Cheat Sheet infographic below.
🌐
Automate The Planet
automatetheplanet.com › home › most exhaustive webdriver locators cheat sheet
Most Exhaustive WebDriver Locators Cheat Sheet
July 26, 2023 - So, I created the first and most exhaustive Selenium WebDriver cheat sheet dedicated to the locators. I hope that you will find it quite useful. Enjoy! Table of Contents · Default FindElement WebDriver Methods · Default FindsBy WebDriver Attributes · Complete XPath Locators' List · Complete CSS Selectors' List ·
🌐
Sauce Labs
saucelabs.com › home › blog › selenium tips: css selectors
Selenium Tips: CSS Selectors
April 2, 2023 - CSS selectors in Selenium allow us to navigate lists with more finesse than the above methods. If we have a ul and we want to select its fourth li element without regard to any other elements, we should use nth-child or nth-of-type. Nth-child ...
🌐
Cheat Sheets
cheat-sheets.org › saved-copy › Locators_table_1_0_2.pdf pdf
Category Recipe XPath (1.0 – 2.0) CSS (CSS1 – 3) DOM Selenium General
Sprinkled with Selenium usage tips, this is both a general-purpose set of recipes for each technology as well as a cross-reference to map from one to another.
Find elsewhere
🌐
Testmuai
testmuai.com › testmu ai › blog › the most comprehensive selenium locators cheat sheet | testmu ai
The Most Comprehensive Selenium Locators Cheat Sheet | TestMu AI (Formerly LambdaTest)
1 month ago - Li:nth-of-child: Index of the referenced child element in CSS selector. Our Selenium locators cheat sheet would be incomplete without talking about the Selenium relative locators. A major feature of Selenium 4 is relative locators. This helps you search different WebElements which you can relate to different elements.
🌐
BugBug
bugbug.io › blog › software testing
CSS Selector Cheat Sheet
November 19, 2025 - Use Cases: Grouping selectors to save time, using pseudo-classes to define element states, and refining layout. Automation: Essential for web scraping, testing frameworks, and automating tasks by locating elements in HTML/XML. Check also: 👉The Ultimate XPath Cheat Sheet · 👉Playwright Cheat Sheet · 👉Cypress Cheat Sheet · 👉Selenium Cheat Sheet · 🎯TL;DR - CSS Selector Cheat Sheet ·
🌐
Cheatography
cheatography.com › janesh › cheat-sheets › css-selectors-for-selenium-webdriver › pdf pdf
CSS Selectors for Selenium WebDriver Cheat Sheet
February 28, 2018 - CSS Selectors for Selenium WebDriver Cheat Sheet · by Janesh via cheatography.com/56285/cs/14924/ CSS Selector Reference · Selector · Example · Descri​ption · #id · #txtUs​‐ · ername · Select element with id="​txt​Use​rna​‐ · me" .class ·
🌐
Mozilla
quality.mozilla.org › 2013 › 03 › very-nice-xpath-and-css-selector-locator-cheat-sheet-for-selenium
Very nice xpath and css selector locator cheat sheet for Selenium | Mozilla Quality Assurance
December 6, 2025 - I was recently asked by a colleague for some advice on locators and I shared this cheat sheet with him. It contains just about everything you need to know for formulating locators for use with Selenium (and also Marionette), and includes syntax for both xpath and css selectors.
🌐
SmartBear
support.smartbear.com › crossbrowsertesting › docs › automated-testing › frameworks › selenium › about › css-selectors.html
CSS Selectors to XPath Cheatsheet | CrossBrowserTesting Documentation
November 3, 2025 - CSS Selectors to XPath Cheatsheet · Applies to CrossBrowserTesting SaaS, last modified on January 10, 2023 · CSS and XPath can both be used to denote locations in an XML document. These 2 syntaxes help guide your Selenium tests and allow automation to follow your well thought out test strategy.
🌐
BrowserStack
browserstack.com › home › guide › mastering selenium css selectors in 2026
CSS Selector in Selenium: Locate Elements with Examples | BrowserStack
December 10, 2025 - What is the difference between XPath and CSS selectors in Selenium? XPath supports navigating both forward and backward in the DOM, while CSS selectors allow only forward traversal. However, CSS selectors typically perform faster and are more concise, making them easier to maintain in most projects. ... An exhaustive CSS Selectors Cheat Sheet with examples to help locate HTML elements for Browser Autom...
🌐
Blogger
test-able.blogspot.com › 2016 › 04 › css-selectors-cheat-sheet.html
Test Automation For Manual Testers: CSS Selectors Cheat Sheet
January 10, 2026 - Find Elements That Are Preceded By Other Elements EXAMPLE input#search_category + input#globalQuery Finds the elements matched by input#globalQuery that are immediately preceded by elements matched by input#search_category.
🌐
AlmaBetter
almabetter.com › bytes › cheat-sheet › selenium
Selenium Cheat Sheet: Locators, Commands, Methods, Webdriver
August 5, 2025 - driver.find_element_by_css_selector("a:hover") This detailed Selenium cheat sheet serves as a quick reference for all the key concepts and commands you’ll need while working with Selenium WebDriver.
🌐
Reddit
reddit.com › r/cheatography › css selectors for selenium webdriver cheat sheet by janesh (2 pages) #programming #css
r/Cheatography on Reddit: CSS Selectors for Selenium WebDriver Cheat Sheet by Janesh (2 pages) #programming #css
May 20, 2018 - Share your best cheat sheets! ... Locked post. New comments cannot be posted. Share ... The CSS Selectors for Selenium WebDriver Cheat Sheet was released by Janesh on Cheatography.
🌐
Testmu
testmu.ai › testmu ai › blog › the ultimate css selectors cheat sheet you must know | testmu ai
The Ultimate CSS Selectors Cheat Sheet You Must Know | TestMu AI (Formerly LambdaTest)
January 21, 2025 - Read How Pro-Testers Use CSS Selectors In Selenium Automation Scripts? In this post, we will look at CSS selectors cheat sheet that will guide you in your web designing career and improve the methods you already use for selecting elements.
🌐
Codoid
codoid.com › selenium-testing › selenium-css-selectors-examples
Selenium CSS Selectors Examples - Codoid
February 4, 2022 - You can use the below CSS Selector to select a direct child under a parent node. ... Once you select a node, you can also jump to an adjacent sibling using the below selector. ... Using starts with to match attribute value. ... Matching a sub string in an attribute value. ... Using ends with to match attribute value. ... Basics of Selenium CSS Selector and XPath is a mandatory skill for a test automation engineer.
Address   TIDEL Park, 305, 3rd Floor, D-North, 4, Rajiv Gandhi Salai, Tharamani,, 600113, Chennai
🌐
BugBug
bugbug.io › blog › testing frameworks
Selenium Cheat Sheet: Commands and Locators
1 month ago - So whether you're a novice just diving into the realm of test automation or a seasoned automation engineer looking for a quick refresher, let this cheat sheet guide your WebDriver driver in the fast-paced world of web automation. Happy (automated) testing! ... A: A web element refers to any component or element on a web page, such as buttons, text boxes, drop-down lists, etc. Selenium provides methods to locate and interact with web elements. ... A: Selenium provides multiple methods to locate web elements, such as xpath, CSS selectors, class name, id, name, link text, and partial link text.