{"id":1318,"date":"2025-11-04T13:04:12","date_gmt":"2025-11-04T13:04:12","guid":{"rendered":"https:\/\/razvanvancea.ro\/blog\/?p=1318"},"modified":"2025-11-27T11:10:18","modified_gmt":"2025-11-27T11:10:18","slug":"selectors-vs-locators-what-is-the-difference","status":"publish","type":"post","link":"https:\/\/razvanvancea.ro\/blog\/2025\/11\/04\/selectors-vs-locators-what-is-the-difference\/","title":{"rendered":"&#8216;selectors&#8217; vs. &#8216;locators&#8217; &#8211; what is the difference?"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div>\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"1318\" class=\"elementor elementor-1318\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-3d7ffa9 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"3d7ffa9\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-35ad601\" data-id=\"35ad601\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-d5d7088 elementor-widget elementor-widget-text-editor\" data-id=\"d5d7088\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Everyone who works in test automation probably heard or used the terms &#8216;selector&#8217; and &#8216;locator&#8217;. I was thinking, what is the difference between these two? They seem closely related, however they are not actually the same thing.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-59d8dbc elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"59d8dbc\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-b7446ce\" data-id=\"b7446ce\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-64752c6 elementor-widget elementor-widget-heading\" data-id=\"64752c6\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Locators<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ca06185 elementor-widget elementor-widget-text-editor\" data-id=\"ca06185\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>A locator is an abstraction that defines how your automation tool should find an element in the user interface.<br \/><br \/>We can think of it as an instruction or query that tells the automation engine &#8220;here is how to find the element I want to interact with&#8221;. Locators are part of the test framework&#8217;s API and usually wrap or reference a selector behind the scene.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-92c491d elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"92c491d\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-213c491\" data-id=\"213c491\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-0ea6f32 elementor-widget elementor-widget-text-editor\" data-id=\"0ea6f32\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Locator example (Selenium with Python)<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9bd11cc elementor-widget elementor-widget-image\" data-id=\"9bd11cc\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"640\" height=\"76\" src=\"https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-14.49.29.png\" class=\"attachment-large size-large wp-image-1320\" alt=\"locator-example\" srcset=\"https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-14.49.29.png.webp 800w, https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-14.49.29-300x36.png.webp 300w, https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-14.49.29-768x91.png.webp 768w, https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-14.49.29-24x3.png.webp 24w, https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-14.49.29-36x4.png.webp 36w, https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-14.49.29-48x6.png.webp 48w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-f19f8b0 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"f19f8b0\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-67e069d\" data-id=\"67e069d\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-1949bf7 elementor-widget elementor-widget-text-editor\" data-id=\"1949bf7\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>in the above example:<br \/>&#8211; <strong>By.ID<\/strong> is the locator strategy (a method for locating elements)<br \/>&#8211; <strong>&#8220;login-button&#8221;<\/strong> is the selector value<br \/>&#8211; Together, they form a <strong>locator<\/strong> that Selenium can use to find the element<br \/><br \/>In a nutshell:<br \/>A locator = (strategy + selector)<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-2dd8bab elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"2dd8bab\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-ce52c49\" data-id=\"ce52c49\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-b5219b9 elementor-widget elementor-widget-heading\" data-id=\"b5219b9\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Selectors<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-c858c43 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"c858c43\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-8a137bf\" data-id=\"8a137bf\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-3b5987e elementor-widget elementor-widget-text-editor\" data-id=\"3b5987e\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>A selector is a pattern or expression used to identify an element &#8211; commonly in the form of CSS selectors, XPath expressions, or accessibility attributes.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-d23f4c2 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"d23f4c2\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-4ce9aa3\" data-id=\"4ce9aa3\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-38ebbcf elementor-widget elementor-widget-text-editor\" data-id=\"38ebbcf\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Selectors describe what element you&#8217;re looking for within the DOM<br \/><br \/>CSS Selector examples<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-7b89da8 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"7b89da8\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-47acc87\" data-id=\"47acc87\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-184be16 elementor-widget elementor-widget-image\" data-id=\"184be16\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"356\" height=\"109\" src=\"https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-14.56.42.png\" class=\"attachment-large size-large wp-image-1321\" alt=\"\" srcset=\"https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-14.56.42.png.webp 356w, https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-14.56.42-300x92.png.webp 300w, https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-14.56.42-24x7.png 24w, https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-14.56.42-36x11.png 36w, https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-14.56.42-48x15.png 48w\" sizes=\"(max-width: 356px) 100vw, 356px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-f72f7a6 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"f72f7a6\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-6a0cfc5\" data-id=\"6a0cfc5\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-003e167 elementor-widget elementor-widget-text-editor\" data-id=\"003e167\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>XPath example<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-9dbcbb8 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"9dbcbb8\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-79c2ed7\" data-id=\"79c2ed7\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-108f073 elementor-widget elementor-widget-image\" data-id=\"108f073\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"433\" height=\"64\" src=\"https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-14.56.57.png\" class=\"attachment-large size-large wp-image-1322\" alt=\"\" srcset=\"https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-14.56.57.png.webp 433w, https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-14.56.57-300x44.png.webp 300w, https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-14.56.57-24x4.png.webp 24w, https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-14.56.57-36x5.png.webp 36w, https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-14.56.57-48x7.png.webp 48w\" sizes=\"(max-width: 433px) 100vw, 433px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-54c45cc elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"54c45cc\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-2ca292d\" data-id=\"2ca292d\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-70f64b3 elementor-widget elementor-widget-text-editor\" data-id=\"70f64b3\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Selectors come from web technologies, not from the automation framework itself. They&#8217;re a web standard and frameworks like Selenium, Playwright, etc use them under the hood to actually locate elements.<br \/><br \/>A locator wraps or uses a selector internally. When you write a locator, you&#8217;re telling the framework which selector type to use and how to apply it.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ceb29cd elementor-widget elementor-widget-heading\" data-id=\"ceb29cd\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Conclusion<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-f866770 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"f866770\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-1ab76f9\" data-id=\"1ab76f9\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-17afcf5 elementor-widget elementor-widget-image\" data-id=\"17afcf5\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"238\" src=\"https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-15.02.14.png\" class=\"attachment-large size-large wp-image-1323\" alt=\"locators-summary\" srcset=\"https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-15.02.14.png.webp 835w, https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-15.02.14-300x112.png.webp 300w, https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-15.02.14-768x286.png.webp 768w, https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-15.02.14-24x9.png.webp 24w, https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-15.02.14-36x13.png.webp 36w, https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Screenshot-2025-11-04-at-15.02.14-48x18.png.webp 48w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-e6daca9 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"e6daca9\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-2393d85\" data-id=\"2393d85\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-b403a56 elementor-widget elementor-widget-spacer\" data-id=\"b403a56\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"spacer.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-spacer\">\n\t\t\t<div class=\"elementor-spacer-inner\"><\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-41466e8 elementor-widget elementor-widget-text-editor\" data-id=\"41466e8\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Enjoyed this article? Make sure to subscribe to my\u00a0<em><a href=\"https:\/\/www.youtube.com\/@LearnwithRV\" target=\"_blank\" rel=\"noopener\">YouTube Channel<\/a><\/em>\u00a0for more Test Automation tutorials, and follow me on\u00a0<a href=\"https:\/\/www.linkedin.com\/in\/razvanvancea\/\" target=\"_blank\" rel=\"noopener\"><em>LinkedIn<\/em><\/a>\u00a0and\u00a0<em><a href=\"https:\/\/twitter.com\/razvanvancea\" target=\"_blank\" rel=\"noopener\">Twitter<\/a><\/em>\u00a0for regular insights.<span style=\"font-weight: bold;\"><br \/>Looking to improve your test automation skills?<br \/><\/span>I&#8217;ve created a<span style=\"font-weight: bold;\">\u00a0personalized 1-on-1 Mentoring program\u00a0<\/span>refined to<span style=\"font-weight: bold;\">\u00a0boost YOUR CURRENT skills.\u00a0<\/span>Reach out at\u00a0<a rel=\"noopener\">iamrv@razvanvancea.ro<\/a>\u00a0for more details and\u00a0<span style=\"font-weight: bold;\">together\u00a0<\/span>will create a<span style=\"font-weight: bold;\">\u00a0learning path\u00a0<\/span>adapted to\u00a0<span style=\"font-weight: bold;\">your skills and goals\u00a0<\/span>that you are aiming for<span style=\"font-weight: bold;\">,<\/span>\u00a0in a<span style=\"font-weight: bold;\">\u00a0timely-efficient manner\ud83d\ude80<\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Everyone who works in test automation probably heard or used the terms &#8216;selector&#8217; and &#8216;locator&#8217;&#8230;.<\/p>\n","protected":false},"author":2,"featured_media":1349,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[11],"tags":[],"class_list":["post-1318","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-qa"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"Everyone who works in test automation probably heard or used the terms \u2018selector\u2019 and \u2018locator\u2019. I was thinking, what is the difference between these two? They seem closely related, however they are not actually the same thing. Locators A locator is an abstraction that defines how your automation tool should find an element in the\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Razvan Vancea\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/razvanvancea.ro\/blog\/2025\/11\/04\/selectors-vs-locators-what-is-the-difference\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Learn with RV - Tech Blog - #testautomation #qa #programming #linux #devops\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\u2018selectors\u2019 vs. \u2018locators\u2019 \u2013 what is the difference? - Learn with RV - Tech Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"Everyone who works in test automation probably heard or used the terms \u2018selector\u2019 and \u2018locator\u2019. I was thinking, what is the difference between these two? They seem closely related, however they are not actually the same thing. Locators A locator is an abstraction that defines how your automation tool should find an element in the\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/razvanvancea.ro\/blog\/2025\/11\/04\/selectors-vs-locators-what-is-the-difference\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2025-11-04T13:04:12+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2025-11-27T11:10:18+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/razvanvancea\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@RazvanVancea\" \/>\n\t\t<meta name=\"twitter:title\" content=\"\u2018selectors\u2019 vs. \u2018locators\u2019 \u2013 what is the difference? - Learn with RV - Tech Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Everyone who works in test automation probably heard or used the terms \u2018selector\u2019 and \u2018locator\u2019. I was thinking, what is the difference between these two? They seem closely related, however they are not actually the same thing. Locators A locator is an abstraction that defines how your automation tool should find an element in the\" \/>\n\t\t<meta name=\"twitter:creator\" content=\"@RazvanVancea\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/2025\\\/11\\\/04\\\/selectors-vs-locators-what-is-the-difference\\\/#blogposting\",\"name\":\"\\u2018selectors\\u2019 vs. \\u2018locators\\u2019 \\u2013 what is the difference? - Learn with RV - Tech Blog\",\"headline\":\"&#8216;selectors&#8217; vs. &#8216;locators&#8217; &#8211; what is the difference?\",\"author\":{\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/author\\\/iamrv\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/11\\\/Copy-of-Copy-of-Copy-of-Copy-of-Your-paragraph-text.png\",\"width\":1920,\"height\":1080,\"caption\":\"s-vs-l\"},\"datePublished\":\"2025-11-04T13:04:12+00:00\",\"dateModified\":\"2025-11-27T11:10:18+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/2025\\\/11\\\/04\\\/selectors-vs-locators-what-is-the-difference\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/2025\\\/11\\\/04\\\/selectors-vs-locators-what-is-the-difference\\\/#webpage\"},\"articleSection\":\"QA\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/2025\\\/11\\\/04\\\/selectors-vs-locators-what-is-the-difference\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/category\\\/qa\\\/#listItem\",\"name\":\"QA\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/category\\\/qa\\\/#listItem\",\"position\":2,\"name\":\"QA\",\"item\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/category\\\/qa\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/2025\\\/11\\\/04\\\/selectors-vs-locators-what-is-the-difference\\\/#listItem\",\"name\":\"&#8216;selectors&#8217; vs. &#8216;locators&#8217; &#8211; what is the difference?\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/2025\\\/11\\\/04\\\/selectors-vs-locators-what-is-the-difference\\\/#listItem\",\"position\":3,\"name\":\"&#8216;selectors&#8217; vs. &#8216;locators&#8217; &#8211; what is the difference?\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/category\\\/qa\\\/#listItem\",\"name\":\"QA\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/#person\",\"name\":\"RV\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/2025\\\/11\\\/04\\\/selectors-vs-locators-what-is-the-difference\\\/#personImage\",\"url\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/wp-content\\\/litespeed\\\/avatar\\\/91ce41471f9ba5f15b3ef99e7deed87c.jpg?ver=1785997097\",\"width\":96,\"height\":96,\"caption\":\"RV\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/razvanvancea\\\/\",\"https:\\\/\\\/twitter.com\\\/RazvanVancea\",\"https:\\\/\\\/www.youtube.com\\\/@LearnwithRV\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/razvanvancea\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/author\\\/iamrv\\\/#author\",\"url\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/author\\\/iamrv\\\/\",\"name\":\"Razvan Vancea\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/2025\\\/11\\\/04\\\/selectors-vs-locators-what-is-the-difference\\\/#authorImage\",\"url\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/wp-content\\\/litespeed\\\/avatar\\\/356548feb901191539c03dd4a0498f58.jpg?ver=1785997099\",\"width\":96,\"height\":96,\"caption\":\"Razvan Vancea\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/2025\\\/11\\\/04\\\/selectors-vs-locators-what-is-the-difference\\\/#webpage\",\"url\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/2025\\\/11\\\/04\\\/selectors-vs-locators-what-is-the-difference\\\/\",\"name\":\"\\u2018selectors\\u2019 vs. \\u2018locators\\u2019 \\u2013 what is the difference? - Learn with RV - Tech Blog\",\"description\":\"Everyone who works in test automation probably heard or used the terms \\u2018selector\\u2019 and \\u2018locator\\u2019. I was thinking, what is the difference between these two? They seem closely related, however they are not actually the same thing. Locators A locator is an abstraction that defines how your automation tool should find an element in the\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/2025\\\/11\\\/04\\\/selectors-vs-locators-what-is-the-difference\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/author\\\/iamrv\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/author\\\/iamrv\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/11\\\/Copy-of-Copy-of-Copy-of-Copy-of-Your-paragraph-text.png\",\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/2025\\\/11\\\/04\\\/selectors-vs-locators-what-is-the-difference\\\/#mainImage\",\"width\":1920,\"height\":1080,\"caption\":\"s-vs-l\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/2025\\\/11\\\/04\\\/selectors-vs-locators-what-is-the-difference\\\/#mainImage\"},\"datePublished\":\"2025-11-04T13:04:12+00:00\",\"dateModified\":\"2025-11-27T11:10:18+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/\",\"name\":\"Learn with RV - Tech Blog\",\"description\":\"#testautomation #qa #programming #linux #devops\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/razvanvancea.ro\\\/blog\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\u2018selectors\u2019 vs. \u2018locators\u2019 \u2013 what is the difference? - Learn with RV - Tech Blog","description":"Everyone who works in test automation probably heard or used the terms \u2018selector\u2019 and \u2018locator\u2019. I was thinking, what is the difference between these two? They seem closely related, however they are not actually the same thing. Locators A locator is an abstraction that defines how your automation tool should find an element in the","canonical_url":"https:\/\/razvanvancea.ro\/blog\/2025\/11\/04\/selectors-vs-locators-what-is-the-difference\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/razvanvancea.ro\/blog\/2025\/11\/04\/selectors-vs-locators-what-is-the-difference\/#blogposting","name":"\u2018selectors\u2019 vs. \u2018locators\u2019 \u2013 what is the difference? - Learn with RV - Tech Blog","headline":"&#8216;selectors&#8217; vs. &#8216;locators&#8217; &#8211; what is the difference?","author":{"@id":"https:\/\/razvanvancea.ro\/blog\/author\/iamrv\/#author"},"publisher":{"@id":"https:\/\/razvanvancea.ro\/blog\/#person"},"image":{"@type":"ImageObject","url":"https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Copy-of-Copy-of-Copy-of-Copy-of-Your-paragraph-text.png","width":1920,"height":1080,"caption":"s-vs-l"},"datePublished":"2025-11-04T13:04:12+00:00","dateModified":"2025-11-27T11:10:18+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/razvanvancea.ro\/blog\/2025\/11\/04\/selectors-vs-locators-what-is-the-difference\/#webpage"},"isPartOf":{"@id":"https:\/\/razvanvancea.ro\/blog\/2025\/11\/04\/selectors-vs-locators-what-is-the-difference\/#webpage"},"articleSection":"QA"},{"@type":"BreadcrumbList","@id":"https:\/\/razvanvancea.ro\/blog\/2025\/11\/04\/selectors-vs-locators-what-is-the-difference\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/razvanvancea.ro\/blog#listItem","position":1,"name":"Home","item":"https:\/\/razvanvancea.ro\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/razvanvancea.ro\/blog\/category\/qa\/#listItem","name":"QA"}},{"@type":"ListItem","@id":"https:\/\/razvanvancea.ro\/blog\/category\/qa\/#listItem","position":2,"name":"QA","item":"https:\/\/razvanvancea.ro\/blog\/category\/qa\/","nextItem":{"@type":"ListItem","@id":"https:\/\/razvanvancea.ro\/blog\/2025\/11\/04\/selectors-vs-locators-what-is-the-difference\/#listItem","name":"&#8216;selectors&#8217; vs. &#8216;locators&#8217; &#8211; what is the difference?"},"previousItem":{"@type":"ListItem","@id":"https:\/\/razvanvancea.ro\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/razvanvancea.ro\/blog\/2025\/11\/04\/selectors-vs-locators-what-is-the-difference\/#listItem","position":3,"name":"&#8216;selectors&#8217; vs. &#8216;locators&#8217; &#8211; what is the difference?","previousItem":{"@type":"ListItem","@id":"https:\/\/razvanvancea.ro\/blog\/category\/qa\/#listItem","name":"QA"}}]},{"@type":"Person","@id":"https:\/\/razvanvancea.ro\/blog\/#person","name":"RV","image":{"@type":"ImageObject","@id":"https:\/\/razvanvancea.ro\/blog\/2025\/11\/04\/selectors-vs-locators-what-is-the-difference\/#personImage","url":"https:\/\/razvanvancea.ro\/blog\/wp-content\/litespeed\/avatar\/91ce41471f9ba5f15b3ef99e7deed87c.jpg?ver=1785997097","width":96,"height":96,"caption":"RV"},"sameAs":["https:\/\/www.facebook.com\/razvanvancea\/","https:\/\/twitter.com\/RazvanVancea","https:\/\/www.youtube.com\/@LearnwithRV","https:\/\/www.linkedin.com\/in\/razvanvancea"]},{"@type":"Person","@id":"https:\/\/razvanvancea.ro\/blog\/author\/iamrv\/#author","url":"https:\/\/razvanvancea.ro\/blog\/author\/iamrv\/","name":"Razvan Vancea","image":{"@type":"ImageObject","@id":"https:\/\/razvanvancea.ro\/blog\/2025\/11\/04\/selectors-vs-locators-what-is-the-difference\/#authorImage","url":"https:\/\/razvanvancea.ro\/blog\/wp-content\/litespeed\/avatar\/356548feb901191539c03dd4a0498f58.jpg?ver=1785997099","width":96,"height":96,"caption":"Razvan Vancea"}},{"@type":"WebPage","@id":"https:\/\/razvanvancea.ro\/blog\/2025\/11\/04\/selectors-vs-locators-what-is-the-difference\/#webpage","url":"https:\/\/razvanvancea.ro\/blog\/2025\/11\/04\/selectors-vs-locators-what-is-the-difference\/","name":"\u2018selectors\u2019 vs. \u2018locators\u2019 \u2013 what is the difference? - Learn with RV - Tech Blog","description":"Everyone who works in test automation probably heard or used the terms \u2018selector\u2019 and \u2018locator\u2019. I was thinking, what is the difference between these two? They seem closely related, however they are not actually the same thing. Locators A locator is an abstraction that defines how your automation tool should find an element in the","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/razvanvancea.ro\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/razvanvancea.ro\/blog\/2025\/11\/04\/selectors-vs-locators-what-is-the-difference\/#breadcrumblist"},"author":{"@id":"https:\/\/razvanvancea.ro\/blog\/author\/iamrv\/#author"},"creator":{"@id":"https:\/\/razvanvancea.ro\/blog\/author\/iamrv\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Copy-of-Copy-of-Copy-of-Copy-of-Your-paragraph-text.png","@id":"https:\/\/razvanvancea.ro\/blog\/2025\/11\/04\/selectors-vs-locators-what-is-the-difference\/#mainImage","width":1920,"height":1080,"caption":"s-vs-l"},"primaryImageOfPage":{"@id":"https:\/\/razvanvancea.ro\/blog\/2025\/11\/04\/selectors-vs-locators-what-is-the-difference\/#mainImage"},"datePublished":"2025-11-04T13:04:12+00:00","dateModified":"2025-11-27T11:10:18+00:00"},{"@type":"WebSite","@id":"https:\/\/razvanvancea.ro\/blog\/#website","url":"https:\/\/razvanvancea.ro\/blog\/","name":"Learn with RV - Tech Blog","description":"#testautomation #qa #programming #linux #devops","inLanguage":"en-US","publisher":{"@id":"https:\/\/razvanvancea.ro\/blog\/#person"}}]},"og:locale":"en_US","og:site_name":"Learn with RV - Tech Blog - #testautomation #qa #programming #linux #devops","og:type":"article","og:title":"\u2018selectors\u2019 vs. \u2018locators\u2019 \u2013 what is the difference? - Learn with RV - Tech Blog","og:description":"Everyone who works in test automation probably heard or used the terms \u2018selector\u2019 and \u2018locator\u2019. I was thinking, what is the difference between these two? They seem closely related, however they are not actually the same thing. Locators A locator is an abstraction that defines how your automation tool should find an element in the","og:url":"https:\/\/razvanvancea.ro\/blog\/2025\/11\/04\/selectors-vs-locators-what-is-the-difference\/","article:published_time":"2025-11-04T13:04:12+00:00","article:modified_time":"2025-11-27T11:10:18+00:00","article:publisher":"https:\/\/www.facebook.com\/razvanvancea","twitter:card":"summary_large_image","twitter:site":"@RazvanVancea","twitter:title":"\u2018selectors\u2019 vs. \u2018locators\u2019 \u2013 what is the difference? - Learn with RV - Tech Blog","twitter:description":"Everyone who works in test automation probably heard or used the terms \u2018selector\u2019 and \u2018locator\u2019. I was thinking, what is the difference between these two? They seem closely related, however they are not actually the same thing. Locators A locator is an abstraction that defines how your automation tool should find an element in the","twitter:creator":"@RazvanVancea"},"aioseo_meta_data":{"post_id":"1318","title":null,"description":null,"keywords":null,"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"BlogPosting","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":{"faqs":[],"keyPoints":[],"titles":[],"descriptions":[],"socialPosts":{"email":[],"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"created":"2025-11-04 12:02:01","updated":"2025-11-27 11:12:31","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/razvanvancea.ro\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/razvanvancea.ro\/blog\/category\/qa\/\" title=\"QA\">QA<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t\u2018selectors\u2019 vs. \u2018locators\u2019 \u2013 what is the difference?\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/razvanvancea.ro\/blog"},{"label":"QA","link":"https:\/\/razvanvancea.ro\/blog\/category\/qa\/"},{"label":"&#8216;selectors&#8217; vs. &#8216;locators&#8217; &#8211; what is the difference?","link":"https:\/\/razvanvancea.ro\/blog\/2025\/11\/04\/selectors-vs-locators-what-is-the-difference\/"}],"jetpack_featured_media_url":"https:\/\/razvanvancea.ro\/blog\/wp-content\/uploads\/2025\/11\/Copy-of-Copy-of-Copy-of-Copy-of-Your-paragraph-text.png","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/razvanvancea.ro\/blog\/wp-json\/wp\/v2\/posts\/1318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/razvanvancea.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/razvanvancea.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/razvanvancea.ro\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/razvanvancea.ro\/blog\/wp-json\/wp\/v2\/comments?post=1318"}],"version-history":[{"count":10,"href":"https:\/\/razvanvancea.ro\/blog\/wp-json\/wp\/v2\/posts\/1318\/revisions"}],"predecessor-version":[{"id":1352,"href":"https:\/\/razvanvancea.ro\/blog\/wp-json\/wp\/v2\/posts\/1318\/revisions\/1352"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/razvanvancea.ro\/blog\/wp-json\/wp\/v2\/media\/1349"}],"wp:attachment":[{"href":"https:\/\/razvanvancea.ro\/blog\/wp-json\/wp\/v2\/media?parent=1318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/razvanvancea.ro\/blog\/wp-json\/wp\/v2\/categories?post=1318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/razvanvancea.ro\/blog\/wp-json\/wp\/v2\/tags?post=1318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}