Package: geb.navigator

## [Groovy] Class SearchContextBasedBasicLocator

- geb.navigator.SearchContextBasedBasicLocator

- All Implemented Interfaces and Traits:
    BasicLocator

      class SearchContextBasedBasicLocator
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor and description
    `SearchContextBasedBasicLocator (SearchContext searchContext, NavigatorFactory navigatorFactory)`
    `SearchContextBasedBasicLocator (Collection<? extends SearchContext> searchContexts, NavigatorFactory navigatorFactory)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `Navigator` | `find(By bySelector)`
    `Navigator` | `find(Map<String, Object> attributes, String selector)`
    `protected Navigator` | `findUsingByIfPossible(Map<String, Object> attributes, String selector)`
    `protected boolean` | `hasStringValueForKey(Map<String, Object> attributes, String key)`
    `protected Navigator` | `navigatorFor(Collection<WebElement> contextElements)`
    `protected String` | `optimizeSelector(String selector, Map<String, Object> attributes)` Optimizes the selector by translating attributes map into a css attribute selector if possible.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Constructor Detail

    - #### SearchContextBasedBasicLocator(SearchContext searchContext, NavigatorFactory navigatorFactory)

    - #### SearchContextBasedBasicLocator(Collection<? extends SearchContext> searchContexts, NavigatorFactory navigatorFactory)

  - ### Method Detail

    - #### @Override Navigator find(By bySelector)

    - #### @Override Navigator find(Map<String, Object> attributes, String selector)

    - #### protected Navigator findUsingByIfPossible(Map<String, Object> attributes, String selector)

    - #### protected boolean hasStringValueForKey(Map<String, Object> attributes, String key)

    - #### protected Navigator navigatorFor(Collection<WebElement> contextElements)

    - #### protected String optimizeSelector(String selector, Map<String, Object> attributes)

      Optimizes the selector by translating attributes map into a css attribute selector if possible. Note this method has a side-effect in that it _removes_ those keys from the predicates map.