--- title: "Testing Element Absence in Autify: Step-by-Step Guide | Autify" slug: "is-it-possible-to-test-the-absence-of-a-specific-element" description: "Learn How to Test for the Absence of a Specific Element for Effective Automation Testing in Autify. Start Your Free Trial!" updated: 2023-08-25T06:38:10Z published: 2023-08-25T06:38:10Z canonical: "help.autify.com/is-it-possible-to-test-the-absence-of-a-specific-element" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.autify.com/llms.txt > Use this file to discover all available pages before exploring further. # Is it possible to test the absence of a specific element? There are several ways to check that a certain element is not found. ## If the target is a string You can use the standard assertion command. Please click [here](/v1/docs/assertion-elements-on-the-page) for further information. ## If the target does not have a string ### If you want to check that an element does not exist on a page You can use a ***[[JS Step](/v1/docs/javascript-steps)]***. ``` var selector = ""; //Please replace var element = document.querySelector(selector); if (element) { throw new Error('Error: There is an element that shouldn’t exist (' + selector + ').'); } ```