Package allurium.inputs
Class UploadField
java.lang.Object
allurium.primitives.UIElement
allurium.inputs.UploadField
- All Implemented Interfaces:
AlluriumElement,ListComponent,WebElementMeta
Represents an upload field (``) in the UI, extending
UIElement.
This class provides utility methods for interacting with file upload elements, allowing files to be uploaded via
file paths or File objects.
Features:
- Supports file uploads using absolute file paths or Java
Fileobjects. - Extends
UIElementto inherit generic element interaction capabilities.
Purpose:
- Encapsulates behavior specific to file upload fields.
- Simplifies file upload interactions in tests.
-
Field Summary
Fields inherited from class allurium.primitives.UIElement
assignNameMethod, description, id, parent, root, stepsConsoleLoggingEnabled, stepsReportLoggingEnabled, uiElementName, uiElementType -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.UploadField(com.codeborne.selenide.SelenideElement selenideElement) Constructor that initializes an upload field using a Selenide element.UploadField(com.codeborne.selenide.SelenideElement selenideElement, String name) Constructor that initializes an upload field using a Selenide element and a name.UploadField(String selenideSelector) Constructor that initializes an upload field using a Selenide locator string.UploadField(String selenideSelector, String name) Constructor that initializes an upload field using a Selenide locator string and a name.UploadField(org.openqa.selenium.By rootLocator) Constructor that initializes an upload field using a SeleniumBylocator.UploadField(org.openqa.selenium.By rootLocator, String name) Constructor that initializes an upload field using a SeleniumBylocator and a name. -
Method Summary
Modifier and TypeMethodDescriptionstatic UploadField_$uploadField(String xpath) Creates an upload field instance using an XPath string.static UploadField$uploadField(com.codeborne.selenide.SelenideElement selenideElement) Creates an upload field instance using a Selenide element.static UploadField$uploadField(com.codeborne.selenide.SelenideElement selenideElement, String name) Creates an upload field instance using a Selenide element and a name.static UploadField$uploadField(String selenideLocator) Creates an upload field instance using a Selenide locator string.static UploadField$uploadField(String selenideLocator, String name) Creates an upload field instance using a Selenide locator string and a name.static UploadField$uploadField(org.openqa.selenium.By locator) Creates an upload field instance using a SeleniumBylocator.static UploadField$uploadField(org.openqa.selenium.By locator, String name) Creates an upload field instance using a SeleniumBylocator and a name.voiduploadFile(File file) Uploads a file to the upload field using aFileobject.voiduploadFile(String filePath) Uploads a file to the upload field using an absolute file path.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
-
UploadField
public UploadField()Default constructor. Initializes the element type as "upload_input". -
UploadField
public UploadField(org.openqa.selenium.By rootLocator) Constructor that initializes an upload field using a SeleniumBylocator.- Parameters:
rootLocator- the Selenium locator for the upload field
-
UploadField
Constructor that initializes an upload field using a SeleniumBylocator and a name.- Parameters:
rootLocator- the Selenium locator for the upload fieldname- the name of the upload field
-
UploadField
Constructor that initializes an upload field using a Selenide locator string.- Parameters:
selenideSelector- the Selenide locator as a string
-
UploadField
Constructor that initializes an upload field using a Selenide locator string and a name.- Parameters:
selenideSelector- the Selenide locator as a stringname- the name of the upload field
-
UploadField
public UploadField(com.codeborne.selenide.SelenideElement selenideElement) Constructor that initializes an upload field using a Selenide element.- Parameters:
selenideElement- the Selenide element representing the upload field
-
UploadField
Constructor that initializes an upload field using a Selenide element and a name.- Parameters:
selenideElement- the Selenide element representing the upload fieldname- the name of the upload field
-
-
Method Details
-
$uploadField
Creates an upload field instance using a SeleniumBylocator.- Parameters:
locator- the Selenium locator for the upload field- Returns:
- a new
UploadFieldinstance
-
$uploadField
Creates an upload field instance using a SeleniumBylocator and a name.- Parameters:
locator- the Selenium locator for the upload fieldname- the name of the upload field- Returns:
- a new
UploadFieldinstance
-
$uploadField
Creates an upload field instance using a Selenide locator string.- Parameters:
selenideLocator- the Selenide locator as a string- Returns:
- a new
UploadFieldinstance
-
$uploadField
Creates an upload field instance using a Selenide locator string and a name.- Parameters:
selenideLocator- the Selenide locator as a stringname- the name of the upload field- Returns:
- a new
UploadFieldinstance
-
$uploadField
Creates an upload field instance using a Selenide element.- Parameters:
selenideElement- the Selenide element representing the upload field- Returns:
- a new
UploadFieldinstance
-
$uploadField
public static UploadField $uploadField(com.codeborne.selenide.SelenideElement selenideElement, String name) Creates an upload field instance using a Selenide element and a name.- Parameters:
selenideElement- the Selenide element representing the upload fieldname- the name of the upload field- Returns:
- a new
UploadFieldinstance
-
_$uploadField
Creates an upload field instance using an XPath string.- Parameters:
xpath- the XPath string for the upload field- Returns:
- a new
UploadFieldinstance
-
uploadFile
Uploads a file to the upload field using an absolute file path.Step: Processed by Aspect
- Parameters:
filePath- the absolute path to the file
-
uploadFile
Uploads a file to the upload field using aFileobject.- Parameters:
file- theFileobject to upload
-