fun findOne()

in remote-robot/src/main/kotlin/com/intellij/remoterobot/search/Finder.kt [19:35]


    fun findOne(locator: Locator): RemoteComponent {
        return when (locator) {
            is XpathLocator ->
                if (where != null) {
                    finderClient.findByXpath(where.remoteComponent.id, locator.xpath)
                } else {
                    finderClient.findByXpath(locator.xpath)
                }

            is LambdaLocator ->
                if (where != null) {
                    finderClient.findByLambda(where.remoteComponent.id, locator.searchFunction.pack(true))
                } else {
                    finderClient.findByLambda(locator.searchFunction.pack(true))
                }
        }
    }