Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteUse cy.get(selector) to assert that an element exists: Cypress retries the query until it finds a match or the command times out. To wait for an element to disappear, use cy.get(selector).should('not.exist'). An explicit .should('exist') is usually unnecessary because cy.get() already has an implicit existence assertion.
Check that an element exists
Pass a selector to cy.get(). If Cypress finds a matching element, the command yields it; if not, Cypress retries until the configured command timeout is reached.
As an Amazon Associate I earn from qualifying purchases.
// Passes when a matching element exists
cy.get('[data-cy=notice]')
Use a dedicated test attribute such as data-cy when your application supports it. Cypress recommends these selectors because they are less likely to change when styling or visible text changes. See the cy.get() API documentation.
Free tools Windows power users keep installed
One-click scans. No signup required.
You can also write cy.get('[data-cy=notice]').should('exist'), but the extra assertion is generally redundant.
#1 Best Overall
Check that an element does not exist
Chain .should('not.exist') when the test should wait until an element is absent from the DOM. Cypress retries the query and assertion, making this useful for elements such as loading indicators that are removed after work finishes.
// Passes when the matching element is absent
cy.get('[data-cy=loading-spinner]').should('not.exist')
This checks DOM presence, not whether a person can see the element. If the element must be visible, use .should('be.visible') instead. Cypress distinguishes existence and visibility in its assertions guide.
Rank #2
Choose the assertion that matches the test
| Test intent | Pattern | What it checks |
|---|---|---|
| Element should exist | cy.get(selector) |
A matching element exists before the query completes. |
| Element should be absent | cy.get(selector).should('not.exist') |
The matching element is absent; Cypress retries the assertion. |
| Element should be visible | cy.get(selector).should('be.visible') |
The matching element satisfies Cypress’s visibility assertion. |
| Take different action depending on presence | Synchronous DOM inspection, only when the state has settled | A stable DOM snapshot can guide control flow; a changing snapshot cannot reliably do so. |
Use retries instead of one-time inspection
Cypress retries queries and chained .should() assertions while waiting for the condition to pass. A .then() callback, by contrast, runs once after its preceding command yields. Do not use it as a substitute for a retrying assertion when content is still loading or the DOM may change. See the cy.should() documentation.
The default wait comes from defaultCommandTimeout. For an individual query, you can provide a timeout option:
Rank #3
cy.get('[data-cy=notice]', { timeout: 10000 })
Set a longer timeout only when the application genuinely needs more time; an overly generous timeout can make failures slower to diagnose. The cy.get() documentation describes the command option and retry behavior.
Be careful with conditional checks
Checking the DOM and then branching can make a test flaky if the application may still render or update asynchronously. Cypress’s conditional testing guide says DOM-based branching is appropriate only when the state is known to have settled and cannot change. Prefer making the application deterministic or using another stable source of truth when possible.
Rank #4
A negative assertion also cannot prove that a transient element appeared earlier: .should('not.exist') may pass before that element ever enters the DOM. If the order matters, assert the intermediate state first, then assert its removal. Cypress demonstrates this sequencing for a saving message in the cy.contains() API documentation.
// First establish that the message appeared, then that it disappeared
cy.contains('Saving...').should('be.visible')
cy.contains('Saving...').should('not.exist')
Limits and common failures
- No matching element: Cypress keeps retrying, then fails when the timeout expires. Check the selector, confirm the relevant page state, and use a stable test attribute where available.
- Assertion passes too early: A negative assertion can pass before a transient element appears. Assert the expected earlier state first when sequence matters.
- Flaky conditional branch: The DOM may still be changing when inspected. Wait for a reliable settled state or avoid DOM-based branching.
- Element is present but not visible: Existence alone does not establish visibility. Assert
be.visiblewhen visibility is the requirement. - Element is inside an iframe:
cy.get()searches the application document and does not descend into iframe documents. Handle the iframe using an approach supported by your Cypress setup; the standard query does not search inside it.
Or skip the browser setup
If your task is to capture a page rather than test its DOM, ScreenshotNeo offers a screenshot API and MCP server. Its one-call API example is:
Quick Recap
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. Cookie banners, newsletter popups and chat widgets are removed before capture; bot checks, blank pages and failed loads are not billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. Sign up for free.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




