protected Navigator find()

in module/geb-core/src/main/groovy/geb/navigator/SearchContextBasedBasicLocator.groovy [116:133]


    protected Navigator find(
            Map<String, Object> attributes,
            String selector = MATCH_ALL_SELECTOR,
            @ClosureParams(value = FromString, options = "Boolean,org.openqa.selenium.By,Map<String, Object>") Closure<Navigator> navigatorFromBy
    ) {
        def attributesCopy = attributes.clone()
        def selectedUsingBy = findUsingByIfPossible(attributesCopy, selector, navigatorFromBy)
        if (selectedUsingBy != null) {
            return selectedUsingBy
        }

        def optimizedSelector = optimizeSelector(selector, attributesCopy)
        if (optimizedSelector) {
            navigatorFromBy.call(dynamic(attributes), By.cssSelector(optimizedSelector), attributesCopy)
        } else {
            find(attributes, MATCH_ALL_SELECTOR)
        }
    }