முக்கிய உள்ளடக்கத்திற்குச் செல்லவும்

custom$$

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