WebElementProxy
class WebElementProxy extends AbstractProxy implements IWebElement (View source)
Class for lazy-proxy creation to ensure, that WebElements are really accessed only at moment, when user needs them.
Properties
protected string | $elementClass | Element class, that is allowed in the collection. | from AbstractElementCollection |
protected string | $className | Class name to proxy. | from AbstractProxy |
protected mixed | $object | Object to proxy. | from AbstractProxy |
protected IElementLocator | $locator | Locator, that can be used to find associated elements on a page. | from AbstractProxy |
protected boolean | $locatorUsed | Determines if a locator was used to locate the elements. | from AbstractProxy |
protected IPageFactory | $pageFactory | Page Factory, that allows to create more elements on demand. | from AbstractProxy |
Methods
Determines if an element can be added to a collection.
Creates new collection by wrapping given array of Node elements.
Determines if class is NodeElement aware.
Checks that element's class is allowed in collection.
No description
Proxies read access for properties to the sub-object.
Proxies write access for properties to the sub-object.
Proxies all methods to sub-object.
Locates object inside proxy.
Details
at line 34
__construct(IElementLocator $locator, IPageFactory $page_factory)
Initializes proxy for WebElement.
protected boolean
acceptElement(mixed $element)
Determines if an element can be added to a collection.
in AbstractProxy at line 241
void
offsetSet(mixed $index, mixed $newval)
Offset to set.
static AbstractElementCollection
fromNodeElements(array $node_elements, string $element_class = null, IPageFactory $page_factory)
Creates new collection by wrapping given array of Node elements.
protected boolean
isNodeElementAware(string $class_name)
Determines if class is NodeElement aware.
protected boolean
assertElement(mixed $element)
Checks that element's class is allowed in collection.
at line 25
Expectation
shouldReceive(string $name)
in AbstractProxy at line 87
IProxy
setClassName(string $class_name)
Sets class name, used inside the proxy.
in AbstractProxy at line 102
mixed
__get(string $property)
Proxies read access for properties to the sub-object.
in AbstractProxy at line 138
void
__set(string $property, mixed $value)
Proxies write access for properties to the sub-object.
in AbstractProxy at line 176
mixed
__call(string $method, array $arguments)
Proxies all methods to sub-object.
in AbstractProxy at line 209
protected NodeElement
locateElement()
Locates element using the locator.
in AbstractProxy at line 222
protected NodeElement[]
locateElements()
Locates elements using the locator.
in AbstractProxy at line 255
boolean
offsetExists(mixed $index)
Whether a offset exists.
in AbstractProxy at line 269
void
offsetUnset(mixed $index)
Offset to unset.
in AbstractProxy at line 283
mixed|null
offsetGet(mixed $index)
Offset to retrieve.
in AbstractProxy at line 295
integer
count()
Count elements of an object.
in AbstractProxy at line 307
ArrayIterator
getIterator()
Returns the array iterator.
at line 52
protected mixed
locateObject()
Locates object inside proxy.
in AbstractProxy at line 326
mixed
getObject()
Returns class instance, that was placed inside a proxy.