function TraversableElement::attachFileToField
Attach file to file field with specified locator.
Parameters
string $locator input id, name or label:
string $path path to file:
Return value
void
Throws
See also
NodeElement::attachFile
File
-
vendor/
behat/ mink/ src/ Element/ TraversableElement.php, line 301
Class
- TraversableElement
- Traversable element.
Namespace
Behat\Mink\ElementCode
public function attachFileToField(string $locator, string $path) {
$field = $this->findField($locator);
if (null === $field) {
throw new ElementNotFoundException($this->getDriver(), 'form field', 'id|name|label|value', $locator);
}
$field->attachFile($path);
}