×

CSS Selector: Class in selenium IDE

CSS Selector: Class

Identify a web element with the help of Class as a CSS Selector is like using id attribute. The only difference between Class and id is in their syntax.

The value of a class attribute is used to access the web element.

Syntax of Class Attribute:

css= [HTML tag][.][Value of class attributes]

 [.]: Itis mandatory while using a Class attribute to create a CSS Selector.

We will take an example of an Email text box present in the login form of facbook.com

  • Launch the Firefox browser.
  • And type https://www.facebook.com in Google search box; it will redirect you to the Facebook login page.
  • Where you inspect the email text box web element and notice that the html tag is input and the value of the class attribute is input.login_form_input_box
CSS Selector Class

To verify the locator

  • Open the Test Script Editor Box in selenium IDE and click on the command text box,

And write command as:

Command =verify element present 

Value = css=input.login_form_input_box

CSS Selector Class
  • Click on the Find button. 
  • To verify that the value of a locator is correct or not, you can check in a browser that the Email Text box is highlighted or not.
CSS Selector Class 2

NOTE:  When multiple elements have the same HTML tag and name, then only the first element in source code will be considered.

For example, both email and the password text box have the same class name as: “input text login_form_input_box.”

In this case, the email text box is the first element, so the source code of this element would be considered first.

CSS Selector Class 3

Related Topics

Selenium IDE Commands

Selenium –IDE Commands (SELENESE): Selenese commands are the set of commands used in Selenium IDE. Selenese command has two parameters target and value. Selenese command tests the existence of UI elements based on their HTML tags,...

3 minutes read.

WebDriver Interface | Class Diagram

WebDriver interface/class diagram: The interface of WebDriver includes the following stages, which is as follows: Search Context Web driver Remote web driver Driver class Search Context  The first interface of the web driver class is search Context,...

2 minutes read.

Advantages and Disadvantages of Selenium-IDE

Advantages and Disadvantages of Selenium-IDE Advantages of Selenium IDE: UI based record and playback tool. Easy to understand & developed a test script. Selenium-IDE test script export into web driver code & Selenium–RC It is...

1 minute read.

XPath Axes Selenium WebDriver

XPath Axes XPath axes are those axes that are used to search for the multiple nodes in the XML document from the current node context. These methods are mainly used when the...

14 minutes read.

WebDriver-Partial Link Text locator

WebDriver-Partial Link Text locator In selenium WebDriver, there is an additional way to find a web link element with the help of partial link text locator. The partial link text is used...

4 minutes read.

Selenium WebDriver installation

Installation Steps of Selenium WebDriver In this tutorial, we will see the process of selenium webdriver installation. Selenium WebDriver installation process is done in four Stages: Java Installation (version 8 or higher version) Eclipse...

4 minutes read.

Difference between Selenium WebDriver and Selenium RC

Difference between Selenium WebDriver, and Selenium RC: Selenium WebDriver and selenium RC (Remote Control) both are different in any manners which we see later in this tutorial, let us see the...

3 minutes read.

Drag and Drop Event Handling

Drag and Drop Event Handling: In this tutorial, we will learn how to handle the drag and drop event in selenium WebDriver using the action class. Before going further in this tutorial...

6 minutes read.

WebDriver-Class Name Locator

WebDriver-Class Name Locator In this tutorial, we will learn about the Class name locator of selenium WebDriver. The Class Name locator is used to identify any element in UI based on the...

4 minutes read.

Selenium WebDriver - IE [Internet Explorer] browser

Selenium WebDriver - IE [Internet Explorer] browser In this segment, we will understand how to run a test script with the help of the IE (Internet Explorer) browser. It is a standalone...

4 minutes read.

Selenium WebDriver- Radio button handling

Selenium WebDriver- Radio button handling In this tutorial, we will be learning about handling the radio button in selenium WebDriver. Let us take one example to give you a better understanding of...

3 minutes read.

WebDriver-Id Locator

WebDriver-Id Locator: The Id Locator is used to identify any web element in UI with the help of the ID attribute. The First preference is always goes to ID locator while inspecting...

4 minutes read.

WebDriver-Tag Name Locator

Selenium WebDriver-Tag Name Locator The tag name locator is used along with the findElements() method to identify multiple similar elements in the UI. It is used to locate the web element with...

3 minutes read.

Selenium WebDriver-CSS Selector: Tag and Attribute

Selenium WebDriver-CSS Selector: Tag and Attribute We will locate the web element with the help of Tag and attribute CSS selector in this section of the tutorial. Where Tag and attribute are...

5 minutes read.

Selenium WebDriver-CSS Selector locator

Selenium WebDriver-CSS Selector locator A CSS selector is used to identify the web element based on their “# id” and “. Class”, Html tags, and attributes. A CSS stands for Cascading Style...

1 minute read.

Selenium Tool Suite

The selenium tool suite is a combination of multiple software tools, and the entire tools having a different approach to support automation testing. Selenium test tool suites are as follows- Selenium...

2 minutes read.

Selenium-IDE Installation in Mozilla Firefox

A beginners guides to Selenium-IDE Installation Since Selenium IDE is designed only for Firefox and Chrome plug-in, we are assuming that you have already installed the Mozilla Firefox browser in your...

1 minute read.

Selenium WebDriver Characteristics

Characteristics of Selenium WebDriver Some of the essential characteristics of Selenium WebDriver are as follows: Multiple Operating System Support Selenium Webdriver supports multiple operating systems like: Desktop OS: Window, Linux, and macOS Mobile OS:...

2 minutes read.

Selenium WebDriver-XPath Locator

Selenium WebDriver-XPath Locator The locators can make the object identification of all the selenium tools. There are eight locators available in selenium web driver, but most of the time we go for...

14 minutes read.

Selenium-IDE Locators

Selenium-IDE Locators: Before we start learning about Selenium –IDE Locators, firstly we have to learn about UI elements. UI Elements -UI elements are the elements which are displayed on the web application....

1 minute read.