---
description: In this tutorial, we look at commands that will make your automation script more intelligent and complete.
title: Verify Element Present &amp; waitFor Command in Selenium
image: https://www.guru99.com/images/verify-element-present-waitfor-command-in-selenium.png
---

 

[Skip to content](#main) 

**⚡ Smart Summary**

Verify element present and waitFor commands in Selenium IDE confirm that a page contains the elements and text a test expects, and pause playback until a dynamic condition becomes true before the next step runs.

* 🔘 **Element checks:** verifyElementPresent returns TRUE when the locator matches something on the page, and verifyElementNotPresent is its exact inverse.
* ☑️ **Text checks:** verifyTextPresent searches the whole page and is case-sensitive, so “Atlanta” never matches “atlanta”.
* ✅ **Position checks:** verifyElementPositionLeft and verifyElementPositionTop compare an element’s pixel offset from the page edge.
* 🧪 **Page loads:** andWait commands such as clickAndWait pause the script until a new page has finished loading.
* 🛠️ **Dynamic content:** waitFor commands wait for a condition instead of a page load, which suits AJAX screens that never reload.
* 📊 **Current IDE:** The browser extension renames these steps and gives every wait command its own millisecond timeout.

[ Read More ](javascript:void%280%29;) 

![Verify element present and waitFor command in Selenium IDE](https://www.guru99.com/images/verify-element-present-waitfor-command-in-selenium.png) 

A recorded [Selenium IDE](https://www.guru99.com/introduction-selenuim-ide.html) script clicks and types, but on its own it never decides whether the application behaved correctly. Two command families do that work: **verify** commands, which check the state of the page, and **wait** commands, which hold execution until the page is ready to be checked.

**⚠️ A note on versions:** the screenshots below come from the original Firefox-plugin Selenium IDE, which is no longer distributed, and they use its camelCase Selenese names. The current IDE is a Chrome, Firefox and Edge [browser extension](https://www.guru99.com/install-selenuim-ide.html). The behaviour described here still applies, but several command names changed — a mapping table appears later in this article, and every original command and screenshot is preserved exactly as published.

## Verify Presence of an Element

We can use following two commands to verify the presence of an element:

* **verifyElementPresent** – returns TRUE if the specified element was FOUND in the page; FALSE if otherwise
* **verifyElementNotPresent** – returns TRUE if the specified element was NOT FOUND anywhere in the page; FALSE if it is present.

Both commands take an element [locator](https://www.guru99.com/locators-in-selenium-ide.html) in the Target field — an id, a name, a CSS selector, a link text or an [XPath](https://www.guru99.com/xpath-selenium.html) expression — and neither needs a value.

The test script below verifies that the UserName text box is present within the Mercury Tours homepage while the First Name text box is not. The First Name text box is actually an element present in the Registration page of Mercury Tours, not in the homepage.

[](https://www.guru99.com/images/image003.png)

Because these are _verify_ commands rather than _assert_ commands, a failure is written to the log and the remaining steps still run. That distinction is covered in detail further down.

## Verify Presence of a Certain Text in Command in Selenium

Checking that an element exists is not always enough — a test often needs to confirm the words shown to the user. Two text commands cover that case.

* **verifyTextPresent** – returns TRUE if the specified text string was FOUND somewhere in the page; FALSE if otherwise
* **verifyTextNotPresent** – returns TRUE if the specified text string was NOT FOUND anywhere in the page; FALSE if it was found

Remember that these commands are case-sensitive.

The log below shows the same page checked twice with two spellings of the same phrase.

[](https://www.guru99.com/images/image004.png)

In the scenario above, “Atlanta to Las Vegas” was treated differently from “atlanta to Las Vegas” because the letter “A” of “Atlanta” was in uppercase on the first one while lowercase on the other. When the verifyTextPresent command was used on each of them, one passed while the other failed.

## Verify Specific Position of an Element

Layout defects rarely break a locator, so presence checks miss them. Position commands close that gap.

Selenium IDE indicates the position of an element by measuring (in pixels) how far it is from the left or top edge of the browser window.

* **verifyElementPositionLeft** – verifies if the specified number of pixels match the distance of the element from the left edge of the page. This will return FALSE if the value specified does not match the distance from the left edge.
* **verifyElementPositionTop** – verifies if the specified number of pixels match the distance of the element from the top edge of the page. This will return FALSE if the value specified does not match the distance from the top edge.

The script below records the expected pixel offsets in the Value column.

[](https://www.guru99.com/images/image005.png)

Treat these two commands with care. A pixel offset changes with the window size, the zoom level and the installed fonts, so a hard-coded number that passes on one machine can fail on another.

## Wait Commands in Selenium

A verify command can only inspect what is already on screen, so a check that runs too early fails even though the application is working. Wait commands solve that timing problem.

The following are the types of wait commands in Selenium

### RELATED ARTICLES

* [Selenium Tutorial – Guru99 ](https://www.guru99.com/selenium-tutorial.html "Selenium Tutorial – Guru99")
* [How to Handle Dynamic Web Tables in Selenium ](https://www.guru99.com/handling-dynamic-selenium-webdriver.html "How to Handle Dynamic Web Tables in Selenium")
* [How to Maximize Browser Window in Selenium ](https://www.guru99.com/maximize-resize-minimize-browser-selenium.html "How to Maximize Browser Window in Selenium")
* [Top 50 TestNG Interview Questions and Answers (2026) ](https://www.guru99.com/testng-interview-questions.html "Top 50 TestNG Interview Questions and Answers (2026)")

### andWait commands

These are commands that will wait for a new page to load before moving onto the next command.

Examples are

* clickAndWait
* typeAndWait
* selectAndWait

Every one of them is an ordinary action command with the AndWait suffix attached, as the recorded step below shows.

[](https://www.guru99.com/images/image006.png)

### waitFor commands

These are commands that wait for a specified condition to become true before proceeding to the next command (irrespective of loading of a new page). These commands are more appropriate to be used on AJAX-based dynamic websites that change values and elements without reloading the whole page. Examples include:

* waitForTitle
* waitForTextPresent
* waitForAlert

Consider the Facebook scenario below.

[](https://www.guru99.com/images/image007.png)

We can use a combination of “click” and “waitForTextPresent” to verify the presence of the text “Providing your birthday.”

[](https://www.guru99.com/images/image008.png)

We cannot use clickAndWait because no page was loaded upon clicking on the “Why do I need to provide my birthday?” link. If we do, the test will fail

The same rule applies to any content injected by script rather than by navigation, which is why [AJAX-driven screens](https://www.guru99.com/handling-ajax-call-selenium-webdriver.html) almost always need waitFor rather than andWait.

## Assert vs Verify vs waitFor Commands in Selenium IDE

Beginners frequently pick the wrong family and then wonder why a suite stops on the first defect, or why it reports twenty failures that all trace back to one. The three prefixes answer three different questions.

| Prefix      | What it does                           | On failure                                                | Best used for                                                              |
| ----------- | -------------------------------------- | --------------------------------------------------------- | -------------------------------------------------------------------------- |
| **assert**  | Checks a condition immediately         | Logs the failure and stops the test case                  | Preconditions — a login that must succeed before anything else makes sense |
| **verify**  | Checks a condition immediately         | Logs the failure and continues with the next command      | Independent checks, such as several labels on one confirmation page        |
| **waitFor** | Polls until the condition becomes true | Logs the failure once the timeout expires, then continues | Anything that appears late — AJAX responses, spinners, dialogs             |

A practical pattern combines all three: assert the page you landed on, waitFor the element that arrives asynchronously, then verify each individual field. Doing it in that order means one broken navigation stops the test early, while a handful of cosmetic mismatches are all reported in a single run. The same discipline carries over to [Selenium](https://www.guru99.com/selenium-tutorial.html) tests written in code, where the equivalents are hard assertions, soft assertions and explicit waits.

## Verify and Wait Commands in the Current Selenium IDE

The Firefox-plugin IDE that produced the screenshots above was retired, and the command set was rebuilt for the current browser extension. Several Selenese names survived, some were renamed, and a few were dropped. The table below maps the commands used in this article to their present-day equivalents, taken from the official [Selenium IDE command reference](https://www.selenium.dev/selenium-ide/docs/en/api/commands).

| Legacy Selenese command                              | Command in the current IDE                                         |
| ---------------------------------------------------- | ------------------------------------------------------------------ |
| verifyElementPresent                                 | verify element present                                             |
| verifyElementNotPresent                              | verify element not present                                         |
| verifyTextPresent                                    | verify text (scoped to an element locator, not the whole page)     |
| verifyTextNotPresent                                 | verify not text (scoped to an element locator)                     |
| verifyTitle                                          | verify title                                                       |
| verifyElementPositionLeft / verifyElementPositionTop | No equivalent — position assertions were dropped                   |
| clickAndWait, typeAndWait, selectAndWait             | No AndWait suffix — the open command already waits for a page load |
| waitForElementPresent                                | wait for element present, with a wait time in milliseconds         |
| waitForAlert                                         | assert alert or verify alert text after the dialog appears         |

Two differences matter most in day-to-day work. First, the current wait commands — wait for element present, wait for element visible, wait for element editable and their negative twins — each take an explicit wait time in milliseconds, so a slow step no longer has to share one global timeout. Second, the page-wide text search is gone: verify text needs a locator, which usually produces a sharper check anyway.

## Common Errors with Verify and waitFor Commands

Most reported problems with these commands are not defects in the IDE. The list below covers the failures that come up most often and what fixes each one.

* **The element exists but the check still fails.** Presence and visibility are different states. An element hidden behind a CSS rule is still present in the DOM, so pair the presence check with wait for element visible when the test depends on the user actually seeing it.
* **A text check fails on wording that looks identical.** Non-breaking spaces, trailing whitespace and curly apostrophes copied from a design document all break an exact match. Retype the expected string by hand rather than pasting it.
* **A wait command times out on a page that clearly loaded.** The element is usually inside an iframe. Run select frame first, otherwise the locator is evaluated against the wrong document.
* **clickAndWait hangs on a single-page application.** No navigation happens, so there is nothing to wait for. Replace it with a click plus the appropriate waitFor command.
* **A position check passes locally and fails on the build server.** Screen size and font rendering differ. Prefer a presence or text check, or set an explicit window size at the start of the test.
* **The whole suite stops at the first mismatch.** An assert command was recorded where a verify command was intended. Switch the prefix and the run will report every failure instead of just the first.

Once a script survives these traps, the next step is usually to [store runtime values in variables](https://www.guru99.com/store-variables-handling-selenium-ide.html) so the checks compare against real data rather than hard-coded strings.

## FAQs

⏱️ How long does a wait command keep trying before it gives up?

The legacy IDE shared one global timeout across every waitFor step, changed with the setTimeout command. The current extension takes an explicit wait time in milliseconds on each wait command, so a single slow screen no longer forces every other step to wait as long.

🔁 Is the pause command a reasonable substitute?

No. Pause always sleeps for the full duration, so it wastes time when the page is fast and still fails when the page is slow. Reach for it only to demonstrate a step during a demo, never in a suite you intend to run repeatedly.

🧷 Does a presence check also prove the element is visible?

It does not. Presence means the node exists in the DOM, which stays true for elements hidden by CSS or positioned off screen. When the test depends on the user seeing something, add wait for element visible alongside the presence check.

📝 Can I check text inside one element instead of the whole page?

Yes, and the current IDE requires it. Its verify text command takes an element locator plus the expected string, which is stricter than the old page-wide search and stops an unrelated menu item from satisfying a check it was never meant to satisfy.

📤 What happens to these checks when I export the test to code?

Code export turns each command into an equivalent statement in the target language, so a wait step becomes an explicit WebDriver wait. Read the generated file before trusting it, because timeouts and soft-versus-hard failure behaviour do not always survive the translation intact.

🤖 How does AI help find flaky verify and wait steps?

Machine learning models read historical run data and flag the steps that fail intermittently rather than consistently, which is the signature of a missing wait. AI-assisted locator repair tackles the other common cause by proposing a new selector when markup changes.

🚀 Can GitHub Copilot convert waitFor steps into WebDriver waits?

It handles the mechanical part well — turning a wait step into a WebDriverWait with an expected condition. Review the timeout it picks and the condition it chooses, since a generated presence condition often needs to be a visibility condition instead.

🖼️ Why does a check fail when the element sits inside an iframe?

Locators are evaluated against the currently selected document, and an iframe is a separate one. Run the select frame command first, then the check, and return to the top document afterwards so the following steps are not searched in the wrong context.

#### Summarize this post with:

ChatGPT Perplexity Grok Google AI 

**Stay Updated on AI** **Get Weekly AI Skills, Trends, Actionable Advice.** 

##### Sign up for the newsletter

Subscribe for Free 

You have successfully subscribed.  
Please check your inbox. 

![AI-Newsletter]() Chosen by over **350,000+** professionals 

[Scroll to top ](#wrapper)Scroll to top 

× 

Toggle Menu Close 

Search for: 

Search

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.guru99.com/#organization","name":"Guru99","sameAs":["https://www.facebook.com/Guru99Official","https://twitter.com/guru99com"],"logo":{"@type":"ImageObject","@id":"https://www.guru99.com/#logo","url":"https://www.guru99.com/images/guru99-logo-v1-150x59.png","contentUrl":"https://www.guru99.com/images/guru99-logo-v1-150x59.png","caption":"Guru99","inLanguage":"en-US"}},{"@type":"WebSite","@id":"https://www.guru99.com/#website","url":"https://www.guru99.com","name":"Guru99","publisher":{"@id":"https://www.guru99.com/#organization"},"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https://www.guru99.com/images/verify-element-present-waitfor-command-in-selenium.png","url":"https://www.guru99.com/images/verify-element-present-waitfor-command-in-selenium.png","width":"700","height":"250","caption":"Verify Element Present &amp; waitFor Command in Selenium","inLanguage":"en-US"},{"@type":"BreadcrumbList","@id":"https://www.guru99.com/enhancing-selenium-ide-script.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":"1","item":{"@id":"https://www.guru99.com","name":"Home"}},{"@type":"ListItem","position":"2","item":{"@id":"https://www.guru99.com/selenium","name":"Selenium"}},{"@type":"ListItem","position":"3","item":{"@id":"https://www.guru99.com/enhancing-selenium-ide-script.html","name":"Verify Element Present &amp; waitFor Command in Selenium"}}]},{"@type":"WebPage","@id":"https://www.guru99.com/enhancing-selenium-ide-script.html#webpage","url":"https://www.guru99.com/enhancing-selenium-ide-script.html","name":"Verify Element Present &amp; waitFor Command in Selenium","dateModified":"2026-07-30T13:19:08+05:30","isPartOf":{"@id":"https://www.guru99.com/#website"},"primaryImageOfPage":{"@id":"https://www.guru99.com/images/verify-element-present-waitfor-command-in-selenium.png"},"inLanguage":"en-US","breadcrumb":{"@id":"https://www.guru99.com/enhancing-selenium-ide-script.html#breadcrumb"}},{"@type":"Person","@id":"https://www.guru99.com/author/admin","name":"Krishna Rungta","url":"https://www.guru99.com/author/admin","image":{"@type":"ImageObject","@id":"https://www.guru99.com/images/krishna-rungta-v2-120x120.png","url":"https://www.guru99.com/images/krishna-rungta-v2-120x120.png","caption":"Krishna Rungta","inLanguage":"en-US"},"worksFor":{"@id":"https://www.guru99.com/#organization"}},{"articleSection":"Selenium","headline":"Verify Element Present &amp; waitFor Command in Selenium","description":"In this tutorial, we look at commands that will make your automation script more intelligent and complete.","keywords":"selenium","speakable":{"@type":"SpeakableSpecification","cssSelector":[".entry-title",".summary"]},"@type":"Article","author":{"@id":"https://www.guru99.com/author/admin","name":"Krishna Rungta"},"dateModified":"2026-07-30T13:19:08+05:30","image":{"@id":"https://www.guru99.com/images/verify-element-present-waitfor-command-in-selenium.png"},"copyrightYear":"2026","name":"Verify Element Present &amp; waitFor Command in Selenium","subjectOf":[{"@type":"FAQPage","mainEntity":[{"@type":"Question","name":"How long does a wait command keep trying before it gives up?","acceptedAnswer":{"@type":"Answer","text":"The legacy IDE shared one global timeout across every waitFor step, changed with the setTimeout command. The current extension takes an explicit wait time in milliseconds on each wait command, so a single slow screen no longer forces every other step to wait as long."}},{"@type":"Question","name":"Is the pause command a reasonable substitute?","acceptedAnswer":{"@type":"Answer","text":"No. Pause always sleeps for the full duration, so it wastes time when the page is fast and still fails when the page is slow. Reach for it only to demonstrate a step during a demo, never in a suite you intend to run repeatedly."}},{"@type":"Question","name":"Does a presence check also prove the element is visible?","acceptedAnswer":{"@type":"Answer","text":"It does not. Presence means the node exists in the DOM, which stays true for elements hidden by CSS or positioned off screen. When the test depends on the user seeing something, add wait for element visible alongside the presence check."}},{"@type":"Question","name":"Can I check text inside one element instead of the whole page?","acceptedAnswer":{"@type":"Answer","text":"Yes, and the current IDE requires it. Its verify text command takes an element locator plus the expected string, which is stricter than the old page-wide search and stops an unrelated menu item from satisfying a check it was never meant to satisfy."}},{"@type":"Question","name":"What happens to these checks when I export the test to code?","acceptedAnswer":{"@type":"Answer","text":"Code export turns each command into an equivalent statement in the target language, so a wait step becomes an explicit WebDriver wait. Read the generated file before trusting it, because timeouts and soft-versus-hard failure behaviour do not always survive the translation intact."}},{"@type":"Question","name":"How does AI help find flaky verify and wait steps?","acceptedAnswer":{"@type":"Answer","text":"Machine learning models read historical run data and flag the steps that fail intermittently rather than consistently, which is the signature of a missing wait. AI-assisted locator repair tackles the other common cause by proposing a new selector when markup changes."}},{"@type":"Question","name":"Can GitHub Copilot convert waitFor steps into WebDriver waits?","acceptedAnswer":{"@type":"Answer","text":"It handles the mechanical part well \u2014 turning a wait step into a WebDriverWait with an expected condition. Review the timeout it picks and the condition it chooses, since a generated presence condition often needs to be a visibility condition instead."}},{"@type":"Question","name":"Why does a check fail when the element sits inside an iframe?","acceptedAnswer":{"@type":"Answer","text":"Locators are evaluated against the currently selected document, and an iframe is a separate one. Run the select frame command first, then the check, and return to the top document afterwards so the following steps are not searched in the wrong context."}}]}],"@id":"https://www.guru99.com/enhancing-selenium-ide-script.html#schema-1155857","isPartOf":{"@id":"https://www.guru99.com/enhancing-selenium-ide-script.html#webpage"},"publisher":{"@id":"https://www.guru99.com/#organization"},"inLanguage":"en-US","mainEntityOfPage":{"@id":"https://www.guru99.com/enhancing-selenium-ide-script.html#webpage"}}]}
```
