{"id":8478,"date":"2025-12-31T16:02:41","date_gmt":"2025-12-31T10:32:41","guid":{"rendered":"https:\/\/www.testleaf.com\/blog\/?p=8478"},"modified":"2025-12-31T16:07:00","modified_gmt":"2025-12-31T10:37:00","slug":"ai-self-healing-tests-fix-broken-ui-locators","status":"publish","type":"post","link":"https:\/\/www.testleaf.com\/blog\/ai-self-healing-tests-fix-broken-ui-locators\/","title":{"rendered":"AI in Automation: Fixing Broken Tests Automatically"},"content":{"rendered":"<div style=\"margin-top: 0px; margin-bottom: 0px;\" class=\"sharethis-inline-share-buttons\" ><\/div><!--[if lt IE 9]><script>document.createElement('audio');<\/script><![endif]-->\n<audio class=\"wp-audio-shortcode\" id=\"audio-8478-1\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio\/mpeg\" src=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/12\/AI-in-Automation-Fixing-Broken-Tests-Automatically.mp3?_=1\" \/><a href=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/12\/AI-in-Automation-Fixing-Broken-Tests-Automatically.mp3\">https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/12\/AI-in-Automation-Fixing-Broken-Tests-Automatically.mp3<\/a><\/audio>\n<p>&nbsp;<\/p>\n<p>Flaky UI tests have always been the villain in automation stories. They fail at 2 AM in CI, not because the feature is broken, but because some little CSS class or <a href=\"https:\/\/www.testleaf.com\/blog\/selenium-dom-properties-explained-fix-hidden-error-messages\/\"><strong>DOM<\/strong><\/a> structure changed. Traditionally, we fought this with better locators, better wait strategies, and better coding practices.<\/p>\n<p>Now, there\u2019s a new ally joining the fight: <a href=\"https:\/\/www.testleaf.com\/blog\/ai-self-healing-tests-fix-broken-ui-locators\/\"><strong>AI-assisted selector generation and self-healing tests<\/strong><\/a>.<\/p>\n<p>Imagine this: instead of you manually updating selectors after every UI tweak, your tool automatically figures out which element you <em>meant<\/em> to interact with and updates the selector for you. That\u2019s the promise of One Tool + AI.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"What_is_AI-assisted_selector_generation\"><\/span><strong>What is AI-assisted selector generation?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2><div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.testleaf.com\/blog\/ai-self-healing-tests-fix-broken-ui-locators\/#What_is_AI-assisted_selector_generation\" >What is AI-assisted selector generation?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.testleaf.com\/blog\/ai-self-healing-tests-fix-broken-ui-locators\/#What_does_%E2%80%9Cself-healing%E2%80%9D_mean_in_tests\" >What does \u201cself-healing\u201d mean in tests?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.testleaf.com\/blog\/ai-self-healing-tests-fix-broken-ui-locators\/#How_AI_decides_which_element_is_the_right_one\" >How AI decides which element is the right one<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.testleaf.com\/blog\/ai-self-healing-tests-fix-broken-ui-locators\/#Benefits_for_QA_teams\" >Benefits for QA teams<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.testleaf.com\/blog\/ai-self-healing-tests-fix-broken-ui-locators\/#Where_human_judgment_still_matters\" >Where human judgment still matters<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.testleaf.com\/blog\/ai-self-healing-tests-fix-broken-ui-locators\/#Designing_tests_for_an_AIselector_future\" >Designing tests for an AI+selector future<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.testleaf.com\/blog\/ai-self-healing-tests-fix-broken-ui-locators\/#Potential_risks_and_how_to_control_them\" >Potential risks and how to control them<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.testleaf.com\/blog\/ai-self-healing-tests-fix-broken-ui-locators\/#The_future_One_Tool_AI_as_your_automation_co-pilot\" >The future: One Tool + AI as your automation co-pilot<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.testleaf.com\/blog\/ai-self-healing-tests-fix-broken-ui-locators\/#FAQs\" >FAQs<\/a><\/li><\/ul><\/nav><\/div>\n\n<p>AI-assisted selector generation means your test tool uses <strong><a href=\"https:\/\/www.testleaf.com\/blog\/how-ai-and-machine-learning-is-changing-the-software-testing-landscape\/\">machine learning<\/a> and heuristics<\/strong> to:<\/p>\n<ul>\n<li>Analyze the page structure<\/li>\n<li>Understand element attributes (id, class, text, aria labels, position)<\/li>\n<li>Suggest the <strong>best locator<\/strong> for a given element<\/li>\n<li>Potentially auto-generate selectors that are more stable than naive XPaths<\/li>\n<\/ul>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-8482\" src=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/12\/AI-Assisted-Selector-Generation.jpeg\" alt=\"AI-Assisted Selector Generation\" width=\"1312\" height=\"736\" srcset=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/12\/AI-Assisted-Selector-Generation.jpeg 1312w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/12\/AI-Assisted-Selector-Generation-300x168.jpeg 300w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/12\/AI-Assisted-Selector-Generation-1024x574.jpeg 1024w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/12\/AI-Assisted-Selector-Generation-768x431.jpeg 768w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/12\/AI-Assisted-Selector-Generation-150x84.jpeg 150w\" sizes=\"(max-width: 1312px) 100vw, 1312px\" \/><\/p>\n<p>Instead of manually inspecting the DOM to decide how to locate a button, you can:<\/p>\n<ul>\n<li>Click on the element via a recorder or inspector<\/li>\n<li>Let the AI suggest a high-quality locator (e.g., based on role, text, data attributes, etc.)<\/li>\n<li>Optionally refine or approve it<\/li>\n<\/ul>\n<p>This can significantly speed up <strong>test authoring<\/strong>, especially for large and complex UIs.<\/p>\n<p><strong>More Insights:<\/strong> <a href=\"https:\/\/www.testleaf.com\/blog\/100-manual-testing-interview-questions-and-answers-2025\/\">manual testing interview questions<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"What_does_%E2%80%9Cself-healing%E2%80%9D_mean_in_tests\"><\/span><strong>What does \u201cself-healing\u201d mean in tests?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><strong>Self-healing<\/strong> tests are those that detect when a locator stops working and automatically attempt to:<\/p>\n<ol>\n<li>Find the <strong>intended element<\/strong> using other signals (text, relative position, nearby labels, previous DOM snapshots).<\/li>\n<li>Update the stored locator so future runs don\u2019t fail for the same reason.<\/li>\n<\/ol>\n<p><strong>Example scenario:<\/strong><\/p>\n<ul>\n<li>Original locator: \/\/button[@id=&#8217;loginBtn&#8217;]<\/li>\n<li>Dev changes the id to loginPrimaryButton but keeps text \u201cLogin\u201d and position similar.<\/li>\n<li>On the next run, the tool notices:\n<ul>\n<li>The element with id=&#8217;loginBtn&#8217; is gone.<\/li>\n<li>There is a button with similar characteristics (\u201cLogin\u201d text, same section, similar CSS).<\/li>\n<\/ul>\n<\/li>\n<li>The AI decides it\u2019s a <strong>high-confidence match<\/strong> and updates the locator.<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-8484\" src=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/12\/Self-Healing-Test-Flow-Real-Example.jpg\" alt=\"Self-Healing Test Flow (Real Example)\" width=\"1920\" height=\"1080\" srcset=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/12\/Self-Healing-Test-Flow-Real-Example.jpg 1920w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/12\/Self-Healing-Test-Flow-Real-Example-300x169.jpg 300w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/12\/Self-Healing-Test-Flow-Real-Example-1024x576.jpg 1024w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/12\/Self-Healing-Test-Flow-Real-Example-768x432.jpg 768w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/12\/Self-Healing-Test-Flow-Real-Example-1536x864.jpg 1536w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/12\/Self-Healing-Test-Flow-Real-Example-150x84.jpg 150w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<p>Result: the test doesn\u2019t break; it \u201cheals\u201d itself.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_AI_decides_which_element_is_the_right_one\"><\/span><strong>How AI decides which element is the right one<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>A good AI-based engine doesn\u2019t rely on just one signal. It typically looks at:<\/p>\n<ul>\n<li>Text content<\/li>\n<li>Tag type (button, input, link, etc.)<\/li>\n<li>Nearby elements and their text<\/li>\n<li>Attributes (id, name, data attributes, aria roles)<\/li>\n<li>DOM hierarchy and relative structure<\/li>\n<li>Historical snapshots of the page (if stored)<\/li>\n<\/ul>\n<p>It builds a <strong>fingerprint<\/strong> of the element and then uses that fingerprint to find the closest match when the original <a href=\"https:\/\/www.testleaf.com\/blog\/ai-powered-element-locators-selenium-automation\/\">locator<\/a> fails.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Benefits_for_QA_teams\"><\/span><strong>Benefits for <a href=\"https:\/\/www.testleaf.com\/blog\/12-best-ai-tools-for-automation-testing-in-2025-ultimate-guide-for-qa-teams\/\">QA teams<\/a><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Adopting AI-assisted selectors and self-healing can:<\/p>\n<ul>\n<li>Cut down <strong>maintenance effort<\/strong> after UI changes.<\/li>\n<li>Reduce <strong>false failures<\/strong> caused by locator breaks.<\/li>\n<li>Speed up <strong>test creation<\/strong> (less time spent manually crafting locators).<\/li>\n<li>Allow testers to focus more on <strong>test scenarios and coverage<\/strong>, instead of selector plumbing.<\/li>\n<\/ul>\n<p>This is especially valuable in fast-moving product teams where UI changes frequently.<\/p>\n<p><a href=\"https:\/\/ai-master-class.testleaf.com\/?utm_source=GenAI_Webinar&amp;utm_medium=Organic&amp;utm_campaign=GenAI_Webinar\"><img decoding=\"async\" class=\"aligncenter wp-image-7642 size-full\" src=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/11\/Gen-AI-Masterclass.png\" alt=\"Gen AI Masterclass\" width=\"2048\" height=\"512\" srcset=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/11\/Gen-AI-Masterclass.png 2048w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/11\/Gen-AI-Masterclass-300x75.png 300w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/11\/Gen-AI-Masterclass-1024x256.png 1024w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/11\/Gen-AI-Masterclass-768x192.png 768w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/11\/Gen-AI-Masterclass-1536x384.png 1536w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/11\/Gen-AI-Masterclass-150x38.png 150w\" sizes=\"(max-width: 2048px) 100vw, 2048px\" \/><\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Where_human_judgment_still_matters\"><\/span><strong>Where human judgment still matters<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>AI isn\u2019t magic. It can guess, but it doesn\u2019t fully understand business context. That means:<\/p>\n<ul>\n<li>Self-healing must have <strong>sensible limits<\/strong>:\n<ul>\n<li>Only update selectors when confidence is high.<\/li>\n<li>Prefer interactive review for critical flows (e.g., login, payments).<\/li>\n<\/ul>\n<\/li>\n<li>Testers should <strong>review and approve<\/strong> major changes to important locators.<\/li>\n<li>You still need a good baseline: stable hooks (data-testid, roles) make <a href=\"https:\/\/www.testleaf.com\/blog\/career-options-in-ai-top-high-demand-jobs-2026\/\">AI\u2019s job<\/a> easier.<\/li>\n<\/ul>\n<p>Think of AI as a <strong>super-helper<\/strong>, not a replacement for good test design.<\/p>\n<p><strong>Continue Reading:<\/strong> <a href=\"https:\/\/www.testleaf.com\/blog\/top-30-playwright-interview-questions-and-answers-2025-updated-guide\/\">playwright interview questions<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Designing_tests_for_an_AIselector_future\"><\/span><strong>Designing tests for an AI+selector future<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To get maximum value from <a href=\"https:\/\/www.testleaf.com\/blog\/are-you-really-evaluating-your-ai-tool-for-quality-engineering-the-right-way-discover-the-ultimate-25-point-checklist-for-2025\/\">AI-based tools<\/a>:<\/p>\n<ul>\n<li>Continue to use <strong>good test hooks<\/strong> (data-testid, roles, labels).<\/li>\n<li>Avoid anti-patterns like:\n<ul>\n<li>Random ids<\/li>\n<li>Overloaded classes (same class everywhere)<\/li>\n<\/ul>\n<\/li>\n<li>Keep tests <strong>modular<\/strong>, with locators centralized (Page Object \/ Screenplay \/ component-level abstractions).<\/li>\n<li>Leverage AI more for:\n<ul>\n<li>Suggesting initial locators<\/li>\n<li>Healing in low-risk areas<\/li>\n<li>Exploratory test creation<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Potential_risks_and_how_to_control_them\"><\/span><strong>Potential risks and how to control them<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Risks:<\/p>\n<ul>\n<li>The AI may sometimes pick the <strong>wrong element<\/strong> if the UI changes drastically.<\/li>\n<li>Silent updates can hide genuine issues.<\/li>\n<\/ul>\n<p>Mitigations:<\/p>\n<ul>\n<li>Enable <strong>logging<\/strong> for self-healing events.<\/li>\n<li>Review <a href=\"https:\/\/www.testleaf.com\/blog\/from-manual-qa-reports-to-automated-dashboards\/\">periodic reports<\/a>: which locators were auto-updated?<\/li>\n<li>For business-critical flows, configure \u201cask before healing\u201d or require manual acceptance of changes.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8485\" src=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/12\/Self-Healing-Risks-vs-Mitigations.jpg\" alt=\"Self-Healing Risks vs Mitigations\" width=\"1920\" height=\"1080\" srcset=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/12\/Self-Healing-Risks-vs-Mitigations.jpg 1920w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/12\/Self-Healing-Risks-vs-Mitigations-300x169.jpg 300w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/12\/Self-Healing-Risks-vs-Mitigations-1024x576.jpg 1024w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/12\/Self-Healing-Risks-vs-Mitigations-768x432.jpg 768w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/12\/Self-Healing-Risks-vs-Mitigations-1536x864.jpg 1536w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/12\/Self-Healing-Risks-vs-Mitigations-150x84.jpg 150w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"The_future_One_Tool_AI_as_your_automation_co-pilot\"><\/span><strong>The future: One Tool + AI as your automation co-pilot<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>We\u2019re moving towards an era where your automation stack is not just a tool, but a <strong>co-pilot<\/strong>:<\/p>\n<ul>\n<li>It helps you <strong>write tests faster<\/strong>.<\/li>\n<li>It keeps your <strong>locators healthy<\/strong> as the UI evolves.<\/li>\n<li>It surfaces smart insights: \u201cthese 10 tests frequently heal the same element \u2013 maybe the UI needs a better hook.\u201d<\/li>\n<\/ul>\n<p>When you combine <strong>strong foundational practices<\/strong> (good locators, test hooks, clear strategies in Selenium and Playwright) with <strong>AI-assisted selector generation and self-healing<\/strong>, you get the best of both worlds:<\/p>\n<ul>\n<li>Human clarity in test design.<\/li>\n<li>Machine efficiency in maintenance.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.testleaf.com\/blog\/is-playwright-automation-the-end-of-flaky-tests-heres-the-truth\/\">Flaky tests<\/a> may never disappear entirely, but with One Tool + AI, you can move from constantly fixing broken selectors to actually focusing on what matters: <strong>finding real bugs and shipping with confidence.<\/strong><\/p>\n<p>&nbsp;<\/p>\n<h2 data-start=\"6553\" data-end=\"6573\"><span class=\"ez-toc-section\" id=\"FAQs\"><\/span><strong>FAQs<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p data-start=\"6575\" data-end=\"6771\"><strong data-start=\"6575\" data-end=\"6610\">1) What are self-healing tests?<\/strong><br data-start=\"6610\" data-end=\"6613\" \/>Self-healing tests automatically recover when a locator breaks by finding the intended element using other signals, then updating the locator for future runs.<\/p>\n<p data-start=\"6773\" data-end=\"6962\"><strong data-start=\"6773\" data-end=\"6820\">2) What is AI-assisted selector generation?<\/strong><br data-start=\"6820\" data-end=\"6823\" \/>It\u2019s when a tool suggests stable locators by analyzing the page structure, attributes, roles, and text\u2014reducing reliance on brittle XPaths.<\/p>\n<p data-start=\"6964\" data-end=\"7127\"><strong data-start=\"6964\" data-end=\"7027\">3) Do self-healing tests remove the need for good locators?<\/strong><br data-start=\"7027\" data-end=\"7030\" \/>No. Stable hooks like <code data-start=\"7052\" data-end=\"7065\">data-testid<\/code>, roles, and labels make self-healing safer and more accurate.<\/p>\n<p data-start=\"7129\" data-end=\"7310\"><strong data-start=\"7129\" data-end=\"7178\">4) Can self-healing choose the wrong element?<\/strong><br data-start=\"7178\" data-end=\"7181\" \/>Yes, especially after major UI redesigns. That\u2019s why confidence thresholds, logs, and approvals for critical flows are important.<\/p>\n<p data-start=\"7312\" data-end=\"7507\"><strong data-start=\"7312\" data-end=\"7367\">5) How do I control self-healing in critical flows?<\/strong><br data-start=\"7367\" data-end=\"7370\" \/>Enable \u201cask before healing,\u201d require manual acceptance, and review auto-update reports for login, payments, and other high-risk journeys.<\/p>\n<p data-start=\"7509\" data-end=\"7694\"><strong data-start=\"7509\" data-end=\"7560\">6) What should I log when self-healing happens?<\/strong><br data-start=\"7560\" data-end=\"7563\" \/>Log the failed locator, the suggested match, confidence level, what changed, and the updated locator\u2014so teams can review and audit.<\/p>\n<p data-start=\"7696\" data-end=\"7845\"><strong data-start=\"7696\" data-end=\"7738\">7) When is self-healing most valuable?<\/strong><br data-start=\"7738\" data-end=\"7741\" \/>In fast-moving products where UI changes are frequent and locator maintenance consumes a lot of QA time.<\/p>\n<h5><strong>We Also Provide Training In:<\/strong><\/h5>\n<ul>\n<li><a href=\"https:\/\/www.testleaf.com\/course\/selenium-automation-certification-training-course.html?utm_source=blog_post&amp;utm_medium=Organic&amp;utm_campaign=Blog_Post\"><strong>Advanced Selenium Training<\/strong><\/a><\/li>\n<li><a href=\"https:\/\/www.testleaf.com\/course\/playwright.html?utm_source=blog-post&amp;utm_medium=Organic&amp;utm_campaign=Blog_Post\"><strong>Playwright Training<\/strong><\/a><\/li>\n<li><a href=\"https:\/\/www.testleaf.com\/course\/genai-qa-engineers-training-course.html?utm_source=blog-post&amp;utm_medium=Organic&amp;utm_campaign=Blog_Post\"><strong>Gen AI Training<\/strong><\/a><\/li>\n<li><a href=\"https:\/\/www.testleaf.com\/course\/aws-cloud-architect-certification-training-course.html?utm_source=blog-post&amp;utm_medium=Organic&amp;utm_campaign=Blog_Post\"><strong>AWS Training<\/strong><\/a><\/li>\n<li><a href=\"https:\/\/www.testleaf.com\/course\/rest-api-testing-certification-training-course.html?utm_source=blog-post&amp;utm_medium=Organic&amp;utm_campaign=Blog_Post\"><strong>REST API Training<\/strong><\/a><\/li>\n<li><a href=\"https:\/\/www.testleaf.com\/course\/full-stack-developer-certification-training-course.html?utm_source=blog-post&amp;utm_medium=Organic&amp;utm_campaign=Blog_Post\"><strong>Full Stack Training<\/strong><\/a><\/li>\n<li><a href=\"https:\/\/www.testleaf.com\/course\/appium-mobile-automation-certification-training-course.html?utm_source=blog-post&amp;utm_medium=Organic&amp;utm_campaign=Blog_Post\"><strong>Appium Training<\/strong><\/a><\/li>\n<li><a href=\"https:\/\/www.testleaf.com\/course\/dev-ops-master-certification-training-course.html?utm_source=blog-post&amp;utm_medium=Organic&amp;utm_campaign=Blog_Post\"><strong>DevOps Training<\/strong><\/a><\/li>\n<li><a href=\"https:\/\/www.testleaf.com\/course\/apache-jmeter-testing-training-course.html?utm_source=blog-post&amp;utm_medium=Organic&amp;utm_campaign=Blog_Post\"><strong>JMeter Performance Training<\/strong><\/a><\/li>\n<\/ul>\n<h6><strong>Author\u2019s Bio<\/strong>:<\/h6>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-6744 size-full alignleft\" src=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/09\/Kadhir.png\" sizes=\"(max-width: 200px) 100vw, 200px\" srcset=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/09\/Kadhir.png 200w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/09\/Kadhir-150x150.png 150w, https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/09\/Kadhir-96x96.png 96w\" alt=\"Kadhir\" width=\"200\" height=\"200\" \/><\/p>\n<p>Content Writer at Testleaf, specializing in SEO-driven content for test automation, software development, and cybersecurity. I turn complex technical topics into clear, engaging stories that educate, inspire, and drive digital transformation.<\/p>\n<p><strong>Ezhirkadhir Raja<\/strong><\/p>\n<p>Content Writer \u2013 Testleaf<\/p>\n<p><a href=\"http:\/\/linkedin.com\/in\/ezhirkadhir\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.testleaf.com\/blog\/wp-content\/uploads\/2025\/07\/linkedin.png\" alt=\"LinkedIn Logo\" width=\"28\" height=\"28\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Flaky UI tests have always been the villain in automation stories. They fail at 2 AM in CI, not because the feature is broken, but because some little CSS class or DOM structure changed. Traditionally, we fought this with better locators, better wait strategies, and better coding practices. Now, there\u2019s a new ally joining &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/www.testleaf.com\/blog\/ai-self-healing-tests-fix-broken-ui-locators\/\"> <span class=\"screen-reader-text\">AI in Automation: Fixing Broken Tests Automatically<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":8481,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"site-sidebar-layout":"default","site-content-layout":"default","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"categories":[775],"tags":[986,372,985,729,984],"class_list":["post-8478","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai","tag-agentic-ai","tag-ai","tag-ai-agents","tag-genai","tag-master-ai-agents"],"acf":[],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.testleaf.com\/blog\/wp-json\/wp\/v2\/posts\/8478","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testleaf.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.testleaf.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.testleaf.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testleaf.com\/blog\/wp-json\/wp\/v2\/comments?post=8478"}],"version-history":[{"count":3,"href":"https:\/\/www.testleaf.com\/blog\/wp-json\/wp\/v2\/posts\/8478\/revisions"}],"predecessor-version":[{"id":8489,"href":"https:\/\/www.testleaf.com\/blog\/wp-json\/wp\/v2\/posts\/8478\/revisions\/8489"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.testleaf.com\/blog\/wp-json\/wp\/v2\/media\/8481"}],"wp:attachment":[{"href":"https:\/\/www.testleaf.com\/blog\/wp-json\/wp\/v2\/media?parent=8478"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testleaf.com\/blog\/wp-json\/wp\/v2\/categories?post=8478"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testleaf.com\/blog\/wp-json\/wp\/v2\/tags?post=8478"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}