What are WebElements in a web page?

It’s most important concept in the context of Selenium WebDriver. Selenium WebDriver interacts with the webpages with the help these WebElements. Now the question is what actually it is?

Actually each webpage contains lots of elements like textboxes, dropdowns, buttons etc. These are called the webElements. Suppose take the example of the main search page of google.com. The main search box has the following code.

This view can be obtained by pressing F12 on any browser. And it will look like as mentioned below.

In the above code the webElelemt is input type. And it has attributes like “title” , “type” and “name” with corresponding values like “Search” ,”text” and “q”.

So to identify this search box and to perform various user actions on this element, the above mentioned attributes can be used with the corresponding values.

For more posts related to Selenium please visit;- Selenium Interview Questions

Also some other good sources are :- guru99.com , selenium.dev