What is Find Element In Selenium?

What is Find Element In Selenium?

Hey Tobi,

The Find Element In Selenium command is used to uniquely identify a (one) web element within the web page. The first element with the matching property will be returned. If the element does not exist in the current DOM, a NoSuchElementException will be raised.

In Selenium WebDriver, there are a number of ways we can interact with these elements like entering text into text boxes, clicking on buttons, checkboxes etc. But before performing any of these actions, we need to locate that web element.

How to find an element?

There are various methods available which can be used to locate an element in a web page. These methods are given below:

  1. By ID

  2. By Name

  3. By ClassName

  4. By Tag Name

  5. By CSS Selector

  6. By LinkText

  7. By PartialLink Text

  8. By XPath

To know how to find Element by Text in Selenium WebDriver, please go through the following article:

1 Like