[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-573299-105":3,"detail-sidebar-cat-1-en-105":80,"doc-detail-573299-en":126},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":73,"head_meta":75,"extra_data":77,"updated_unix":79},105,"en","locators-groups-102-reference-guide","Locators-Groups-1.0.2 - Reference Guide","","This document serves as a comprehensive reference guide for web element identification, focusing on the syntax and application of XPath and CSS selectors. It provides a structured overview of various locator strategies, including hierarchical navigation, attribute-based filtering, sibling selection, and advanced DOM traversal techniques. Designed for developers and automation engineers, the material offers a side-by-side comparison between XPath expressions and their corresponding CSS selector equivalents, facilitating efficient element targeting across diverse web document structures. The content encompasses essential selectors for complex DOM operations, such as handling disabled or checked states, table navigation, and index-based identification. By consolidating these selectors into logically grouped categories, the guide enables precise DOM manipulation, significantly enhancing the reliability and maintainability of web testing and scraping scripts through well-optimized selector definitions and clear structural examples.",{"@graph":14,"@context":72},[15,34,55],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/template/","Template",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/template/general/","General",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/template/locators-groups-102-reference-guide/573299/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/locators-groups-102-reference-guide/573299.png","ImageObject",442,249,{"name":42,"@type":43},"hdkawk","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-10-16","2026-10-14",true,{"@type":52,"interactionType":53,"userInteractionCount":30},"InteractionCounter",{"@type":54},"ViewAction",{"@type":56,"mainEntity":57},"FAQPage",[58,64,68],{"name":59,"@type":60,"acceptedAnswer":61},"What is the primary difference between XPath and CSS selectors when identifying elements?","Question",{"text":62,"@type":63},"XPath provides more powerful features like traversing the document tree in all directions, including upwards, whereas CSS selectors are generally faster and more concise for common hierarchical and attribute-based queries.","Answer",{"name":65,"@type":60,"acceptedAnswer":66},"How can one select a specific sibling in the DOM using these locators?",{"text":67,"@type":63},"The document outlines various sibling operators like following-sibling and preceding-sibling for XPath, and corresponding CSS pseudo-classes or combinators to precisely target adjacent or sequential elements in the document flow.",{"name":69,"@type":60,"acceptedAnswer":70},"Are there specific locators available for identifying form elements based on their state?",{"text":71,"@type":63},"Yes, the reference guide includes specific syntax for filtering elements based on states such as :disabled, :enabled, and :checked, which are critical for accurate interaction in web automation testing.","https://schema.org",{"og:url":32,"og:type":74,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":76,"canonical":32},"index,follow",{"doc_id":78,"site_id":7},573299,1792118881,{"code":4,"msg":81,"data":82},"success",[83,88,93,98,103,108,113,118,123],{"id":84,"doc_module":22,"doc_module_name":25,"category_name":85,"show_sort_weight":86,"slug":87},11,"Presentations",90,"presentations",{"id":89,"doc_module":22,"doc_module_name":25,"category_name":90,"show_sort_weight":91,"slug":92},12,"Resumes",80,"resumes",{"id":94,"doc_module":22,"doc_module_name":25,"category_name":95,"show_sort_weight":96,"slug":97},14,"Invoices",70,"invoices",{"id":99,"doc_module":22,"doc_module_name":25,"category_name":100,"show_sort_weight":101,"slug":102},15,"Posters",60,"posters",{"id":104,"doc_module":22,"doc_module_name":25,"category_name":105,"show_sort_weight":106,"slug":107},16,"Social Media",50,"social-media",{"id":109,"doc_module":22,"doc_module_name":25,"category_name":110,"show_sort_weight":111,"slug":112},17,"Forms",40,"forms",{"id":114,"doc_module":22,"doc_module_name":25,"category_name":115,"show_sort_weight":116,"slug":117},18,"Letters",30,"letters",{"id":119,"doc_module":22,"doc_module_name":25,"category_name":120,"show_sort_weight":121,"slug":122},21,"Paper Templates",5,"papers-templates",{"id":124,"doc_module":22,"doc_module_name":25,"category_name":29,"show_sort_weight":4,"slug":125},158,"general-158",{"code":4,"msg":81,"data":127},{"doc_id":78,"user_id":128,"nickname":42,"user_avatar":129,"doc_module":22,"category_id":124,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":11,"file_id":130,"file_url":131,"file_type":132,"file_size":133,"view_count":30,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":22,"language":134,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":135,"faqs":136,"seo_title":137,"seo_description":12,"update_tm":138,"read_time":4},3985747859855,"https://ap-avatar.wpscdn.com/davatar_276721f389ce27ea32af1340a28f341c","cbCaieCh3dlN3CDs","https://ap.wps.com/l/cbCaieCh3dlN3CDs","pdf",1511375,"English","# Hierarchical and Basic Locators\n## Root and Child Navigation\n## Attribute Selection\n# Advanced Element Identification\n## Sibling and Relative Positioning\n## State-Based Selection\n## Table and Complex Structure Traversal","[{\"question\":\"What is the primary difference between XPath and CSS selectors when identifying elements?\",\"answer\":\"XPath provides more powerful features like traversing the document tree in all directions, including upwards, whereas CSS selectors are generally faster and more concise for common hierarchical and attribute-based queries.\"},{\"question\":\"How can one select a specific sibling in the DOM using these locators?\",\"answer\":\"The document outlines various sibling operators like following-sibling and preceding-sibling for XPath, and corresponding CSS pseudo-classes or combinators to precisely target adjacent or sequential elements in the document flow.\"},{\"question\":\"Are there specific locators available for identifying form elements based on their state?\",\"answer\":\"Yes, the reference guide includes specific syntax for filtering elements based on states such as :disabled, :enabled, and :checked, which are critical for accurate interaction in web automation testing.\"}]","Locators-Groups-1.0.2 - Reference Guide | PDF",1791936770]