public WebElement getWebElement ( ) { List < WebElement > elements = getWebElements ( ) ; if ( elements . size ( ) > match ) { return elements . get ( match ) ; } String reason = this . prettyOutputStart ( ) + " was not located on the page" ; if ( ! elements . isEmpty ( ) ) { reason += ", but " + elements . size ( ) + " elements matching the locator were. Try using a lower match" ; } throw new NoSuchElementException ( reason ) ; }
Retrieves the identified matching web element using Webdriver . Use this sparingly only when the action you want to perform on the element isn t available as commands from it won t be checked logged caught or screenshotted .