{"id":33396,"date":"2021-12-17T09:51:39","date_gmt":"2021-12-17T17:51:39","guid":{"rendered":"https:\/\/app14743.cloudwayssites.com\/?p=33396"},"modified":"2022-05-20T11:01:47","modified_gmt":"2022-05-20T18:01:47","slug":"why-visual-locators-not-selectors-in-tests","status":"publish","type":"post","link":"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/","title":{"rendered":"Why You Should Use Visual AI Locators Instead of Fragile Selectors in Your Tests"},"content":{"rendered":"\n<p><em>In this step-by-step tutorial, learn how to use visual locators to target anything you need to test in your application and how it can help you create tests that are more resilient and robust.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-the-challenge-of-testing-using-traditional-selectors\">The Challenge of Testing Using Traditional Selectors<\/h2>\n\n\n\n<p>As a test engineer, you&#8217;re certainly used to writing selectors to target the specific things you are interacting with in your tests. Lots of them. Selectors are critical to test exactly what you&#8217;re aiming for, but there are challenges. Not only do you usually have to write quite a lot of them, but in some cases an obvious selector doesn&#8217;t even exist and you&#8217;ll need to rig up a creative workaround. You can do it, but that kind of workaround is typically fragile and can easily break as the application develops.<\/p>\n\n\n\n<p>Needless to say this is frustrating when it happens. And that it happens more than we&#8217;d all like.<\/p>\n\n\n\n<p>There are some cases where traditional selectors work quite well, of course. But in certain complex or atypical situations, there is another option that works better &#8211; visual locators.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Use Visual AI Locators as an Alternative to Fragile Selectors?<\/h2>\n\n\n\n<p>If you&#8217;re using an automated visual testing platform that offers visual locators, such as <a href=\"https:\/\/app14743.cloudwayssites.com\/\">Applitools<\/a>, you can solve this problem immediately. Visual locators can replace these fragile selectors and give us a more robust way of targeting something we need to test.<\/p>\n\n\n\n<p>Essentially, rather than hard-coding one (or many) atypical selector(s) that will be difficult to track and maintain, Applitools visual locators let you select something just by &#8220;looking&#8221; to see if it is there on the screen. Applitools is able to do this thanks to an industry-leading <a href=\"https:\/\/app14743.cloudwayssites.com\/applitools-ai-and-deep-learning\/\">Visual AI<\/a> that has been trained on over a billion images to an accuracy level of 99.9999%.<\/p>\n\n\n\n<p>Let&#8217;s walk through how you can use Applitools visual locators to make your testing simpler and avoid hacking together non-standard selectors. You can check out our quick video tutorial below, or read on as we explain it.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Note: This walkthrough assumes some basic familiarity with Applitools. If you&#8217;re new to Applitools, feel free to <a href=\"https:\/\/auth.applitools.com\/users\/register\">grab a free account<\/a> and explore <a href=\"https:\/\/app14743.cloudwayssites.com\/docs\/index.html\">the docs<\/a>, or you can always <a href=\"https:\/\/app14743.cloudwayssites.com\/contact\/\">reach out<\/a> with any questions or <a href=\"https:\/\/app14743.cloudwayssites.com\/blg-request-demo\">schedule a quick demo<\/a>.<\/p><\/blockquote>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-vimeo wp-block-embed-vimeo wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"How to Use Visual Locators\" src=\"https:\/\/player.vimeo.com\/video\/657517381?h=9fc51b376e&amp;dnt=1&amp;app_id=122963\" width=\"1160\" height=\"653\" frameborder=\"0\" allow=\"autoplay; fullscreen; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><figcaption>Video credit: Colby Fayock<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">How to Use Applitools Visual Locators<\/h2>\n\n\n\n<p>When writing tests, typically we need some selector in order to target exactly what we want to click or interact with, but an obvious selector doesn&#8217;t always exist. For example, take a look at this LinkedIn logo in a typical log-in screen.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"705\" height=\"395\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/linkedin-logo-no-selector.jpg\" alt=\"\" class=\"wp-image-33400\" srcset=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/linkedin-logo-no-selector.jpg 705w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/linkedin-logo-no-selector-300x168.jpg 300w\" sizes=\"(max-width: 705px) 100vw, 705px\" \/><\/figure>\n\n\n\n<p>To select this, you would have to come up with some kind of creative selector, which doesn&#8217;t make a lot of sense, and it can often be fragile and break really easily as the application is being developed.<\/p>\n\n\n\n<p>Instead, we can use <a href=\"https:\/\/app14743.cloudwayssites.com\/docs\/features\/visual-locators.html\">visual locators in Applitools<\/a> to actually select the visual area that we want to interact with. <\/p>\n\n\n\n<p>To do this, you first need to create a new test. Let&#8217;s start off by going to the page and creating a check for the page that we actually want to interact with.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"706\" height=\"396\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/create-a-check.jpg\" alt=\"\" class=\"wp-image-33401\" srcset=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/create-a-check.jpg 706w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/create-a-check-300x168.jpg 300w\" sizes=\"(max-width: 706px) 100vw, 706px\" \/><\/figure>\n\n\n\n<p>Once we run the test, we can select and open it. We can now look inside of that check for our login page and see the LinkedIn logo.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"703\" height=\"394\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/linkedin-logo-in-applitools-test.jpg\" alt=\"\" class=\"wp-image-33402\" srcset=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/linkedin-logo-in-applitools-test.jpg 703w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/linkedin-logo-in-applitools-test-300x168.jpg 300w\" sizes=\"(max-width: 703px) 100vw, 703px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Inside the Applitools dashboard, we can find the visual locators tool. If we select that tool, we can then draw a visual locator by making a rectangle right around that LinkedIn logo and give it a name. Let&#8217;s just call it LinkedIn logo. Next we click add, and we&#8217;re done!<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"708\" height=\"398\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/linkedin-logo-visual-locator-label.jpg\" alt=\"\" class=\"wp-image-33403\" srcset=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/linkedin-logo-visual-locator-label.jpg 708w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/linkedin-logo-visual-locator-label-300x169.jpg 300w\" sizes=\"(max-width: 708px) 100vw, 708px\" \/><\/figure>\n\n\n\n<p>We now have a new visual locator created inside of our dashboard. If you have multiple visual locators in the future, there is also a Manage tab, where we can edit the name, or remove any visual locator we have made. Note that visual locators apply to a specific application, but that also means that you can use these locators across different tests in that application.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Target Your Visual Locator<\/h2>\n\n\n\n<p>Now that we have our visual locator and its associated name, we can target that area when we&#8217;re running our test. For example, let&#8217;s say we have a Selenium for Java test where we&#8217;re currently accessing the login window, but we want make sure if somebody clicks that LinkedIn logo that they&#8217;re going to actually be taken to LinkedIn. <\/p>\n\n\n\n<p>To start off, we want to make sure that we have the visual locator and the region packages actually imported into our project.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import com.applitools.eyes.locators.VisualLocator;\nimport com.applitools.eyes.Region;<\/code><\/pre>\n\n\n\n<p>Next, we&#8217;ll create a new map with a list of regions we can use to tell Eyes that we want to locate our visual locators with the name we chose (linkedIn-logo). Then we want to narrow that down to the actual regions of that locator. So we create locator regions, using those original locators to get the specific LinkedIn logo. Because we want to deal with one region instead of a list of regions, we&#8217;re going to use the <code>get<\/code> command, so that we can grab the zero index of our regions. We can use this region to get both the X and Y axis of where our LinkedIn logo is located inside of the page.<\/p>\n\n\n\n<p>We&#8217;ll use that region to find both our X and Y value, and use the <code>getLeft()<\/code> method and the <code>getTop()<\/code> method, along with the <code>width<\/code> and the <code>height<\/code> to calculate where exactly we want to click. In this instance, we&#8217;ll click right in the middle of the LinkedIn logo region, using the X and Y axes to target where I want to click. <\/p>\n\n\n\n<p>Here&#8217;s the code for all of that:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"705\" height=\"393\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/target-visual-click.jpg\" alt=\"\" class=\"wp-image-33404\" srcset=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/target-visual-click.jpg 705w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/target-visual-click-300x167.jpg 300w\" sizes=\"(max-width: 705px) 100vw, 705px\" \/><\/figure>\n\n\n\n<p>Next, we need to import the Selenium <code>Actions<\/code> interaction. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import org.openqa.selenium.interactions.Actions;<\/code><\/pre>\n\n\n\n<p>That will enable us to say that as soon as we perform that first check for the login window, we want to create new action where we move to that click location and actually click. Finally, we want to make sure we&#8217;re on the LinkedIn page. So I&#8217;m going to use Eyes to add another <code>check<\/code>, and add this tag as <code>LinkedIn<\/code>.<\/p>\n\n\n\n<p>Our final code will look like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"705\" height=\"399\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/action-and-second-check.jpg\" alt=\"\" class=\"wp-image-33405\" srcset=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/action-and-second-check.jpg 705w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/action-and-second-check-300x170.jpg 300w\" sizes=\"(max-width: 705px) 100vw, 705px\" \/><\/figure>\n\n\n\n<p>When we look inside of the Applitools dashboard now, we can see our new test. It will show unresolved because we&#8217;re adding a new screen to our UI. If we first open up our login window, we&#8217;ll see that it looks exactly the same and it&#8217;s still visually perfect. If we head over to the next screen, we can now see that it&#8217;s clicking over to LinkedIn, just like we wanted to, by using that visual locator.<\/p>\n\n\n\n<p>Once we click thumbs up inside of that checkpoint or inside of the main dashboard UI, we can go ahead and save our tests and then we&#8217;ll be ready to run the next test.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"705\" height=\"383\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/applitools-dashboard.jpg\" alt=\"\" class=\"wp-image-33419\" srcset=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/applitools-dashboard.jpg 705w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/applitools-dashboard-300x163.jpg 300w\" sizes=\"(max-width: 705px) 100vw, 705px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Learn More about Visual AI Locators<\/h2>\n\n\n\n<p>If you want to learn more about how you can take advantage of AI and visual locators in your tests by using Applitools, head over to the <a href=\"https:\/\/app14743.cloudwayssites.com\/docs\/index.html\">Applitools Docs<\/a>, where not only do we have a description of exactly what you can expect, but you&#8217;ll also find code examples for how you can use it inside of your next test. <\/p>\n\n\n\n<p>Happy testing!<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"has-text-align-center wp-block-heading\" id=\"h-get-started-today\">Get Started Today<\/h2>\n\n\n\n<p class=\"has-text-align-center\">Want to try Applitools Eyes for yourself? You can get started today at the link below &#8211; the account is free forever.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-horizontal is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-1 wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/auth.applitools.com\/users\/register\" target=\"_blank\" rel=\"noreferrer noopener\">Get My Free Account<\/a><\/div>\n<\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n<section class=\"article-group\">\n    <div class=\"is-row\">\n      <div class=\"title-bar\">\n      <div><\/div>\n    <\/div>      <div class=\"row\">\n                  <div class=\"col-md-6 col-lg-3\">\n            \t<div class=\"item \">\n\t\t<a href=\"https:\/\/app14743.cloudwayssites.com\/blog\/playwright-visual-testing-strategy\/\" >\n\t\t\t\t\t\t\t<picture class=\"image\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2026\/03\/Playwright-visual-testing-blog-384x242.jpg\" width=\"384\" height=\"242\" alt=\"\" loading=\"lazy\">\n\t\t\t\t<\/picture>\n\t\t\t\t\t\t<div class=\"content\">\n\t\t\t\t<h3 class=\"title\">Engineering a Playwright-Native Developer Experience: One Flag, Three Strategies<\/h3>\n\t\t\t\t\t\t\t\t\t<div class=\"meta\">\n\t\t\t\t\t\tArticles &mdash; 03.19.2026\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/a>\n\t<\/div>\n          <\/div>\n                    <div class=\"col-md-6 col-lg-3\">\n            \t<div class=\"item \">\n\t\t<a href=\"https:\/\/app14743.cloudwayssites.com\/blog\/applitools-forrester-wave-autonomous-testing-q4-2025\/\" >\n\t\t\t\t\t\t\t<picture class=\"image\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2026\/01\/Wave-blog-384x242.png\" width=\"384\" height=\"242\" alt=\"\" loading=\"lazy\">\n\t\t\t\t<\/picture>\n\t\t\t\t\t\t<div class=\"content\">\n\t\t\t\t<h3 class=\"title\">Applitools Named a Strong Performer in The Forrester Wave\u2122: Autonomous Testing Platforms Report, Q4 2025<\/h3>\n\t\t\t\t\t\t\t\t\t<div class=\"meta\">\n\t\t\t\t\t\tArticles &mdash; 01.20.2026\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/a>\n\t<\/div>\n          <\/div>\n                    <div class=\"col-md-6 col-lg-3\">\n            \t<div class=\"item \">\n\t\t<a href=\"https:\/\/app14743.cloudwayssites.com\/blog\/ai-testing-for-regulated-environments\/\" >\n\t\t\t\t\t\t\t<picture class=\"image\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2025\/12\/blog-251119-384x242.png\" width=\"384\" height=\"242\" alt=\"\" loading=\"lazy\">\n\t\t\t\t<\/picture>\n\t\t\t\t\t\t<div class=\"content\">\n\t\t\t\t<h3 class=\"title\">AI Testing in Regulated Environments: Smarter Testing Starts With Stability, Not More Code<\/h3>\n\t\t\t\t\t\t\t\t\t<div class=\"meta\">\n\t\t\t\t\t\tArticles &mdash; 12.04.2025\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/a>\n\t<\/div>\n          <\/div>\n                    <div class=\"col-md-6 col-lg-3\">\n            \t<div class=\"item \">\n\t\t<a href=\"https:\/\/app14743.cloudwayssites.com\/blog\/test-maintenance-at-scale-visual-ai\/\" >\n\t\t\t\t\t\t\t<picture class=\"image\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2025\/10\/251009-blog-384x242.png\" width=\"384\" height=\"242\" alt=\"\" loading=\"lazy\">\n\t\t\t\t<\/picture>\n\t\t\t\t\t\t<div class=\"content\">\n\t\t\t\t<h3 class=\"title\">Test Maintenance at Scale: How Visual AI Cuts Review Time and Flakiness<\/h3>\n\t\t\t\t\t\t\t\t\t<div class=\"meta\">\n\t\t\t\t\t\tArticles &mdash; 10.21.2025\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/a>\n\t<\/div>\n          <\/div>\n                <\/div>\n    <\/div>\n    <\/section>","protected":false},"excerpt":{"rendered":"<p>In this step-by-step tutorial, learn how to use visual locators to target anything you need to test in your application and how it can help you create tests that are more resilient and robust.<\/p>\n","protected":false},"author":108,"featured_media":33422,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[12271,10558],"tags":[12690,10821,16699,12686],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v24.5 (Yoast SEO v24.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Why to Use Visual AI Locators, Not Fragile Selectors, in Your Tests - AI-Powered End-to-End Testing | Applitools<\/title>\n<meta name=\"description\" content=\"Learn how to use visual locators to target anything you test in your application and how it can help you create tests that are more resilient and robust.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Why You Should Use Visual AI Locators Instead of Fragile Selectors in Your Tests\" \/>\n<meta property=\"og:description\" content=\"In this step-by-step tutorial, learn how to use visual locators to target anything you need to test in your application and how it can help you create tests that are more resilient and robust.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/\" \/>\n<meta property=\"og:site_name\" content=\"AI-Powered End-to-End Testing | Applitools\" \/>\n<meta property=\"article:published_time\" content=\"2021-12-17T17:51:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-05-20T18:01:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/Why-You-Should-Use-Visual-Locators-Instead-of-Fragile-Selectors-in-Your-Tests_831x542.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"831\" \/>\n\t<meta property=\"og:image:height\" content=\"542\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Danny Shain\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Danny Shain\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/\"},\"author\":{\"name\":\"Danny Shain\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/a12b404fb8296c1dd654d065eb68830b\"},\"headline\":\"Why You Should Use Visual AI Locators Instead of Fragile Selectors in Your Tests\",\"datePublished\":\"2021-12-17T17:51:39+00:00\",\"dateModified\":\"2022-05-20T18:01:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/\"},\"wordCount\":1230,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/Why-You-Should-Use-Visual-Locators-Instead-of-Fragile-Selectors-in-Your-Tests_831x542.jpg\",\"keywords\":[\"Test Engineers\",\"Tutorial\",\"Visual Locators\",\"Visual Testing Strategies\"],\"articleSection\":[\"Getting Started\",\"Product\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/\",\"name\":\"Why to Use Visual AI Locators, Not Fragile Selectors, in Your Tests - AI-Powered End-to-End Testing | Applitools\",\"isPartOf\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/Why-You-Should-Use-Visual-Locators-Instead-of-Fragile-Selectors-in-Your-Tests_831x542.jpg\",\"datePublished\":\"2021-12-17T17:51:39+00:00\",\"dateModified\":\"2022-05-20T18:01:47+00:00\",\"description\":\"Learn how to use visual locators to target anything you test in your application and how it can help you create tests that are more resilient and robust.\",\"breadcrumb\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/#primaryimage\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/Why-You-Should-Use-Visual-Locators-Instead-of-Fragile-Selectors-in-Your-Tests_831x542.jpg\",\"contentUrl\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/Why-You-Should-Use-Visual-Locators-Instead-of-Fragile-Selectors-in-Your-Tests_831x542.jpg\",\"width\":831,\"height\":542},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/app14743.cloudwayssites.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Getting Started\",\"item\":\"https:\/\/app14743.cloudwayssites.com\/blog\/category\/getting-started\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Why You Should Use Visual AI Locators Instead of Fragile Selectors in Your Tests\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#website\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/\",\"name\":\"Applitools Visual AI\",\"description\":\"Applitools delivers full end-to-end test automation with AI infused at every step.\",\"publisher\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/app14743.cloudwayssites.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#organization\",\"name\":\"Applitools\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/03\/applitools.png\",\"contentUrl\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/03\/applitools.png\",\"width\":156,\"height\":28,\"caption\":\"Applitools\"},\"image\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/a12b404fb8296c1dd654d065eb68830b\",\"name\":\"Danny Shain\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e33f3ad0a1f62f0ea8142ae71e74efe4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e33f3ad0a1f62f0ea8142ae71e74efe4?s=96&d=mm&r=g\",\"caption\":\"Danny Shain\"},\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/danielshain\/\"],\"url\":\"https:\/\/app14743.cloudwayssites.com\/blog\/author\/danny-shain\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Why to Use Visual AI Locators, Not Fragile Selectors, in Your Tests - AI-Powered End-to-End Testing | Applitools","description":"Learn how to use visual locators to target anything you test in your application and how it can help you create tests that are more resilient and robust.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/","og_locale":"en_US","og_type":"article","og_title":"Why You Should Use Visual AI Locators Instead of Fragile Selectors in Your Tests","og_description":"In this step-by-step tutorial, learn how to use visual locators to target anything you need to test in your application and how it can help you create tests that are more resilient and robust.","og_url":"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/","og_site_name":"AI-Powered End-to-End Testing | Applitools","article_published_time":"2021-12-17T17:51:39+00:00","article_modified_time":"2022-05-20T18:01:47+00:00","og_image":[{"width":831,"height":542,"url":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/Why-You-Should-Use-Visual-Locators-Instead-of-Fragile-Selectors-in-Your-Tests_831x542.jpg","type":"image\/jpeg"}],"author":"Danny Shain","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Danny Shain","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/#article","isPartOf":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/"},"author":{"name":"Danny Shain","@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/a12b404fb8296c1dd654d065eb68830b"},"headline":"Why You Should Use Visual AI Locators Instead of Fragile Selectors in Your Tests","datePublished":"2021-12-17T17:51:39+00:00","dateModified":"2022-05-20T18:01:47+00:00","mainEntityOfPage":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/"},"wordCount":1230,"commentCount":0,"publisher":{"@id":"https:\/\/app14743.cloudwayssites.com\/#organization"},"image":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/#primaryimage"},"thumbnailUrl":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/Why-You-Should-Use-Visual-Locators-Instead-of-Fragile-Selectors-in-Your-Tests_831x542.jpg","keywords":["Test Engineers","Tutorial","Visual Locators","Visual Testing Strategies"],"articleSection":["Getting Started","Product"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/","url":"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/","name":"Why to Use Visual AI Locators, Not Fragile Selectors, in Your Tests - AI-Powered End-to-End Testing | Applitools","isPartOf":{"@id":"https:\/\/app14743.cloudwayssites.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/#primaryimage"},"image":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/#primaryimage"},"thumbnailUrl":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/Why-You-Should-Use-Visual-Locators-Instead-of-Fragile-Selectors-in-Your-Tests_831x542.jpg","datePublished":"2021-12-17T17:51:39+00:00","dateModified":"2022-05-20T18:01:47+00:00","description":"Learn how to use visual locators to target anything you test in your application and how it can help you create tests that are more resilient and robust.","breadcrumb":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/#primaryimage","url":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/Why-You-Should-Use-Visual-Locators-Instead-of-Fragile-Selectors-in-Your-Tests_831x542.jpg","contentUrl":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2021\/12\/Why-You-Should-Use-Visual-Locators-Instead-of-Fragile-Selectors-in-Your-Tests_831x542.jpg","width":831,"height":542},{"@type":"BreadcrumbList","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/why-visual-locators-not-selectors-in-tests\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/app14743.cloudwayssites.com\/"},{"@type":"ListItem","position":2,"name":"Getting Started","item":"https:\/\/app14743.cloudwayssites.com\/blog\/category\/getting-started\/"},{"@type":"ListItem","position":3,"name":"Why You Should Use Visual AI Locators Instead of Fragile Selectors in Your Tests"}]},{"@type":"WebSite","@id":"https:\/\/app14743.cloudwayssites.com\/#website","url":"https:\/\/app14743.cloudwayssites.com\/","name":"Applitools Visual AI","description":"Applitools delivers full end-to-end test automation with AI infused at every step.","publisher":{"@id":"https:\/\/app14743.cloudwayssites.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/app14743.cloudwayssites.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/app14743.cloudwayssites.com\/#organization","name":"Applitools","url":"https:\/\/app14743.cloudwayssites.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/logo\/image\/","url":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/03\/applitools.png","contentUrl":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/03\/applitools.png","width":156,"height":28,"caption":"Applitools"},"image":{"@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/a12b404fb8296c1dd654d065eb68830b","name":"Danny Shain","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e33f3ad0a1f62f0ea8142ae71e74efe4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e33f3ad0a1f62f0ea8142ae71e74efe4?s=96&d=mm&r=g","caption":"Danny Shain"},"sameAs":["https:\/\/www.linkedin.com\/in\/danielshain\/"],"url":"https:\/\/app14743.cloudwayssites.com\/blog\/author\/danny-shain\/"}]}},"_links":{"self":[{"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/posts\/33396"}],"collection":[{"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/users\/108"}],"replies":[{"embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/comments?post=33396"}],"version-history":[{"count":0,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/posts\/33396\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/media\/33422"}],"wp:attachment":[{"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/media?parent=33396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/categories?post=33396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/tags?post=33396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}