All IT Courses 50% Off
Selenium Tutorials

Introduction to Verify Element Present and Wait in Selenium IDE

Verify Presence of an Element

There are two commands to check the presence of a UI element on a web page:

  • verify element present: This command is used to check if an element is present on the web page. If this command fails, then the execution will not stop and continue with the next commands. It will return TRUE if the specified element is present on the page; otherwise, it returns FALSE.
  • verify element not present: This command is used to check if an element is not present on the web page. If this command fails, then the execution will not stop and continue with the next commands. It will return FALSE if the specified element is not present on the page; otherwise, it returns TRUE.

Below is an example to verify that the UserName text box is visible within the Mercury Tours homepage, and the First Name text box is not. The First Name text box is present on the Registration page of the Mercury Tours website and not on the homepage.

Introduction to Verify Element Present and Wait in Selenium IDE

Wait commands

These commands are used when we want to wait for a specified condition to become true before moving on to the next command. 

 

  • wait for element editable: Suppose any element that is non-editable on the web page gets editable after some time, then we use this command. It will wait for the element to become editable.

 

To understand this, we will navigate to http://omayo.blogspot.com/, and we will wait for the checkbox to become editable after we click on Check this button.

Introduction to Verify Element Present and Wait in Selenium IDE

 

  • wait for element not editable: Suppose any element that is editable on the web page gets non-editable after some time, then we use this command. It will wait for the element to become non-editable.

 

To understand this, we will navigate to http://omayo.blogspot.com/, and we will wait for the button to become non-editable after we click on Try it button.

Introduction to Verify Element Present and Wait in Selenium IDE

 

  • wait for element visible: Suppose any element that is not visible on the web page gets visible after some time, then we use this command. It will wait for the element to become visible.

 

Let us take an example:

Introduction to Verify Element Present and Wait in Selenium IDE

Here “This text is displayed after 10 seconds of wait” get displayed on the web page after waiting for 10 seconds.

  • wait for element not visible: Suppose any element that is visible on the web page gets invisible after some time, then we use this command. It will wait for the element to disappear from the web page.

Introduction to Verify Element Present and Wait in Selenium IDE

To execute the above scenario, we will use wait for element not visible command.

Introduction to Verify Element Present and Wait in Selenium IDE

 

  • wait for element present: This command will wait for the element to be present on the web page.

 

Introduction to Verify Element Present and Wait in Selenium IDE

 

  • wait for element not present: This command will wait for the element to be not present on the web page.

 

Introduction to Verify Element Present and Wait in Selenium IDE

 

Facebook Comments
Tags

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Articles

Back to top button
Close
Close

Get Selenium Training Online
Course Now at 50%OFF!

Offer valid for 1st 20 seats only, Hurry up!!

You have successfully subscribed to the newsletter

There was an error while trying to send your request. Please try again.

H2kinfosys will use this information to be in touch with you for providing updates.