class FileInput extends AbstractTypifiedElement implements ISimpleSetter (View source)

Represents web page file upload element.

Constants

CRITERION_TAG

CRITERION_ATTRS

Properties

private string $_name Name of the element. from AbstractTypifiedElement
private WebElement $_wrappedElement Wrapped element. from AbstractTypifiedElement
private IPageFactory $_pageFactory Stores instance of used page factory. from AbstractTypifiedElement
protected array $acceptanceCriteria List of acceptance criteria.

Methods

__construct(WebElement $wrapped_element, IPageFactory $page_factory)

Specifies wrapped WebElement.

fromNodeElement(NodeElement $node_element, IPageFactory $page_factory)

Creates Element instance based on existing NodeElement instance.

void
assertWrappedElement()

Checks that wrapped element meets the acceptance criteria.

boolean
isTagNameMatching(array $criterion)

Checks if the tag name(s) of the criterion are matching.

boolean
isAttributeMatching(array $criterion)

Checks if the attributes of the criterion are matching.

boolean
isValueMatchingCriterionDefinition(string $value, string $criterion)

Checks if passed value matching the defined criterion.

getWrappedElement()

Returns wrapped element.

setName(string $name)

Sets a name of an element.

string
getName()

Returns name of the entity.

Session
getSession() deprecated

Returns element session.

getPageFactory()

Returns page factory, used during object creation.

boolean
isVisible()

Checks whether current node is visible on page.

boolean
isValid()

Checks if an element is still valid.

boolean
hasAttribute(string $name)

Checks whether element has attribute with specified name.

mixed|null
getAttribute(string $name)

Returns specified attribute value.

string
getXpath()

Returns XPath for handled element.

string
getTagName()

Returns current node tag name.

Escaper
getXpathEscaper()

Returns the XPath escaper.

boolean
isSeleniumDriver()

Checks, that Selenium driver is used.

string
__toString()

Returns string representation of element.

Expectation
shouldReceive(string $name)

No description

boolean
isMultiple()

Indicates whether this select element support selecting multiple options at the same time.

setFileToUpload(string $filename)

Sets a file to be uploaded.

setValue(mixed $value)

Sets value to the element.

Details

__construct(WebElement $wrapped_element, IPageFactory $page_factory)

Specifies wrapped WebElement.

Parameters

WebElement $wrapped_element Element to be wrapped.
IPageFactory $page_factory Page factory.

static INodeElementAware fromNodeElement(NodeElement $node_element, IPageFactory $page_factory)

Creates Element instance based on existing NodeElement instance.

Parameters

NodeElement $node_element Node element.
IPageFactory $page_factory Page factory.

Return Value

INodeElementAware

protected void assertWrappedElement()

Checks that wrapped element meets the acceptance criteria.

Return Value

void

Exceptions

TypifiedElementException When no criteria matches.

protected boolean isTagNameMatching(array $criterion)

Checks if the tag name(s) of the criterion are matching.

Parameters

array $criterion The criterion.

Return Value

boolean

protected boolean isAttributeMatching(array $criterion)

Checks if the attributes of the criterion are matching.

Parameters

array $criterion The criterion.

Return Value

boolean

protected boolean isValueMatchingCriterionDefinition(string $value, string $criterion)

Checks if passed value matching the defined criterion.

Parameters

string $value Value to match.
string $criterion The criterion.

Return Value

boolean

WebElement getWrappedElement()

Returns wrapped element.

Return Value

WebElement

ITypifiedElement setName(string $name)

Sets a name of an element.

This method is used by initialization mechanism and is not intended to be used directly.

Parameters

string $name Name to set.

Return Value

ITypifiedElement

string getName()

Returns name of the entity.

Return Value

string

Session getSession() deprecated

deprecated Accessing the session from the element is deprecated as of 1.2 and will be impossible in 2.0.

Returns element session.

Return Value

Session

protected IPageFactory getPageFactory()

Returns page factory, used during object creation.

Return Value

IPageFactory

boolean isVisible()

Checks whether current node is visible on page.

Return Value

boolean

boolean isValid()

Checks if an element is still valid.

Return Value

boolean

boolean hasAttribute(string $name)

Checks whether element has attribute with specified name.

Parameters

string $name Attribute name.

Return Value

boolean

mixed|null getAttribute(string $name)

Returns specified attribute value.

Parameters

string $name Attribute name.

Return Value

mixed|null

string getXpath()

Returns XPath for handled element.

Return Value

string

string getTagName()

Returns current node tag name.

Return Value

string

Escaper getXpathEscaper()

Returns the XPath escaper.

Return Value

Escaper

protected boolean isSeleniumDriver()

Checks, that Selenium driver is used.

Return Value

boolean

string __toString()

Returns string representation of element.

Return Value

string

Expectation shouldReceive(string $name)

Parameters

string $name

Return Value

Expectation

boolean isMultiple()

Indicates whether this select element support selecting multiple options at the same time.

Return Value

boolean

FileInput setFileToUpload(string $filename)

Sets a file to be uploaded.

Parameters

string $filename Filename.

Return Value

FileInput

Exceptions

FileInputException When file could not be found on disk.

ISimpleSetter setValue(mixed $value)

Sets value to the element.

Parameters

mixed $value New value.

Return Value

ISimpleSetter