Skip to main content


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)


  • using: string selector used to search element. See details of using.
  • by: by constant. The type of selector. See details of by.
  • noWait: boolean indicating whether to wait for the element to be found on page. See details of noWait.


  • Unique elementId that identifies a page element.


main = findElement('main', by.role)# main is the elementId