UNPKG

appium-geckodriver

Version:

Appium driver for Gecko-based browsers and web views

22 lines 1.09 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.findElOrEls = findElOrEls; const support_1 = require("appium/support"); /** * Find element(s) by given strategy and selector. If context is provided, search will be performed within the context element. * This is needed to make lookup by image working. * @this GeckoDriver * @param strategy - The strategy to use for finding the element(s) (e.g., 'css selector', 'xpath', etc.) * @param selector - The selector to use for finding the element(s) * @param mult - Whether to find multiple elements (true) or a single element (false) * @param context - Optional context element ID to search within * @returns A promise that resolves to the found element(s) */ async function findElOrEls(strategy, selector, mult, context) { const endpoint = `/element${context ? `/${support_1.util.unwrapElement(context)}/element` : ''}${mult ? 's' : ''}`; return await this.gecko.proxy.command(endpoint, 'POST', { using: strategy, value: selector, }); } //# sourceMappingURL=find.js.map