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

कस्टम$$

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

उपयोग
$(selector).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('myStrat', (selector) => {
return document.querySelectorAll(selector)
})

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

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

Welcome! How can I help?

WebdriverIO AI Copilot