मुख्य सामग्री पर जाएं

कस्टम$$

customs$$ आपको browser.addLocatorStrategy का उपयोग करके घोषित की गई कस्टम रणनीति का उपयोग करने की अनुमति देता है। कस्टम सेलेक्टर रणनीतियों के बारे में अधिक जानकारी सेलेक्टर डॉक्स में पढ़ें।

उपयोग​
browser.custom$$(strategyName, strategyArguments)
पैरामीटर्स​
नामप्रकारविवरण
strategyNamestring
strategyArguments*
उदाहरण​
example.js
it('should get all the plugin wrapper buttons', async () => {
await browser.url('https://webdriver.io')
await browser.addLocatorStrategy('myStrategy', (selector) => {
return document.querySelectorAll(selector)
})

const pluginWrapper = await browser.custom$$('myStrategy', '.pluginWrapper')

console.log(await pluginWrapper.length) // 4
})
रिटर्न्स​
  • <WebdriverIO.ElementArray>

Welcome! How can I help?

WebdriverIO AI Copilot