Package allurium.primitives
Class Label
java.lang.Object
allurium.primitives.UIElement
allurium.primitives.Label
- All Implemented Interfaces:
AlluriumElement,ListComponent,WebElementMeta
Represents a `Label` element in the UI, extending
UIElement.
This class encapsulates the behavior and attributes of a label element, typically used to display non-interactive text in the UI.
Features:
- Encapsulates behavior and attributes of a label element.
- Provides multiple constructors for initialization using:
- Selenide locators as strings
- Selenium
Bylocators SelenideElementinstances
- Offers static factory methods for convenient creation of `Label` objects.
Purpose:
- Standardizes the interaction with label elements in the UI.
- Simplifies the creation of `Label` objects using various initialization methods.
Constructors:
Label()- Default constructor.Label(String)- Creates a `Label` using a Selenide locator string.Label(String, String)- Creates a `Label` using a Selenide locator string and a name.Label(By)- Creates a `Label` using a SeleniumBylocator.Label(By, String)- Creates a `Label` using a SeleniumBylocator and a name.Label(SelenideElement)- Creates a `Label` from aSelenideElement.Label(SelenideElement, String)- Creates a `Label` from aSelenideElementwith a name.
Static Factory Methods:
$label(By)- Creates a `Label` using a SeleniumBylocator.$label(SelenideElement)- Creates a `Label` from aSelenideElement.$label(String)- Creates a `Label` using a Selenide locator string.$label(SelenideElement, String)- Creates a `Label` from aSelenideElementwith a name.$label(By, String)- Creates a `Label` using a SeleniumBylocator and a name.$label(String, String)- Creates a `Label` using a Selenide locator string and a name._$label(String)- Creates a `Label` using an XPath expression.
Usage Example:
// Creating a label using a Selenide locator
Label label = $label("label.class");
// Creating a label using a Selenium locator and a custom name
Label namedLabel = $label(By.cssSelector(".label-class"), "Custom Label");
-
Field Summary
Fields inherited from class allurium.primitives.UIElement
assignNameMethod, description, id, parent, root, stepsConsoleLoggingEnabled, stepsReportLoggingEnabled, uiElementName, uiElementType -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class allurium.primitives.UIElement
_$uiElement, $uiElement, $uiElement, $uiElement, $uiElement, $uiElement, $uiElement, applyName, applyName, as, assertEmpty, assertEquals, assertExists, assertExists, assertHasCssClass, assertHasCssClass, assertHasNotCssClass, assertHasNotCssClass, assertHasNotCssClass, assertHasText, assertIsNotEmpty, assertNotExist, assertNotExist, assertNotVisible, assertNotVisible, assertNotVisible, assertText, assertVisible, assertVisible, assertVisible, assertVisible, assertVisibleInViewport, click, click, click, click, click, clickAndHold, clickAndHold, clickAndHold, contextClick, contextClick, contextClick, doubleClick, doubleClick, doubleClick, get, getAllureCompiledStep, getAttribute, getHeight, getId, getStepText, getUiElementName, getWidth, hover, hover, hover, isDisplayed, logStep, logStepToReport, logStepToReport, scrollTo, scrollTo, scrollTo, setRoot, setRoot, text, verifyEmpty, verifyIsNotEmpty, wrappedNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface allurium.interfaces.AlluriumElement
getRootMethods inherited from interface allurium.interfaces.WebElementMeta
getDescription, getMetaKeys, getParent, setAssignNameMethod, setDescription, setParent, setUiElementName
-
Constructor Details
-
Label
public Label() -
Label
-
Label
-
Label
public Label(org.openqa.selenium.By locator) -
Label
-
Label
public Label(com.codeborne.selenide.SelenideElement selenideElement) -
Label
-
-
Method Details
-
$label
-
$label
-
$label
-
$label
-
$label
-
$label
-
_$label
-