findElement
Finds an element from page using a selector and it's type. The search for the element starts from the root of document. An error is thrown if the element is not found.
findElement(using, by)
# Or
findElement(using, by, noWait)Parameters#
using:stringselector used to search element. See details of using.by:byconstant. The type of selector. See details of by.noWait:booleanindicating whether to wait for the element to be found on page. See details of noWait.
Returns#
- Unique
elementIdthat identifies a page element.
Example#
main = findElement('main', by.role)# main is the elementId