Class Icon

All Implemented Interfaces:
AlluriumElement, ListComponent, WebElementMeta

public class Icon extends UIElement
Represents an `Icon` element in the UI, extending UIElement.

This class provides constructors and static factory methods to initialize and interact with icon elements, identified by locators or SelenideElement.

Features:

  • Encapsulates behavior and attributes of an icon element.
  • Provides multiple constructors for initialization using:
    • Selenide locators as strings
    • Selenium By locators
    • SelenideElement instances
  • Offers static factory methods for convenient creation of `Icon` objects.
  • Automatically sets the element type to "icon".

Purpose:

  • Standardizes the interaction with icon elements in the UI.
  • Simplifies the creation of `Icon` objects using various initialization methods.

Constructors:

Static Factory Methods:

Usage Example:

 
 // Creating an icon using a Selenide locator
 Icon icon = Icon.$icon("div.icon-class");

 // Creating an icon using a Selenium locator and a custom name
 Icon namedIcon = Icon.$icon(By.cssSelector(".icon-class"), "Custom Icon");
 
 
  • Constructor Details

    • Icon

      public Icon()
    • Icon

      public Icon(String selenideLocator)
    • Icon

      public Icon(String selenideLocator, String name)
    • Icon

      public Icon(org.openqa.selenium.By locator)
    • Icon

      public Icon(org.openqa.selenium.By locator, String name)
    • Icon

      public Icon(com.codeborne.selenide.SelenideElement selenideElement)
    • Icon

      public Icon(com.codeborne.selenide.SelenideElement selenideElement, String name)
  • Method Details

    • $icon

      public static Icon $icon(org.openqa.selenium.By locator)
    • $icon

      public static Icon $icon(org.openqa.selenium.By locator, String name)
    • $icon

      public static Icon $icon(com.codeborne.selenide.SelenideElement selenideElement)
    • $icon

      public static Icon $icon(com.codeborne.selenide.SelenideElement selenideElement, String name)
    • $icon

      public static Icon $icon(String selenideLocator)
    • $icon

      public static Icon $icon(String selenideLocator, String name)
    • _$icon

      public static Icon _$icon(String xpath)